mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
6c8ba69ebe
commit
e10f47864c
2 changed files with 22 additions and 5 deletions
|
@ -15,15 +15,32 @@ module EnvUtil
|
||||||
end
|
end
|
||||||
ruby = File.join("..", ruby)
|
ruby = File.join("..", ruby)
|
||||||
end
|
end
|
||||||
begin
|
if defined?(RbConfig.ruby)
|
||||||
require "rbconfig"
|
|
||||||
File.join(
|
File.join(
|
||||||
Config::CONFIG["bindir"],
|
Config::CONFIG["bindir"],
|
||||||
Config::CONFIG["ruby_install_name"] + Config::CONFIG["EXEEXT"]
|
Config::CONFIG["ruby_install_name"] + Config::CONFIG["EXEEXT"]
|
||||||
)
|
)
|
||||||
rescue LoadError
|
else
|
||||||
"ruby"
|
"ruby"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
module_function :rubybin
|
module_function :rubybin
|
||||||
end
|
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
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require "test/unit"
|
require "test/unit"
|
||||||
|
require File.join(File.dirname(__FILE__), "utils.rb")
|
||||||
require "webrick"
|
require "webrick"
|
||||||
require "stringio"
|
require "stringio"
|
||||||
require File.join(File.dirname(__FILE__), "utils.rb")
|
|
||||||
|
|
||||||
class WEBrick::TestFileHandler < Test::Unit::TestCase
|
class WEBrick::TestFileHandler < Test::Unit::TestCase
|
||||||
def default_file_handler(filename)
|
def default_file_handler(filename)
|
||||||
|
|
Loading…
Add table
Reference in a new issue