summaryrefslogtreecommitdiff
path: root/lib/task.rb
diff options
context:
space:
mode:
authormguetlein <martin.guetlein@gmail.com>2010-07-28 10:15:04 +0200
committermguetlein <martin.guetlein@gmail.com>2010-07-28 10:15:04 +0200
commit5f54e69f9ed332bfb73e30bb6daed24955fe90f6 (patch)
tree726648f8afe7c2b5e213a673f81716ba4955bc43 /lib/task.rb
parent94363088babbc613f8f49bae587775fde4c72392 (diff)
new owl version (should be backwards compatible), fix dirty features bug in dataset
Diffstat (limited to 'lib/task.rb')
-rw-r--r--lib/task.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/task.rb b/lib/task.rb
index 88bcb71..b563fe6 100644
--- a/lib/task.rb
+++ b/lib/task.rb
@@ -23,9 +23,9 @@ module OpenTox
end
public
- def self.find(uri)
+ def self.find( uri, accept_header='application/rdf+xml' )
task = Task.new(uri)
- task.reload
+ task.reload( accept_header )
return task
end
@@ -36,8 +36,8 @@ module OpenTox
return task
end
- def reload
- result = RestClientWrapper.get(uri, {:accept => 'application/rdf+xml'}, false)#'application/x-yaml'})
+ def reload( accept_header='application/rdf+xml' )
+ result = RestClientWrapper.get(uri, {:accept => accept_header}, false)#'application/x-yaml'})
@http_code = result.code
reload_from_data(result, result.content_type, uri)
end
@@ -95,8 +95,8 @@ module OpenTox
def wait_for_completion(dur=0.3)
if (@uri.match(@@config[:services]["opentox-task"]))
- due_to_time = Time.parse(@due_to_time)
- running_time = due_to_time - Time.parse(@date)
+ due_to_time = (@due_to_time.is_a?(Time) ? @due_to_time : Time.parse(@due_to_time))
+ running_time = due_to_time - (@date.is_a?(Time) ? @date : Time.parse(@date))
else
# the date of the external task cannot be trusted, offest to local time might be to big
due_to_time = Time.new + EXTERNAL_TASK_MAX_DURATION