Skip to content
Browse files

Use String#slice with second arg instead of global.

  • Loading branch information...
1 parent aa16d3e commit ed1107e1afa298a9bd2130d32e4bad5ef68e4610 @phiggins phiggins committed Dec 20, 2011
Showing with 1 addition and 2 deletions.
  1. +1 −2 lib/rubygems/installer.rb
View
3 lib/rubygems/installer.rb
@@ -141,8 +141,7 @@ def check_executable_overwrite filename # :nodoc:
next unless io.gets =~ /This file was generated by RubyGems/
ruby_executable = true
- io.read =~ /^gem (['"])(.*?)(\1),/
- existing = $2
+ existing = io.read.slice(/^gem (['"])(.*?)(\1),/, 2)
end
return if spec.name == existing

0 comments on commit ed1107e

Please sign in to comment.
Something went wrong with that request. Please try again.