diff options
author | Christoph Helma <helma@in-silico.ch> | 2010-07-22 17:12:51 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2010-07-22 17:12:51 +0200 |
commit | 34a7b50fb278fc37c937f2fe170b86332eb054c5 (patch) | |
tree | e1debcb36000764b5c7e69e0f2d7e5b92fcb9833 /lib/compound.rb | |
parent | 05084b1127f0d2498240472cca8a475f48f1fcc4 (diff) |
CONFIG reverted to @@config
Diffstat (limited to 'lib/compound.rb')
-rw-r--r-- | lib/compound.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/compound.rb b/lib/compound.rb index 45b96b8..9366db4 100644 --- a/lib/compound.rb +++ b/lib/compound.rb @@ -11,19 +11,19 @@ module OpenTox def initialize(params) if params[:smiles] @inchi = smiles2inchi(params[:smiles]) - @uri = File.join(CONFIG[:services]["opentox-compound"],URI.escape(@inchi)) + @uri = File.join(@@config[:services]["opentox-compound"],URI.escape(@inchi)) elsif params[:inchi] @inchi = params[:inchi] - @uri = File.join(CONFIG[:services]["opentox-compound"],URI.escape(@inchi)) + @uri = File.join(@@config[:services]["opentox-compound"],URI.escape(@inchi)) elsif params[:sdf] @inchi = sdf2inchi(params[:sdf]) - @uri = File.join(CONFIG[:services]["opentox-compound"],URI.escape(@inchi)) + @uri = File.join(@@config[:services]["opentox-compound"],URI.escape(@inchi)) elsif params[:name] # paranoid URI encoding to keep SMILES charges and brackets @inchi = RestClient.get("#{@@cactus_uri}#{URI.encode(params[:name], Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))}/stdinchi").body.chomp # this was too hard for me to debug and leads to additional errors (ch) #@inchi = RestClientWrapper.get("#{@@cactus_uri}#{URI.encode(params[:name], Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))}/stdinchi").chomp - @uri = File.join(CONFIG[:services]["opentox-compound"],URI.escape(@inchi)) + @uri = File.join(@@config[:services]["opentox-compound"],URI.escape(@inchi)) elsif params[:uri] @uri = params[:uri] case params[:uri] @@ -56,7 +56,8 @@ module OpenTox end def image_uri - "#{@@ambit_uri}#{smiles}" + File.join @uri, "image" + #"#{@@ambit_uri}#{smiles}" #"#{@@cactus_uri}#{@inchi}/image" end |