ruby-changes:9589
From: yugui <ko1@a...>
Date: Sun, 28 Dec 2008 18:43:05 +0900 (JST)
Subject: [ruby-changes:9589] Ruby:r21130 (ruby_1_9_1): merges r21102 from trunk into ruby_1_9_1.
yugui 2008-12-28 18:42:41 +0900 (Sun, 28 Dec 2008) New Revision: 21130 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=21130 Log: merges r21102 from trunk into ruby_1_9_1. * runruby.rb: refactored to modify ENV as once. Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/runruby.rb Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 21129) +++ ruby_1_9_1/ChangeLog (revision 21130) @@ -1,3 +1,7 @@ +Sun Dec 28 00:43:33 2008 Tanaka Akira <akr@f...> + + * runruby.rb: refactored to modify ENV as once. + Sat Dec 27 22:41:02 2008 Nobuyoshi Nakada <nobu@r...> * test/rdoc/test_rdoc_info_formatting.rb (setup, teadown): uses Index: ruby_1_9_1/runruby.rb =================================================================== --- ruby_1_9_1/runruby.rb (revision 21129) +++ ruby_1_9_1/runruby.rb (revision 21130) @@ -44,28 +44,36 @@ 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) +env = {} + +env["RUBY"] = File.expand_path(ruby) +env["PATH"] = [abs_archdir, ENV["PATH"]].compact.join(File::PATH_SEPARATOR) + 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) +env["RUBYLIB"] = $:.replace(libs).join(File::PATH_SEPARATOR) libruby_so = File.join(abs_archdir, config['LIBRUBY_SO']) if File.file?(libruby_so) if e = config['LIBPATHENV'] and !e.empty? - ENV[e] = [abs_archdir, ENV[e]].compact.join(File::PATH_SEPARATOR) + env[e] = [abs_archdir, ENV[e]].compact.join(File::PATH_SEPARATOR) end if /linux/ =~ RUBY_PLATFORM - ENV["LD_PRELOAD"] = [libruby_so, ENV["LD_PRELOAD"]].compact.join(' ') + env["LD_PRELOAD"] = [libruby_so, ENV["LD_PRELOAD"]].compact.join(' ') end end +ENV.update env + cmd = [ruby] cmd << "-rpurelib.rb" if pure cmd.concat(ARGV) cmd.unshift(*debugger) if debugger + +#require 'shellwords'; puts Shellwords.join(env.map {|k,v| "#{k}=#{v}" } + cmd) + exec(*cmd) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/