diff options
author | Christoph Helma <helma@in-silico.de> | 2010-02-23 17:49:02 +0100 |
---|---|---|
committer | Christoph Helma <helma@in-silico.de> | 2010-02-23 17:49:02 +0100 |
commit | 7b59d1f07bf8cf0e23f3070f97f940af3bfad843 (patch) | |
tree | c74673fea079496b6ac5576662f3d6649d1028f2 /lib/compound.rb | |
parent | 66af8a8f648c41321189800cd81246f28d046fe6 (diff) |
some test issues resolved
Diffstat (limited to 'lib/compound.rb')
-rw-r--r-- | lib/compound.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/compound.rb b/lib/compound.rb index 56646c0..0ee853d 100644 --- a/lib/compound.rb +++ b/lib/compound.rb @@ -17,7 +17,8 @@ module OpenTox @inchi = sdf2inchi(params[:sdf]) @uri = File.join(@@config[:services]["opentox-compound"],URI.escape(@inchi)) elsif params[:name] - @inchi = RestClient.get("#{@@cactus_uri}#{params[:name]}/stdinchi").chomp + # paranoid URI encoding to keep SMILES charges and brackets + @inchi = RestClient.get("#{@@cactus_uri}#{URI.encode(params[:name], Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))}/stdinchi").chomp @uri = File.join(@@config[:services]["opentox-compound"],URI.escape(@inchi)) elsif params[:uri] @uri = params[:uri] |