summaryrefslogtreecommitdiff
path: root/runruby.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-05-22 20:48:34 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-05-22 20:48:34 +0000
commitebb163d918a754e023188b2ac782bd492324955b (patch)
treeeebb4b6e129010bfb0705341b2e406b3ad507038 /runruby.rb
parentf5591c012e253a68d6ae8050a82581288393e5c9 (diff)
* ext/extmk.rb, ext/purelib.rb, lib/mkmf.rb, runruby.rb: clear default
load path to get rid of load pre-installed extensions/libraries. [ruby-core:11017] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'runruby.rb')
-rwxr-xr-xrunruby.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/runruby.rb b/runruby.rb
index b1b8000389..8b0e9c20e5 100755
--- a/runruby.rb
+++ b/runruby.rb
@@ -47,7 +47,9 @@ config["bindir"] = abs_archdir
ENV["RUBY"] = File.expand_path(ruby)
ENV["PATH"] = [abs_archdir, ENV["PATH"]].compact.join(File::PATH_SEPARATOR)
-if !pure and e = ENV["RUBYLIB"]
+if pure
+ libs << File.expand_path("ext", srcdir) << "-"
+elsif e = ENV["RUBYLIB"]
libs |= e.split(File::PATH_SEPARATOR)
end
ENV["RUBYLIB"] = $:.replace(libs).join(File::PATH_SEPARATOR)
@@ -61,15 +63,9 @@ if File.file?(libruby_so)
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
cmd = [ruby]
-cmd << "-rpuretest.rb" if pure
+cmd << "-rpurelib.rb" if pure
cmd.concat(ARGV)
cmd.unshift(*debugger) if debugger
exec(*cmd)