summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/compound.rb4
-rw-r--r--lib/config/config_ru.rb5
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/compound.rb b/lib/compound.rb
index cc29fc5..6ab78e0 100644
--- a/lib/compound.rb
+++ b/lib/compound.rb
@@ -18,7 +18,9 @@ module OpenTox
@uri = File.join(@@config[:services]["opentox-compound"],URI.escape(@inchi))
elsif params[:name]
# paranoid URI encoding to keep SMILES charges and brackets
- @inchi = RestClientWrapper.get("#{@@cactus_uri}#{URI.encode(params[:name], Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))}/stdinchi").chomp
+ @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))
elsif params[:uri]
@uri = params[:uri]
diff --git a/lib/config/config_ru.rb b/lib/config/config_ru.rb
index 8de82cb..34dfdf1 100644
--- a/lib/config/config_ru.rb
+++ b/lib/config/config_ru.rb
@@ -41,10 +41,11 @@ if MAIL
end
+ require "socket"
use Rack::MailExceptions do |mail|
- mail.to 'helma@in-silico.ch'
+ mail.to MAIL[:user_name]
mail.subject '[ERROR] %s'
- mail.from "toxcreate@in-silico.ch"
+ mail.from "#{Socket.gethostname}@#{MAIL[:domain]}"
mail.smtp MAIL
end
end