opentox-ruby-api-wrapper 1.5.4 → 1.5.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.5.4
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 = RestClientWrapper.get("#{@@cactus_uri}#{URI.encode(params[:name], Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))}/stdinchi").chomp
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]
@@ -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 'helma@in-silico.ch'
46
+ mail.to MAIL[:user_name]
46
47
  mail.subject '[ERROR] %s'
47
- mail.from "toxcreate@in-silico.ch"
48
+ mail.from "#{Socket.gethostname}@#{MAIL[:domain]}"
48
49
  mail.smtp MAIL
49
50
  end
50
51
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 5
8
- - 4
9
- version: 1.5.4
8
+ - 5
9
+ version: 1.5.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Christoph Helma