Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* runruby.rb: added --pure (turned on by default) and --debugger

  options.


git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@12052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
commit 34ef55e89c7ac2d4797ffedf5b69b92c9071460e 1 parent 367574d
@nobu nobu authored
Showing with 25 additions and 4 deletions.
  1. +5 −0 ChangeLog
  2. +20 −4 runruby.rb
View
5 ChangeLog
@@ -1,3 +1,8 @@
+Tue Mar 13 03:24:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * runruby.rb: added --pure (turned on by default) and --debugger
+ options.
+
Tue Mar 13 02:50:28 2007 Akinori MUSHA <knu@iDaemons.org>
* lib/cgi.rb (CGI::header): IIS >= 5.0 does not need the nph
View
24 runruby.rb
@@ -1,5 +1,6 @@
#!./miniruby
+pure = true
while arg = ARGV[0]
break ARGV.shift if arg == '--'
/\A--([-\w]+)(?:=(.*))?\z/ =~ arg or break
@@ -12,6 +13,10 @@
archdir = value
when re =~ "extout"
extout = value
+ when re =~ "pure"
+ pure = (value != "no")
+ when re =~ "debugger"
+ debugger = value ? (value.split unless value == "no") : %w"gdb --args"
else
break
end
@@ -25,23 +30,24 @@
$:.unshift(abs_archdir)
require 'rbconfig'
-config = Config::CONFIG
+config = RbConfig::CONFIG
ruby = File.join(archdir, config["RUBY_INSTALL_NAME"]+config['EXEEXT'])
unless File.exist?(ruby)
abort "#{ruby} is not found.\nTry `make' first, then `make test', please.\n"
end
-libs = [abs_archdir, File.expand_path("lib", srcdir)]
+libs = [abs_archdir]
if extout
abs_extout = File.expand_path(extout)
libs << File.expand_path("common", abs_extout) << File.expand_path(RUBY_PLATFORM, abs_extout)
end
+libs << File.expand_path("lib", srcdir)
config["bindir"] = abs_archdir
ENV["RUBY"] = File.expand_path(ruby)
ENV["PATH"] = [abs_archdir, ENV["PATH"]].compact.join(File::PATH_SEPARATOR)
-if e = ENV["RUBYLIB"]
+if !pure and e = ENV["RUBYLIB"]
libs |= e.split(File::PATH_SEPARATOR)
end
ENV["RUBYLIB"] = $:.replace(libs).join(File::PATH_SEPARATOR)
@@ -55,5 +61,15 @@
ENV["LD_PRELOAD"] = [libruby_so, ENV["LD_PRELOAD"]].compact.join(' ')
end
end
+begin
+ open("puretest.rb", IO::EXCL|IO::CREAT|IO::WRONLY) do |f|
+ f.puts('$LOAD_PATH.replace(ENV["RUBYLIB"].split(File::PATH_SEPARATOR))')
+ end
+rescue Errno::EEXIST
+end
-exec ruby, *ARGV
+cmd = [ruby]
+cmd << "-rpuretest.rb" if pure
+cmd.concat(ARGV)
+cmd.unshift(*debugger) if debugger
+exec(*cmd)

0 comments on commit 34ef55e

Please sign in to comment.
Something went wrong with that request. Please try again.