ruby-changes:14387
From: akr <ko1@a...>
Date: Fri, 1 Jan 2010 00:00:27 +0900 (JST)
Subject: [ruby-changes:14387] Ruby:r26216 (trunk): * tool/mkconfig.rb: generate RbConfig.ruby in rbconfig.rb.
akr 2010-01-01 00:00:04 +0900 (Fri, 01 Jan 2010) New Revision: 26216 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26216 Log: * 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. Modified files: trunk/ChangeLog trunk/benchmark/report.rb trunk/benchmark/runc.rb trunk/lib/webrick/httpservlet/cgihandler.rb trunk/test/ruby/envutil.rb trunk/tool/eval.rb trunk/tool/mkconfig.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 26215) +++ ChangeLog (revision 26216) @@ -1,3 +1,17 @@ +Thu Jan 1 00:00:00 2010 Tanaka Akira <akr@f...> + + * 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@r...> * ext/socket/rubysocket.h: include addrinfo.h only when using our own Index: lib/webrick/httpservlet/cgihandler.rb =================================================================== --- lib/webrick/httpservlet/cgihandler.rb (revision 26215) +++ lib/webrick/httpservlet/cgihandler.rb (revision 26216) @@ -17,9 +17,7 @@ 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) Index: benchmark/report.rb =================================================================== --- benchmark/report.rb (revision 26215) +++ benchmark/report.rb (revision 26216) @@ -24,9 +24,7 @@ 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 Index: benchmark/runc.rb =================================================================== --- benchmark/runc.rb (revision 26215) +++ benchmark/runc.rb (revision 26216) @@ -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 Index: tool/eval.rb =================================================================== --- tool/eval.rb (revision 26215) +++ tool/eval.rb (revision 26216) @@ -3,9 +3,7 @@ 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{ Index: tool/mkconfig.rb =================================================================== --- tool/mkconfig.rb (revision 26215) +++ tool/mkconfig.rb (revision 26216) @@ -201,6 +201,14 @@ 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 Index: test/ruby/envutil.rb =================================================================== --- test/ruby/envutil.rb (revision 26215) +++ test/ruby/envutil.rb (revision 26216) @@ -22,10 +22,7 @@ end begin require "rbconfig" - File.join( - RbConfig::CONFIG["bindir"], - RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"] - ) + RbConfig.ruby rescue LoadError "ruby" end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/