diff options
author | Christoph Helma <helma@in-silico.ch> | 2012-02-23 17:56:46 +0000 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2012-02-23 17:56:46 +0000 |
commit | fa9069e13fb6b1c8bb4ebcdf82f1cf1c04ad71ca (patch) | |
tree | efe8bff6c3538c856805cadac832531aa6b0821e /lib/task.rb | |
parent | b651c4d199a7b4d6a06cdefb281601bddd2fc885 (diff) |
(partially) switched back to RestClientWrapper
Diffstat (limited to 'lib/task.rb')
-rw-r--r-- | lib/task.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/task.rb b/lib/task.rb index 9aaee04..286e998 100644 --- a/lib/task.rb +++ b/lib/task.rb @@ -7,7 +7,7 @@ module OpenTox attr_accessor :pid, :observer_pid def self.create service_uri, params={} - task = Task.new RestClient.post(service_uri,params).chomp + task = Task.new RestClientWrapper.post(service_uri,params).chomp pid = fork do begin result_uri = yield @@ -53,20 +53,20 @@ module OpenTox def cancel kill - RestClient.put(File.join(@uri,'Cancelled'),{}) + RestClientWrapper.put(File.join(@uri,'Cancelled'),{}) end def completed(uri) #TODO: subjectid? #TODO: error code raise "\"#{uri}\" does not exist." unless URI.accessible? uri - RestClient.put(File.join(@uri,'Completed'),{:resultURI => uri}) + RestClientWrapper.put(File.join(@uri,'Completed'),{:resultURI => uri}) end def error error $logger.error self if $logger report = ErrorReport.create(error,"http://localhost") - RestClient.put(File.join(@uri,'Error'),{:errorReport => report}) + RestClientWrapper.put(File.join(@uri,'Error'),{:errorReport => report}) kill end @@ -104,7 +104,7 @@ module OpenTox begin case method when /=/ - res = RestClient.put(File.join(@uri,method.sub(/=/,'')),{}) + res = RestClientWrapper.put(File.join(@uri,method.sub(/=/,'')),{}) super unless res.code == 200 #when /\?/ #return hasStatus == method.sub(/\?/,'').capitalize |