summaryrefslogtreecommitdiff
path: root/lib/task.rb
diff options
context:
space:
mode:
authorChristoph Helma <ch@toxbank-ch.in-silico.ch>2012-02-15 17:20:24 +0000
committerChristoph Helma <ch@toxbank-ch.in-silico.ch>2012-02-15 17:20:24 +0000
commit7ba9df992e8a0db4f3ff79754e48118e7dba1e0b (patch)
treec9bd8ec8d29e8662231266741e405b306108318d /lib/task.rb
parent76e2c84c766fd37d702c45e76dc666230afcd136 (diff)
parent9ed209b262e0b540af967e24e9b9845600a0669c (diff)
Merge branch 'development' of github.com:opentox/opentox-client into development
Conflicts: lib/spork.rb lib/task.rb
Diffstat (limited to 'lib/task.rb')
-rw-r--r--lib/task.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/task.rb b/lib/task.rb
index cd5aa79..aee6c62 100644
--- a/lib/task.rb
+++ b/lib/task.rb
@@ -5,7 +5,7 @@ module OpenTox
# Class for handling asynchronous tasks
class Task
- def self.create service_uri, params
+ def self.create service_uri, params={}
task = Task.new RestClient.post(service_uri,params).chomp
pid = Spork.spork { yield }
task.pid = pid
@@ -45,10 +45,10 @@ module OpenTox
when /=/
res = RestClient.put(File.join(@uri,method.sub(/=/,'')),{})
super unless res.code == 200
- when /?/
+ when /\?/
return metadata[RDF::OT.hasStatus] == method.sub(/\?/,'').capitalize
else
- return metadata[RDF::OT[method]]
+ return metadata[RDF::OT[method]].to_s
end
rescue
super