summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormguetlein <martin.guetlein@gmail.com>2010-05-06 17:18:15 +0200
committermguetlein <martin.guetlein@gmail.com>2010-05-06 17:18:15 +0200
commit2911ebe2c818a33513d263654f3a0c609e631404 (patch)
tree8522e52c8d4d2bd2f2c9fd9a54fd413a44e39f5f /lib
parent9e356d0d94ea4fe210ea7cefce5d4c1179cb63cd (diff)
adding ch's test service to yaml
Diffstat (limited to 'lib')
-rw-r--r--lib/dataset.rb6
-rw-r--r--lib/model.rb2
-rw-r--r--lib/task.rb2
3 files changed, 6 insertions, 4 deletions
diff --git a/lib/dataset.rb b/lib/dataset.rb
index ff07a6f..9304eec 100644
--- a/lib/dataset.rb
+++ b/lib/dataset.rb
@@ -15,7 +15,7 @@ module OpenTox
def self.find(uri, accept_header=nil)
unless accept_header
- if uri.match(@@config[:services]["opentox-dataset"])
+ if uri.match(@@config[:services]["opentox-dataset"]) || uri=~ /188.40.32.88/
accept_header = 'text/x-yaml'
else
accept_header = "application/rdf+xml"
@@ -51,6 +51,8 @@ module OpenTox
# returns uri of new dataset
def create_new_dataset( new_compounds, new_features, new_title, new_creator )
+ raise "no new compounds selected" unless new_compounds and new_compounds.size>0
+
# load require features
if ((defined? @dirty_features) && (@dirty_features - new_features).size > 0)
(@dirty_features - new_features).each{|f| load_feature_values(f)}
@@ -62,7 +64,7 @@ module OpenTox
dataset.features = new_features
dataset.compounds = new_compounds
- # Ccopy dataset data for compounds and features
+ # Copy dataset data for compounds and features
# PENDING: why storing feature values in an array?
new_compounds.each do |c|
data_c = []
diff --git a/lib/model.rb b/lib/model.rb
index 684873b..74bb598 100644
--- a/lib/model.rb
+++ b/lib/model.rb
@@ -76,7 +76,7 @@ module OpenTox
elsif @uri =~/ambit2/ and @title =~ /pKa/
return false
elsif @uri =~/majority/
- return @uri =~ /class/
+ return (@uri =~ /class/) != nil
else
raise "unknown model, uri:'"+@uri.to_s+"' title:'"+@title.to_s+"'"
end
diff --git a/lib/task.rb b/lib/task.rb
index 9cfba88..181b895 100644
--- a/lib/task.rb
+++ b/lib/task.rb
@@ -160,7 +160,7 @@ module OpenTox
task.completed(result)
rescue => ex
LOGGER.error "task failed: "+ex.message
- #LOGGER.error ": "+ex.backtrace.join("\n")
+ LOGGER.error ": "+ex.backtrace.join("\n")
task.error(ex.message)
end
end