summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormr <mr@mrautenberg.de>2011-02-10 09:22:13 +0100
committermr <mr@mrautenberg.de>2011-02-10 09:22:13 +0100
commit65f6d64e57c81ae7b6dd72209fbeffee2d60da71 (patch)
tree4a40181bb75114d845f17e93dd581ebcb2dd1a09
parent03795f02e06b3a9c635abf92c112a9dec142364b (diff)
A&A fixes
-rw-r--r--lib/helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/helper.rb b/lib/helper.rb
index 415ca11..5a2436f 100644
--- a/lib/helper.rb
+++ b/lib/helper.rb
@@ -29,7 +29,7 @@ helpers do
# @param [String] uri
def clean_uri(uri)
uri = uri.sub(" ", "%20") #dirty hacks => to fix
- uri = uri[0,uri.index("InChI=")]
+ uri = uri[0,uri.index("InChI=")] if uri.index("InChI=")
out = URI.parse(uri)
out.path = out.path[0, out.path.length - (out.path.reverse.rindex(/\/{1}\d+\/{1}/))] if out.path.index(/\/{1}\d+\/{1}/) #cuts after /id/ for a&a