From 5f54e69f9ed332bfb73e30bb6daed24955fe90f6 Mon Sep 17 00:00:00 2001 From: mguetlein Date: Wed, 28 Jul 2010 10:15:04 +0200 Subject: new owl version (should be backwards compatible), fix dirty features bug in dataset --- lib/task.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/task.rb') 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 -- cgit v1.2.3