diff options
author | Andreas Maunz <andreas@maunz.de> | 2012-10-11 15:17:16 +0200 |
---|---|---|
committer | Andreas Maunz <andreas@maunz.de> | 2012-10-11 15:17:16 +0200 |
commit | 07be012059652ab3df9dbe62411a4661157be70c (patch) | |
tree | e3ea8f0c305438be19db5c374ac4f15e5df2873a | |
parent | 86dc7c291f06035b2b10df8605417cc14346f22d (diff) |
Using RestClient
-rw-r--r-- | lib/utils/html.rb | 3 | ||||
-rw-r--r-- | webapp/dataset.rb | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/utils/html.rb b/lib/utils/html.rb index f470a7d..aa4fe25 100644 --- a/lib/utils/html.rb +++ b/lib/utils/html.rb @@ -7,7 +7,8 @@ class String # encloses URI in text with with link tag # @return [String] new text with marked links def link_urls - self.gsub(/(?i)http(s?):\/\/[^\r\n\s']*/, '<a href="\0">\0</a>') + regex = Regexp.new '(https?:\/\/[\S]+)([>"])' + self.gsub( regex, '<a href="\1">\1</a>\2' ) end end diff --git a/webapp/dataset.rb b/webapp/dataset.rb index 7a2af84..c22210d 100644 --- a/webapp/dataset.rb +++ b/webapp/dataset.rb @@ -95,7 +95,7 @@ module OpenTox ds=OpenTox::Dataset.find("#{$dataset[:uri]}/#{dataset}",@subjectid) $logger.debug "AM: #{ds.compounds.size} compounds" ds.compounds.each { |cmpd| - ds_string = OpenTox::RestClientWrapper.post("#{$compound[:uri]}/#{cmpd.inchi}/pc", params, {:accept => "application/rdf+xml"}) + ds_string = RestClient.post("#{$compound[:uri]}/#{cmpd.inchi}/pc", params, {:accept => "application/rdf+xml"}) single_cmpd_ds = OpenTox::Dataset.new(nil,@subjectid) single_cmpd_ds.parse_rdfxml(ds_string) single_cmpd_ds.get(true) |