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

ruby-changes:9399

From: drbrain <ko1@a...>
Date: Tue, 23 Dec 2008 15:48:00 +0900 (JST)
Subject: [ruby-changes:9399] Ruby:r20937 (trunk): Match full RubyGems behavior when a gem can't be found

drbrain	2008-12-23 15:47:44 +0900 (Tue, 23 Dec 2008)

  New Revision: 20937

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

  Log:
    Match full RubyGems behavior when a gem can't be found

  Modified files:
    trunk/ChangeLog
    trunk/gem_prelude.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 20936)
+++ ChangeLog	(revision 20937)
@@ -1,3 +1,7 @@
+Tue Dec 23 15:46:47 2008  Eric Hodel  <drbrain@s...>
+	* gem_prelude.rb:  Match full RubyGems behavior when a gem can't be
+	  found.
+
 Tue Dec 23 15:36:58 2008  Yuki Sonoda (Yugui)  <yugui@y...>
 
 	* tool/file2lastrev.rb: detects vcs directory properly on building
Index: gem_prelude.rb
===================================================================
--- gem_prelude.rb	(revision 20936)
+++ gem_prelude.rb	(revision 20937)
@@ -18,6 +18,9 @@
 
   module Gem
 
+    class LoadError < ::LoadError
+    end
+
     ConfigMap = {
       :sitedir => RbConfig::CONFIG["sitedir"],
       :ruby_version => RbConfig::CONFIG["ruby_version"],
@@ -183,13 +186,13 @@
 
       begin
         require 'rubygems/defaults/operating_system'
-      rescue LoadError
+      rescue ::LoadError
       end
 
       if defined?(RUBY_ENGINE) then
         begin
           require "rubygems/defaults/#{RUBY_ENGINE}"
-        rescue LoadError
+        rescue ::LoadError
         end
       end
     ensure
@@ -228,7 +231,7 @@
       def push_gem_version_on_load_path(gem_name, *version_requirements)
         if version_requirements.empty?
           unless GemPaths.has_key?(gem_name)
-            raise LoadError.new("Could not find RubyGem #{gem_name} (>= 0)\n")
+            raise Gem::LoadError.new("Could not find RubyGem #{gem_name} (>= 0)\n")
           end
 
           # highest version gems already active

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

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