Permalink
Browse files

tr is better than gsub.

  • Loading branch information...
unak committed Feb 12, 2014
1 parent 343fc01 commit 3f752b7b9c398509bc9bfaf5677e8e6f4ffa4664
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/rubygems/installer.rb
@@ -660,7 +660,7 @@ def windows_stub_script(bindir, bin_file_name)
return <<-TEXT
@ECHO OFF
IF NOT "%~f0" == "~f0" GOTO :WinNT
-@"#{bindir.gsub(/#{File::SEPARATOR}/, File::ALT_SEPARATOR)}\\#{ruby}" "#{File.join(bindir, bin_file_name)}" %1 %2 %3 %4 %5 %6 %7 %8 %9
+@"#{bindir.tr(File::SEPARATOR, File::ALT_SEPARATOR)}\\#{ruby}" "#{File.join(bindir, bin_file_name)}" %1 %2 %3 %4 %5 %6 %7 %8 %9
GOTO :EOF
:WinNT
@"%~dp0#{ruby}" "%~dpn0" %*

0 comments on commit 3f752b7

Please sign in to comment.