Ticket #18977: gem_prelude_raise_right_error.patch

File gem_prelude_raise_right_error.patch, 1.2 KB (added by jonbrenner@…, 16 years ago)
  • gem_prelude.rb

    diff --git a/gem_prelude.rb b/gem_prelude.rb
    index 553912c..042945c 100644
    a b if defined?(Gem) then 
    245245          requirement, version = version_requirements[0].split
    246246          requirement.strip!
    247247
    248           if requirement == ">" || requirement == ">="
    249             if (GemVersions[gem_name] <=> Gem.calculate_integers_for_gem_version(version)) >= 0
    250               return false
    251             end
    252           elsif requirement == "~>"
    253             loaded_version = GemVersions[gem_name]
    254             required_version = Gem.calculate_integers_for_gem_version(version)
    255             if loaded_version && (loaded_version[0] == required_version[0])
    256               return false
     248          if loaded_version = GemVersions[gem_name]
     249            if requirement == ">" || requirement == ">="
     250              if (GemVersions[gem_name] <=> Gem.calculate_integers_for_gem_version(version)) >= 0
     251                return false
     252              end
     253            elsif requirement == "~>"
     254              required_version = Gem.calculate_integers_for_gem_version(version)
     255              if (loaded_version[0] == required_version[0])
     256                return false
     257              end
    257258            end
    258259          end
    259260