1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test/ruby/envutil.rb
akr 99ee69b9f2 * test/ruby/envutil.rb (EnvUtil.rubybin): search "ruby" instead of
"miniruby".  [ruby-dev:28140]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-12-29 08:05:26 +00:00

24 lines
495 B
Ruby

module EnvUtil
def rubybin
if ruby = ENV["RUBY"]
return ruby
end
ruby = "ruby"
3.times do
if File.exist? ruby or File.exist? ruby+".exe"
return File.expand_path(ruby)
end
ruby = File.join("..", ruby)
end
begin
require "rbconfig"
File.join(
Config::CONFIG["bindir"],
Config::CONFIG["ruby_install_name"] + Config::CONFIG["EXEEXT"]
)
rescue LoadError
"ruby"
end
end
module_function :rubybin
end