diff options
-rwxr-xr-x | bin/bundle | 10 | ||||
-rwxr-xr-x | bin/bundler | 10 | ||||
-rwxr-xr-x | bin/irb | 10 | ||||
-rwxr-xr-x | bin/rdoc | 10 | ||||
-rwxr-xr-x | bin/ri | 10 |
5 files changed, 25 insertions, 25 deletions
diff --git a/bin/bundle b/bin/bundle index 59dad21c60..1a0b06b005 100755 --- a/bin/bundle +++ b/bin/bundle @@ -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 diff --git a/bin/bundler b/bin/bundler index 7ef736899d..e15eb39ed7 100755 --- a/bin/bundler +++ b/bin/bundler @@ -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 @@ -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 @@ -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 @@ -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 |