[前][次][番号順一覧][スレッド一覧]

ruby-changes:8418

From: nobu <ko1@a...>
Date: Sun, 26 Oct 2008 19:18:56 +0900 (JST)
Subject: [ruby-changes:8418] Ruby:r19949 (trunk): * gem_prelude.rb: disables debug and verbose flags to suppress failure

nobu	2008-10-26 19:18:39 +0900 (Sun, 26 Oct 2008)

  New Revision: 19949

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=19949

  Log:
    * gem_prelude.rb: disables debug and verbose flags to suppress failure
      messages.  interpolation does not occur inside single quotes.

  Modified files:
    trunk/ChangeLog
    trunk/gem_prelude.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 19948)
+++ ChangeLog	(revision 19949)
@@ -1,4 +1,4 @@
-Sun Oct 26 18:42:18 2008  Nobuyoshi Nakada  <nobu@r...>
+Sun Oct 26 19:18:36 2008  Nobuyoshi Nakada  <nobu@r...>
 
 	* thread.c (blocking_region_{begin,end}): declared as inline.
 
@@ -11,6 +11,9 @@
 	* 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.
 
Index: gem_prelude.rb
===================================================================
--- gem_prelude.rb	(revision 19948)
+++ gem_prelude.rb	(revision 19949)
@@ -80,18 +80,24 @@
 
     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 @@
 
         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
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]