ruby コマンドのパス名を返す RbConfig.rubybin というメソッド
を用意するのはどうでしょうか。

現在 ruby コマンドのパス名を得るのには、

    File.join(
      RbConfig::CONFIG["bindir"],
      RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"]
    )

と記述する必要があります。

これはとても覚えていられないので、(そして EXEEXT はいかにも
忘れそうなので) ひとつのメソッドで提供しておくのがいいんじゃ
ないでしょうか。

なお、これが使われるケースは ruby の配布の中で少なくとも

  lib/webrick/httpservlet/cgihandler.rb
  benchmark/report.rb
  benchmark/runc.rb
  test/ruby/envutil.rb
  tool/eval.rb

があります。

% svn diff --diff-cmd diff -x '-u -p'
Index: tool/mkconfig.rb
===================================================================
--- tool/mkconfig.rb	(revision 25882)
+++ tool/mkconfig.rb	(working copy)
@@ -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.rubybin
+    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: lib/webrick/httpservlet/cgihandler.rb
===================================================================
--- lib/webrick/httpservlet/cgihandler.rb	(revision 25882)
+++ lib/webrick/httpservlet/cgihandler.rb	(working copy)
@@ -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.rubybin
       CGIRunner = "\"#{Ruby}\" \"#{WEBrick::Config::LIBDIR}/httpservlet/cgi_runner.rb\""
 
       def initialize(server, name)
Index: benchmark/report.rb
===================================================================
--- benchmark/report.rb	(revision 25882)
+++ benchmark/report.rb	(working copy)
@@ -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.rubybin
     
   IO.popen(rubybin, 'r+'){|io|
     io.write cmd
Index: benchmark/runc.rb
===================================================================
--- benchmark/runc.rb	(revision 25882)
+++ benchmark/runc.rb	(working copy)
@@ -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.rubybin
 
 def runfile file
   puts file
Index: tool/eval.rb
===================================================================
--- tool/eval.rb	(revision 25882)
+++ tool/eval.rb	(working copy)
@@ -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.rubybin
 #
 
 OPTIONS = %w{
Index: test/ruby/envutil.rb
===================================================================
--- test/ruby/envutil.rb	(revision 25882)
+++ test/ruby/envutil.rb	(working copy)
@@ -22,10 +22,7 @@ module EnvUtil
     end
     begin
       require "rbconfig"
-      File.join(
-        RbConfig::CONFIG["bindir"],
-	RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"]
-      )
+      RbConfig.rubybin
     rescue LoadError
       "ruby"
     end
-- 
[田中 哲][たなか あきら][Tanaka Akira]