[rubygems/rubygems] Prefer RbConfig::CONFIG['EXEEXT'] over hardcorded '.exe'

https://github.com/rubygems/rubygems/commit/bc84b2d262
This commit is contained in:
Nobuyoshi Nakada 2020-07-27 09:59:11 +09:00 committed by git
parent b8e542b463
commit e1f42844a0
2 changed files with 3 additions and 3 deletions

View File

@ -550,7 +550,7 @@ EOF
def git_present?
return @git_present if defined?(@git_present)
@git_present = Bundler.which("git") || Bundler.which("git.exe")
@git_present = Bundler.which("git#{RbConfig::CONFIG["EXEEXT"]}")
end
def feature_flag

View File

@ -337,7 +337,7 @@ class Gem::TestCase < Test::Unit::TestCase
ruby
end
@git = ENV["GIT"] || (win_platform? ? "git.exe" : "git")
@git = ENV["GIT"] || "git#{RbConfig::CONFIG['EXEEXT']}"
Gem.ensure_gem_subdirectories @gemhome
Gem.ensure_default_gem_subdirectories @gemhome
@ -1263,7 +1263,7 @@ Also, a list:
ruby = ENV["RUBY"]
return ruby if ruby
ruby = "ruby"
rubyexe = "#{ruby}.exe"
rubyexe = "#{ruby}#{RbConfig::CONFIG['EXEEXT']}"
3.times do
if File.exist?(ruby) && File.executable?(ruby) && !File.directory?(ruby)