summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Rakefile20
-rw-r--r--application.rb9
-rw-r--r--lazar.rb3
3 files changed, 4 insertions, 28 deletions
diff --git a/Rakefile b/Rakefile
deleted file mode 100644
index f4e10d6..0000000
--- a/Rakefile
+++ /dev/null
@@ -1,20 +0,0 @@
-require 'rubygems'
-require 'rake'
-require 'tasks/opentox'
-
-desc "Install required gems"
-task :install do
- puts `sudo gem sources -a http://gems.github.com`
- puts `sudo gem install sinatra datamapper dm-more builder helma-opentox-ruby-api-wrapper`
-end
-
-desc "Update gems"
-task :update do
- puts `sudo gem update sinatra datamapper dm-more builder helma-opentox-ruby-api-wrapper`
-end
-
-desc "Run tests"
-task :test do
- load 'test/test.rb'
-end
-
diff --git a/application.rb b/application.rb
index 2b33b9f..b892201 100644
--- a/application.rb
+++ b/application.rb
@@ -1,5 +1,5 @@
require 'rubygems'
-gem "opentox-ruby-api-wrapper", "= 1.6.2"
+gem "opentox-ruby-api-wrapper", "= 1.6.4"
require 'opentox-ruby-api-wrapper'
class Model
@@ -57,12 +57,7 @@ end
delete '/?' do
# TODO delete datasets
Model.auto_migrate!
- response['Content-Type'] = 'text/plain'
- "All Models deleted."
-end
-
-delete '/prediction?' do
Prediction.auto_migrate!
response['Content-Type'] = 'text/plain'
- "All datasets deleted."
+ "All models and cached predictions deleted."
end
diff --git a/lazar.rb b/lazar.rb
index 80015b4..83f926d 100644
--- a/lazar.rb
+++ b/lazar.rb
@@ -318,7 +318,6 @@ post '/:id/?' do # create prediction
if cached_prediction = Prediction.first(:model_uri => lazar.uri, :compound_uri => compound_uri)
@prediction = YAML.load(cached_prediction.yaml)
else
- #unless @prediction = YAML.load(Prediction.first(:model_uri => lazar.uri, :compound_uri => compound_uri).yaml)
begin
# AM: switch here between regression and classification
eval "lazar.#{prediction_type}(compound_uri,@prediction,true) unless lazar.database_activity?(compound_uri,@prediction)"
@@ -333,6 +332,8 @@ post '/:id/?' do # create prediction
@prediction.to_yaml
when 'application/rdf+xml'
@prediction.to_owl
+ else
+ halt 400, "MIME type \"#{request.env['HTTP_ACCEPT']}\" not supported."
end
elsif dataset_uri