diff options
author | Martin Gütlein <martin.guetlein@gmail.com> | 2010-03-24 10:22:18 +0100 |
---|---|---|
committer | Martin Gütlein <martin.guetlein@gmail.com> | 2010-03-24 10:22:18 +0100 |
commit | 410c0c21e4c441c1cce66614ba80f2125911ae6a (patch) | |
tree | 520b2727e5e72822a48ce80dcb0d0075c2d5e8e9 | |
parent | ae962c2f3462951b3957dd2effbb6537c4b9dc44 (diff) | |
parent | 11759819e7aed01fbf2e1c6ba892c530a3fa34e5 (diff) |
Merge remote branch 'helma-task/development' into test
-rw-r--r-- | application.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/application.rb b/application.rb index 36bd845..2270c59 100644 --- a/application.rb +++ b/application.rb @@ -1,8 +1,10 @@ require 'rubygems' -gem 'opentox-ruby-api-wrapper', '= 1.2.7' +gem 'opentox-ruby-api-wrapper', '= 1.4.0' require 'opentox-ruby-api-wrapper' require "dm-is-tree" +LOGGER.progname = File.expand_path(__FILE__) + class Task include DataMapper::Resource property :id, Serial @@ -21,7 +23,7 @@ DataMapper.auto_upgrade! get '/?' do response['Content-Type'] = 'text/uri-list' - Task.all.collect{|t| t.uri}.join("\n") + Task.all.collect{|t| t.uri}.join("\n") + "\n" end get '/:id/?' do @@ -44,7 +46,7 @@ post '/?' do task.uri = url_for("/#{task.id}", :full) raise "could not save" unless task.save response['Content-Type'] = 'text/uri-list' - task.uri + task.uri + "\n" end put '/:id/:status/?' do @@ -52,10 +54,13 @@ put '/:id/:status/?' do task.status = params[:status] unless /pid|parent/ =~ params[:status] case params[:status] when "completed" + + LOGGER.debug "Task " + params[:id].to_s + " completed" task.resource = params[:resource] task.finished_at = DateTime.now task.pid = nil when "pid" + #LOGGER.debug "PID = " + params[:pid].to_s task.pid = params[:pid] when "parent" task.parent = Task.first(:uri => params[:uri]) |