1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

envutil.rb: use EXEEXT

* test/ruby/envutil.rb (rubybin): use EXEEXT configured value
  instead of the hard coded suffix.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-12-23 06:52:35 +00:00
parent 1f861a6ea8
commit 3a18a62d44

View file

@ -9,12 +9,13 @@ module EnvUtil
return ruby
end
ruby = "ruby"
rubyexe = ruby+".exe"
exeext = RbConfig::CONFIG["EXEEXT"]
rubyexe = (ruby + exeext if exeext and !exeext.empty?)
3.times do
if File.exist? ruby and File.executable? ruby and !File.directory? ruby
return File.expand_path(ruby)
end
if File.exist? rubyexe and File.executable? rubyexe
if rubyexe and File.exist? rubyexe and File.executable? rubyexe
return File.expand_path(rubyexe)
end
ruby = File.join("..", ruby)