diff options
author | Christoph Helma <helma@in-silico.de> | 2009-09-11 23:55:32 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.de> | 2009-09-11 23:55:32 +0200 |
commit | abd0e1ae7b933cbd1c1907dd9e7f1ce1782cf743 (patch) | |
tree | bf394da92dca45b292aa4635dc097c26e63bfab6 /lib/dataset.rb | |
parent | 59249a0febc2f90cd1643ddb7e3baa68e3f49065 (diff) |
InChI escaping fixed
Diffstat (limited to 'lib/dataset.rb')
-rw-r--r-- | lib/dataset.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/dataset.rb b/lib/dataset.rb index f6d0dd7..b635985 100644 --- a/lib/dataset.rb +++ b/lib/dataset.rb @@ -39,12 +39,13 @@ module OpenTox def import(params) if params[:csv] # RestClient seems not to work for file uploads + #RestClient.post @uri + '/import', :compound_format => params[:compound_format], :content_type => "text/csv", :file => File.new(params[:csv]) `curl -X POST -F "file=@#{params[:csv]};type=text/csv" -F compound_format=#{params[:compound_format]} #{@uri + '/import'}` end end def add(features) - HTTPClient.post @uri, {:features => features.to_yaml} + RestClient.post @uri, :features => features.to_yaml end # Get all compounds from a dataset @@ -58,7 +59,8 @@ module OpenTox # Get all features for a compound def feature_uris(compound) - RestClient.get(File.join(@uri, 'compound', compound.inchi)).split("\n") + uri = File.join(@uri, 'compound', CGI.escape(compound.inchi)) # URI.encode does not work here + RestClient.get(uri).split("\n") end # Get all features for a compound |