Use RbConfig.ruby if it's available

This commit is contained in:
Jack Nagel 2014-06-09 21:36:36 -05:00
parent fdcbc5e4db
commit 83f2ee5aea
2 changed files with 16 additions and 4 deletions

View File

@ -68,8 +68,14 @@ HOMEBREW_LOGS = Pathname.new(ENV['HOMEBREW_LOGS'] || '~/Library/Logs/Homebrew/')
HOMEBREW_TEMP = Pathname.new(ENV.fetch('HOMEBREW_TEMP', '/tmp'))
RUBY_BIN = Pathname.new(RbConfig::CONFIG['bindir'])
RUBY_PATH = RUBY_BIN + RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG['EXEEXT']
if RbConfig.respond_to?(:ruby)
RUBY_PATH = Pathname.new(RbConfig.ruby)
else
RUBY_PATH = Pathname.new(RbConfig::CONFIG["bindir"]).join(
RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"]
)
end
RUBY_BIN = RUBY_PATH.dirname
if RUBY_PLATFORM =~ /darwin/
MACOS_FULL_VERSION = `/usr/bin/sw_vers -productVersion`.chomp

View File

@ -29,8 +29,14 @@ HOMEBREW_VERSION = '0.9-test'
require 'tap_constants'
RUBY_BIN = Pathname.new(RbConfig::CONFIG['bindir'])
RUBY_PATH = RUBY_BIN + RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG['EXEEXT']
if RbConfig.respond_to?(:ruby)
RUBY_PATH = Pathname.new(RbConfig.ruby)
else
RUBY_PATH = Pathname.new(RbConfig::CONFIG["bindir"]).join(
RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"]
)
end
RUBY_BIN = RUBY_PATH.dirname
MACOS_FULL_VERSION = `/usr/bin/sw_vers -productVersion`.chomp
MACOS_VERSION = ENV.fetch('MACOS_VERSION') { MACOS_FULL_VERSION[/10\.\d+/] }