summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog14
-rw-r--r--benchmark/report.rb4
-rw-r--r--benchmark/runc.rb4
-rw-r--r--lib/webrick/httpservlet/cgihandler.rb4
-rw-r--r--test/ruby/envutil.rb5
-rwxr-xr-xtool/eval.rb4
-rwxr-xr-xtool/mkconfig.rb8
7 files changed, 27 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 397384675f..1b02d441e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+Thu Jan 1 00:00:00 2010 Tanaka Akira <akr@fsij.org>
+
+ * tool/mkconfig.rb: generate RbConfig.ruby in rbconfig.rb.
+
+ * lib/webrick/httpservlet/cgihandler.rb: use RbConfig.ruby.
+
+ * test/ruby/envutil.rb: ditto.
+
+ * benchmark/report.rb: ditto.
+
+ * benchmark/runc.rb: ditto.
+
+ * tool/eval.rb: ditto.
+
Thu Dec 31 18:18:55 2009 NAKAMURA Usaku <usa@ruby-lang.org>
* ext/socket/rubysocket.h: include addrinfo.h only when using our own
diff --git a/benchmark/report.rb b/benchmark/report.rb
index e931966cca..7aa852fc85 100644
--- a/benchmark/report.rb
+++ b/benchmark/report.rb
@@ -24,9 +24,7 @@ def exec_command type, file, w
end
def benchmark cmd
- rubybin = ENV['RUBY'] || File.join(
- RbConfig::CONFIG["bindir"],
- RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"])
+ rubybin = ENV['RUBY'] || RbConfig.ruby
IO.popen(rubybin, 'r+'){|io|
io.write cmd
diff --git a/benchmark/runc.rb b/benchmark/runc.rb
index ec1d36a61b..97c5cef045 100644
--- a/benchmark/runc.rb
+++ b/benchmark/runc.rb
@@ -5,9 +5,7 @@
require 'benchmark'
require 'rbconfig'
-$rubybin = ENV['RUBY'] || File.join(
- RbConfig::CONFIG["bindir"],
- RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"])
+$rubybin = ENV['RUBY'] || RbConfig.ruby
def runfile file
puts file
diff --git a/lib/webrick/httpservlet/cgihandler.rb b/lib/webrick/httpservlet/cgihandler.rb
index ab36b906f1..7ba2d50860 100644
--- a/lib/webrick/httpservlet/cgihandler.rb
+++ b/lib/webrick/httpservlet/cgihandler.rb
@@ -17,9 +17,7 @@ module WEBrick
module HTTPServlet
class CGIHandler < AbstractServlet
- Ruby = File::join(RbConfig::CONFIG['bindir'],
- RbConfig::CONFIG['ruby_install_name'])
- Ruby << RbConfig::CONFIG['EXEEXT']
+ Ruby = RbConfig.ruby
CGIRunner = "\"#{Ruby}\" \"#{WEBrick::Config::LIBDIR}/httpservlet/cgi_runner.rb\""
def initialize(server, name)
diff --git a/test/ruby/envutil.rb b/test/ruby/envutil.rb
index bd01b91b24..e54051d426 100644
--- a/test/ruby/envutil.rb
+++ b/test/ruby/envutil.rb
@@ -22,10 +22,7 @@ module EnvUtil
end
begin
require "rbconfig"
- File.join(
- RbConfig::CONFIG["bindir"],
- RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"]
- )
+ RbConfig.ruby
rescue LoadError
"ruby"
end
diff --git a/tool/eval.rb b/tool/eval.rb
index db6d11cddd..f7299c8b95 100755
--- a/tool/eval.rb
+++ b/tool/eval.rb
@@ -3,9 +3,7 @@ require 'rbconfig'
require 'fileutils'
require 'pp'
-Ruby = ENV['RUBY'] ||
- File.join(RbConfig::CONFIG["bindir"],
- RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"])
+Ruby = ENV['RUBY'] || RbConfig.ruby
#
OPTIONS = %w{
diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb
index ca1f46713a..df3c35fb80 100755
--- a/tool/mkconfig.rb
+++ b/tool/mkconfig.rb
@@ -201,6 +201,14 @@ print <<EOS
CONFIG.each_value do |val|
RbConfig::expand(val)
end
+
+ # returns the absolute pathname of the ruby command.
+ def RbConfig.ruby
+ File.join(
+ RbConfig::CONFIG["bindir"],
+ RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"]
+ )
+ end
end
Config = RbConfig # compatibility for ruby-1.8.4 and older.
CROSS_COMPILING = nil unless defined? CROSS_COMPILING