summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChristoph Helma <ch@toxbank-ch.in-silico.ch>2012-02-15 22:53:14 +0000
committerChristoph Helma <ch@toxbank-ch.in-silico.ch>2012-02-15 22:53:14 +0000
commit6d88f38d61dbabd355a48e65bb49e94ba87a350c (patch)
tree3634c567a8eb1fea951cc9ed7dc3642a53e2f376 /lib
parent7ba9df992e8a0db4f3ff79754e48118e7dba1e0b (diff)
empty subjectids fixed, adjustments for ree 1.8.7
Diffstat (limited to 'lib')
-rw-r--r--lib/opentox-client.rb9
-rw-r--r--lib/opentox.rb4
2 files changed, 7 insertions, 6 deletions
diff --git a/lib/opentox-client.rb b/lib/opentox-client.rb
index bc297b5..7c7fb11 100644
--- a/lib/opentox-client.rb
+++ b/lib/opentox-client.rb
@@ -1,7 +1,8 @@
+require 'rubygems'
require 'rdf'
require 'rdf/raptor'
require "rest-client"
-require "opentox"
-require "task"
-require "compound"
-require "dataset"
+require File.join(File.dirname(__FILE__),"opentox.rb")
+require File.join(File.dirname(__FILE__),"task.rb")
+require File.join(File.dirname(__FILE__),"compound.rb")
+require File.join(File.dirname(__FILE__),"dataset.rb")
diff --git a/lib/opentox.rb b/lib/opentox.rb
index a9cbeab..51bc17a 100644
--- a/lib/opentox.rb
+++ b/lib/opentox.rb
@@ -154,7 +154,7 @@ module OpenTox
def create service_uri, subjectid=nil
uri = RestClient.post(service_uri, {}, :subjectid => subjectid).chomp
- eval("#{self}.new(\"#{uri}\", #{subjectid})")
+ subjectid ? eval("#{self}.new(\"#{uri}\", #{subjectid})") : eval("#{self}.new(\"#{uri}\")")
end
def from_file service_uri, file, subjectid=nil
@@ -163,7 +163,7 @@ module OpenTox
def all service_uri, subjectid=nil
uris = RestClient.get(service_uri, {:accept => 'text/uri-list'}).split("\n").compact
- uris.collect{|uri| eval "#{self}.new(\"#{uri}\", #{subjectid})"}
+ uris.collect{|uri| subjectid ? eval("#{self}.new(\"#{uri}\", #{subjectid})") : eval("#{self}.new(\"#{uri}\")")}
end
end