opentox-ruby-api-wrapper 1.5.4 → 1.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/compound.rb +3 -1
- data/lib/config/config_ru.rb +4 -3
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.5.
|
1
|
+
1.5.5
|
data/lib/compound.rb
CHANGED
@@ -18,7 +18,9 @@ module OpenTox
|
|
18
18
|
@uri = File.join(@@config[:services]["opentox-compound"],URI.escape(@inchi))
|
19
19
|
elsif params[:name]
|
20
20
|
# paranoid URI encoding to keep SMILES charges and brackets
|
21
|
-
@inchi =
|
21
|
+
@inchi = RestClient.get("#{@@cactus_uri}#{URI.encode(params[:name], Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))}/stdinchi").body.chomp
|
22
|
+
# this was too hard for me to debug and leads to additional errors (ch)
|
23
|
+
#@inchi = RestClientWrapper.get("#{@@cactus_uri}#{URI.encode(params[:name], Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))}/stdinchi").chomp
|
22
24
|
@uri = File.join(@@config[:services]["opentox-compound"],URI.escape(@inchi))
|
23
25
|
elsif params[:uri]
|
24
26
|
@uri = params[:uri]
|
data/lib/config/config_ru.rb
CHANGED
@@ -18,7 +18,7 @@ set :raise_errors, true
|
|
18
18
|
end
|
19
19
|
|
20
20
|
use Rack::ShowExceptions
|
21
|
-
if MAIL
|
21
|
+
if defined?(MAIL)
|
22
22
|
|
23
23
|
# monkeypatch with the original method
|
24
24
|
# strangely enough my mailserver returns "Connection refused - connect(2)" errors without this patch
|
@@ -41,10 +41,11 @@ if MAIL
|
|
41
41
|
end
|
42
42
|
|
43
43
|
|
44
|
+
require "socket"
|
44
45
|
use Rack::MailExceptions do |mail|
|
45
|
-
mail.to
|
46
|
+
mail.to MAIL[:user_name]
|
46
47
|
mail.subject '[ERROR] %s'
|
47
|
-
mail.from "
|
48
|
+
mail.from "#{Socket.gethostname}@#{MAIL[:domain]}"
|
48
49
|
mail.smtp MAIL
|
49
50
|
end
|
50
51
|
end
|