diff options
author | Christoph Helma <helma@in-silico.ch> | 2010-11-30 12:43:04 +0100 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2010-11-30 12:43:04 +0100 |
commit | d3190ba5fd87db05bdf3219dae00afaf31257718 (patch) | |
tree | 32a929a8512922522d3ed303616058713ace9310 | |
parent | 8ff5d7de9683d9bbe6103dd42d10aefbf2f4a021 (diff) |
Accept: text/uri-list for running algoritms
-rw-r--r-- | lib/algorithm.rb | 2 | ||||
-rw-r--r-- | lib/task.rb | 6 | ||||
-rw-r--r-- | opentox-ruby.gemspec (renamed from opentox-ruby-api-wrapper.gemspec) | 19 |
3 files changed, 7 insertions, 20 deletions
diff --git a/lib/algorithm.rb b/lib/algorithm.rb index a6fa4a7..a2f7786 100644 --- a/lib/algorithm.rb +++ b/lib/algorithm.rb @@ -15,7 +15,7 @@ module OpenTox # @param [optional,Hash] params Algorithm parameters # @return [String] URI of new resource (dataset, model, ...) def run(params=nil) - RestClientWrapper.post(@uri, params).to_s + RestClientWrapper.post(@uri, {:accept => 'text/uri-list'}, params).to_s end # Get OWL-DL representation in RDF/XML format diff --git a/lib/task.rb b/lib/task.rb index 5b59395..17f95e6 100644 --- a/lib/task.rb +++ b/lib/task.rb @@ -243,10 +243,10 @@ module OpenTox "'" unless @metadata[OT.resultURI] and @metadata[OT.resultURI].to_s.uri? if completed? if @http_code == 202 - raise "illegal task state, code is 202, but hasStatus is not Running: '"+@metadata[OT.hasStatus]+"'" unless running? + raise "#{@uri}: illegal task state, code is 202, but hasStatus is not Running: '"+@metadata[OT.hasStatus]+"'" unless running? elsif @http_code == 201 - raise "illegal task state, code is 201, but hasStatus is not Completed: '"+@metadata[OT.hasStatus]+"'" unless completed? - raise "illegal task state, code is 201, resultURI is no task-URI: '"+@metadata[OT.resultURI].to_s+ + raise "#{@uri}: illegal task state, code is 201, but hasStatus is not Completed: '"+@metadata[OT.hasStatus]+"'" unless completed? + raise "#{@uri}: illegal task state, code is 201, resultURI is no task-URI: '"+@metadata[OT.resultURI].to_s+ "'" unless @metadata[OT.resultURI] and @metadata[OT.resultURI].to_s.uri? end rescue => ex diff --git a/opentox-ruby-api-wrapper.gemspec b/opentox-ruby.gemspec index fd00851..e89af96 100644 --- a/opentox-ruby-api-wrapper.gemspec +++ b/opentox-ruby.gemspec @@ -4,15 +4,15 @@ # -*- encoding: utf-8 -*- Gem::Specification.new do |s| - s.name = %q{opentox-ruby-api-wrapper} + s.name = %q{opentox-ruby} s.version = "0.0.1" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= - s.authors = ["Christoph Helma, Martin Guetlein"] + s.authors = ["Christoph Helma, Martin Guetlein, Andreas Maunz, Micha Rautenberg, David Vorgrimmler"] s.date = %q{2010-11-24} s.description = %q{Ruby wrapper for the OpenTox REST API (http://www.opentox.org)} s.email = %q{helma@in-silico.ch} - s.executables = ["opentox-install-ubuntu.sh", "yaml2owl.rb", "opentox-install-debian.sh"] + s.executables = ["opentox-install-ubuntu.sh", "opentox-install-debian.sh"] s.extra_rdoc_files = [ "LICENSE", "README.rdoc" @@ -24,26 +24,16 @@ Gem::Specification.new do |s| "VERSION", "bin/opentox-install-debian.sh", "bin/opentox-install-ubuntu.sh", - "bin/yaml2owl.rb", "lib/algorithm.rb", "lib/compound.rb", "lib/config/config_ru.rb", "lib/dataset.rb", "lib/environment.rb", - "lib/feature.rb", "lib/helper.rb", "lib/model.rb", - "lib/opentox-ruby-api-wrapper.rb", "lib/opentox.owl", - "lib/opentox.rb", "lib/overwrite.rb", - "lib/owl.rb.RDF", - "lib/owl.rb.nt", - "lib/owl.rb.rdfxml.initial", - "lib/owl.rb.redland", - "lib/parser.rb", "lib/rest_client_wrapper.rb", - "lib/serializer.rb", "lib/spork.rb", "lib/task.rb", "lib/templates/config.yaml", @@ -84,7 +74,6 @@ Gem::Specification.new do |s| s.add_runtime_dependency(%q<dm-mysql-adapter>, [">= 1"]) s.add_runtime_dependency(%q<dm-validations>, [">= 1"]) s.add_runtime_dependency(%q<haml>, [">= 3"]) - s.add_development_dependency(%q<cucumber>, [">= 0"]) s.add_development_dependency(%q<jeweler>, [">= 0"]) else s.add_dependency(%q<sinatra>, [">= 0"]) @@ -111,7 +100,6 @@ Gem::Specification.new do |s| s.add_dependency(%q<dm-mysql-adapter>, [">= 1"]) s.add_dependency(%q<dm-validations>, [">= 1"]) s.add_dependency(%q<haml>, [">= 3"]) - s.add_dependency(%q<cucumber>, [">= 0"]) s.add_dependency(%q<jeweler>, [">= 0"]) end else @@ -139,7 +127,6 @@ Gem::Specification.new do |s| s.add_dependency(%q<dm-mysql-adapter>, [">= 1"]) s.add_dependency(%q<dm-validations>, [">= 1"]) s.add_dependency(%q<haml>, [">= 3"]) - s.add_dependency(%q<cucumber>, [">= 0"]) s.add_dependency(%q<jeweler>, [">= 0"]) end end |