From 945faf92e69d173ccea393caefaf8c222a251bb8 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 26 Oct 2008 10:18:39 +0000 Subject: [PATCH] * gem_prelude.rb: disables debug and verbose flags to suppress failure messages. interpolation does not occur inside single quotes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 ++++- gem_prelude.rb | 30 ++++++++++++++++++------------ 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index ef5810910a4c82..a10c46179e0380 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -Sun Oct 26 18:42:18 2008 Nobuyoshi Nakada +Sun Oct 26 19:18:36 2008 Nobuyoshi Nakada * thread.c (blocking_region_{begin,end}): declared as inline. @@ -11,6 +11,9 @@ Sun Oct 26 18:42:18 2008 Nobuyoshi Nakada * ext/io/wait/{extconf.rb,wait.c}: needs sys/ioctl.h for fcntl on cygwin. + * gem_prelude.rb: disables debug and verbose flags to suppress failure + messages. interpolation does not occur inside single quotes. + * test/ruby/envutil.rb (assert_in_out_err): disables builtin rubygems to get rid of the interference. diff --git a/gem_prelude.rb b/gem_prelude.rb index b483a65b08b324..422110224bfe9b 100644 --- a/gem_prelude.rb +++ b/gem_prelude.rb @@ -80,18 +80,24 @@ def self.ensure_gem_subdirectories(path) GEM_PRELUDE_METHODS = Gem.methods(false) - require 'rubygems/defaults' - begin - require 'rubygems/defaults/operating_system' - rescue LoadError - end + verbose, debug = $VERBOSE, $DEBUG + $VERBOSE = $DEBUG = nil + require 'rubygems/defaults' - if defined?(RUBY_ENGINE) then begin - require 'rubygems/defaults/#{RUBY_ENGINE}' + require 'rubygems/defaults/operating_system' rescue LoadError end + + if defined?(RUBY_ENGINE) then + begin + require "rubygems/defaults/#{RUBY_ENGINE}" + rescue LoadError + end + end + ensure + $VERBOSE, $DEBUG = verbose, debug end module QuickLoader @@ -183,12 +189,12 @@ def push_all_highest_version_gems_on_load_path require_paths = [] - GemPaths.values.each do |path| - if File.exist?(File.join(path, ".require_paths")) - require_paths.concat(File.read(File.join(path, ".require_paths")).split.map {|require_path| File.join(path, require_path)}) + GemPaths.each_value do |path| + if File.exist?(file = File.join(path, ".require_paths")) + require_paths.concat(File.read(file).split.map {|require_path| File.join(path, require_path)}) else - require_paths << File.join(path, "bin") if File.exist?(File.join(path, "bin")) - require_paths << File.join(path, "lib") if File.exist?(File.join(path, "lib")) + require_paths << file if File.exist?(file = File.join(path, "bin")) + require_paths << file if File.exist?(file = File.join(path, "lib")) end end