diff options
author | mguetlein <martin.guetlein@gmail.com> | 2011-01-13 14:10:59 +0100 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2011-01-13 14:10:59 +0100 |
commit | 1db377c898a49417c669a52aaf75014f6a31158f (patch) | |
tree | af2391c8efb293124dd1c4672112d9afced51a40 /lib | |
parent | f2ca545448ab8a6f654309f23cfce9416b2e9856 (diff) |
remove old classification? in model.rb, add ie hack to overwrite
Diffstat (limited to 'lib')
-rw-r--r-- | lib/model.rb | 36 | ||||
-rw-r--r-- | lib/overwrite.rb | 6 |
2 files changed, 5 insertions, 37 deletions
diff --git a/lib/model.rb b/lib/model.rb index fb266e0..1671ba7 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -56,42 +56,6 @@ module OpenTox raise "unknown model "+[@dependentVariable.feature_type, @metadata[OT.isA], @metadata[DC.title], @uri].inspect end -# def classification? -# # TODO test on various services / request to ontology service needed? -# # TODO replace bool (for classification/regression) with string value (more types are coming) -# #raise "classification?: type: "+@type.to_s+", title: "+@title.to_s+", uri: "+@uri.to_s+" "+((@uri =~ /class/) != nil).to_s -# -# load_metadata if @metadata==nil or @metadata.size==0 or (@metadata.size==1 && @metadata.values[0]==@uri) -# @dependentVariable = OpenTox::Feature.find( @metadata[OT.dependentVariables] ) unless @dependentVariable -# case @dependentVariable.feature_type -# when "classification" -# return true -# when "regression" -# return false -# end -# -# if @metadata[OT.isA] =~ /(?i)classification/ -# return true -# end -# -# if @metadata[DC.title] =~ /(?i)classification/ -# return true -# elsif @metadata[DC.title] =~ /(?i)regression/ -# return false -# elsif @uri =~/ntua/ and @metadata[DC.title] =~ /mlr/ -# return false -# elsif @uri =~/tu-muenchen/ and @metadata[DC.title] =~ /regression|M5P|GaussP/ -# return false -# elsif @uri =~/ambit2/ and @metadata[DC.title] =~ /pKa/ || @metadata[DC.title] =~ /Regression|Caco/ -# return false -# elsif @uri =~/majority/ -# return (@uri =~ /class/) != nil -# else -# raise "unknown model, uri:'"+@uri.to_s+"' title:'"+@metadata[DC.title].to_s+"'" -# end -# end -# end - end # Lazy Structure Activity Relationship class diff --git a/lib/overwrite.rb b/lib/overwrite.rb index e5ed5c3..ffeba21 100644 --- a/lib/overwrite.rb +++ b/lib/overwrite.rb @@ -1,6 +1,10 @@ # class overwrites aka monkey patches # hack: store sinatra in global var to make url_for and halt methods accessible -before{ $sinatra = self unless $sinatra } +before { + $sinatra = self unless $sinatra + # stupid internet explorer does not ask for text/html, add this manually + request.env['HTTP_ACCEPT'] += ";text/html" if request.env["HTTP_USER_AGENT"]=~/MSIE/ +} # handle errors manually # this is to return 502, when an error occurs during a rest-call (see rest_client_wrapper.rb) |