mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Prefer RbConfig.ruby over the 3.times fallback (#8691)
It seems saner to use RbConfig.ruby than using ruby in a random ancestor directory.
This commit is contained in:
parent
7a3a98e2be
commit
6c46ccf226
1 changed files with 14 additions and 15 deletions
|
@ -15,8 +15,10 @@ end
|
|||
module EnvUtil
|
||||
def rubybin
|
||||
if ruby = ENV["RUBY"]
|
||||
return ruby
|
||||
end
|
||||
ruby
|
||||
elsif defined?(RbConfig.ruby)
|
||||
RbConfig.ruby
|
||||
else
|
||||
ruby = "ruby"
|
||||
exeext = RbConfig::CONFIG["EXEEXT"]
|
||||
rubyexe = (ruby + exeext if exeext and !exeext.empty?)
|
||||
|
@ -29,9 +31,6 @@ module EnvUtil
|
|||
end
|
||||
ruby = File.join("..", ruby)
|
||||
end
|
||||
if defined?(RbConfig.ruby)
|
||||
RbConfig.ruby
|
||||
else
|
||||
"ruby"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue