Skip to content

use ruby interpreter in bindir in .bat #818

Merged
merged 5 commits into from May 9, 2014
View
4 lib/rubygems/installer.rb
@@ -660,10 +660,10 @@ def windows_stub_script(bindir, bin_file_name)
return <<-TEXT
@ECHO OFF
IF NOT "%~f0" == "~f0" GOTO :WinNT
-@"#{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
-@"#{ruby}" "%~dpn0" %*
+@"%~dp0#{ruby}" "%~dpn0" %*
TEXT
end
View
5 test/rubygems/test_gem_installer.rb
@@ -574,6 +574,9 @@ def test_generate_bin_symlink_update_remove_wrapper
def test_generate_bin_symlink_win32
old_win_platform = Gem.win_platform?
Gem.win_platform = true
+ old_alt_separator = File::ALT_SEPARATOR
+ File.__send__(:remove_const, :ALT_SEPARATOR)
+ File::ALT_SEPARATOR = '\\'
@installer.wrappers = false
util_make_exec
@installer.gem_dir = util_gem_dir
@@ -592,6 +595,8 @@ def test_generate_bin_symlink_win32
wrapper = File.read installed_exec
assert_match(/generated by RubyGems/, wrapper)
ensure
+ File.__send__(:remove_const, :ALT_SEPARATOR)
+ File::ALT_SEPARATOR = old_alt_separator
Gem.win_platform = old_win_platform
end
Something went wrong with that request. Please try again.