diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-01-12 07:41:40 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-01-12 07:41:40 +0000 |
| commit | e10f47864c5a8979251ebb96130ffecde349354d (patch) | |
| tree | 888a39637314b1c6b85ad78f7cdff2a2cc14cf7c /test/ruby/envutil.rb | |
| parent | 6c8ba69ebee3803ae7a0d3e8f81362079a9952cf (diff) | |
* test/ruby/envutil.rb (EnvUtil#rubybin): fake also rbconfig.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@26299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/envutil.rb')
| -rw-r--r-- | test/ruby/envutil.rb | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/test/ruby/envutil.rb b/test/ruby/envutil.rb index e0d8cf81be..639aee00ca 100644 --- a/test/ruby/envutil.rb +++ b/test/ruby/envutil.rb @@ -15,15 +15,32 @@ module EnvUtil end ruby = File.join("..", ruby) end - begin - require "rbconfig" + if defined?(RbConfig.ruby) File.join( Config::CONFIG["bindir"], Config::CONFIG["ruby_install_name"] + Config::CONFIG["EXEEXT"] - ) - rescue LoadError + ) + else "ruby" end end module_function :rubybin end + +begin + require 'rbconfig' +rescue LoadError +else + module RbConfig + @ruby = EnvUtil.rubybin + class << self + undef ruby if defined?(ruby) + attr_reader :ruby + end + dir = File.dirname(ruby) + name = File.basename(ruby, CONFIG['EXEEXT']) + CONFIG['bindir'] = dir + CONFIG['ruby_install_name'] = name + CONFIG['RUBY_INSTALL_NAME'] = name + end +end |
