aboutsummaryrefslogtreecommitdiffstats
path: root/bin/ri
diff options
context:
space:
mode:
Diffstat (limited to 'bin/ri')
-rwxr-xr-xbin/ri10
1 files changed, 5 insertions, 5 deletions
diff --git a/bin/ri b/bin/ri
index eaca302681..0cc2f73bb6 100755
--- a/bin/ri
+++ b/bin/ri
@@ -10,11 +10,11 @@ require 'rubygems'
version = ">= 0.a"
-if ARGV.first
- str = ARGV.first
- str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
- if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
- version = $1
+str = ARGV.first
+if str
+ str = str.b[/\A_(.*)_\z/, 1]
+ if str and Gem::Version.correct?(str)
+ version = str
ARGV.shift
end
end