summaryrefslogtreecommitdiff
path: root/lib/task.rb
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2010-10-22 17:45:19 +0200
committerChristoph Helma <helma@in-silico.ch>2010-10-22 17:45:19 +0200
commitd6811507c1c1339cc4fe7cdb429b9b34b97dc422 (patch)
tree9cf87802db0b03e078077a52ecedd0994bbbd0e4 /lib/task.rb
parent3dd19c461d0b205ff504a85785f0c6e55114cd4e (diff)
new API with support for external services (initial version)
Diffstat (limited to 'lib/task.rb')
-rw-r--r--lib/task.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/task.rb b/lib/task.rb
index 1ab3893..50f0347 100644
--- a/lib/task.rb
+++ b/lib/task.rb
@@ -16,7 +16,7 @@ module OpenTox
# create is private now, use OpenTox::Task.as_task
def self.create( params )
- task_uri = RestClientWrapper.post(@@config[:services]["opentox-task"], params, nil, false).to_s
+ task_uri = RestClientWrapper.post(CONFIG[:services]["opentox-task"], params, nil, false).to_s
Task.find(task_uri.chomp)
end
@@ -36,7 +36,7 @@ module OpenTox
def reload( accept_header=nil )
unless accept_header
- if (@@config[:yaml_hosts].include?(URI.parse(uri).host))
+ if (CONFIG[:yaml_hosts].include?(URI.parse(uri).host))
accept_header = "application/x-yaml"
else
accept_header = 'application/rdf+xml'
@@ -99,7 +99,7 @@ module OpenTox
# waits for a task, unless time exceeds or state is no longer running
def wait_for_completion(dur=0.3)
- if (@uri.match(@@config[:services]["opentox-task"]))
+ if (@uri.match(CONFIG[:services]["opentox-task"]))
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
@@ -144,7 +144,7 @@ module OpenTox
#return yield nil
params = {:title=>title, :creator=>creator, :max_duration=>max_duration, :description=>description }
- task = OpenTox::Task.create(params)
+ task = ::OpenTox::Task.create(params)
task_pid = Spork.spork(:logger => LOGGER) do
LOGGER.debug "Task #{task.uri} started #{Time.now}"
$self_task = task