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

ruby-changes:11573

From: nobu <ko1@a...>
Date: Sun, 19 Apr 2009 13:17:40 +0900 (JST)
Subject: [ruby-changes:11573] Ruby:r23208 (trunk): * gem_prelude.rb (Gem::QuickLoader#push_gem_version_on_load_path):

nobu	2009-04-19 13:17:26 +0900 (Sun, 19 Apr 2009)

  New Revision: 23208

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

  Log:
    * gem_prelude.rb (Gem::QuickLoader#push_gem_version_on_load_path):
      check for requirement if the gem is installed.  a patch from
      Kyosuke MOROHASHI at [ruby-dev:38020].

  Modified files:
    trunk/ChangeLog
    trunk/gem_prelude.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 23207)
+++ ChangeLog	(revision 23208)
@@ -1,3 +1,9 @@
+Sun Apr 19 13:17:25 2009  Nobuyoshi Nakada  <nobu@r...>
+
+	* gem_prelude.rb (Gem::QuickLoader#push_gem_version_on_load_path):
+	  check for requirement if the gem is installed.  a patch from
+	  Kyosuke MOROHASHI at [ruby-dev:38020].
+
 Sun Apr 19 01:39:17 2009  Tanaka Akira  <akr@f...>
 
 	* process.c (proc_seteuid_m): defined to use rb_f_notimplement if not
Index: gem_prelude.rb
===================================================================
--- gem_prelude.rb	(revision 23207)
+++ gem_prelude.rb	(revision 23208)
@@ -245,16 +245,18 @@
           requirement, version = version_requirements[0].split
           requirement.strip!
 
-          if requirement == ">" || requirement == ">="
-            if (GemVersions[gem_name] <=> Gem.calculate_integers_for_gem_version(version)) >= 0
-              return false
+          if loaded_version = GemVersions[gem_name]
+            case requirement
+            when ">", ">="
+              if (loaded_version <=> Gem.calculate_integers_for_gem_version(version)) >= 0
+                return false
+              end
+            when "~>"
+              required_version = Gem.calculate_integers_for_gem_version(version)
+              if (loaded_version[0] == required_version[0])
+                return false
+              end
             end
-          elsif requirement == "~>"
-            loaded_version = GemVersions[gem_name]
-            required_version = Gem.calculate_integers_for_gem_version(version)
-            if loaded_version && (loaded_version[0] == required_version[0])
-              return false
-            end
           end
 
           QuickLoader.load_full_rubygems_library

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

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