mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f3d5d707cc
commit
53054c0ff6
2 changed files with 17 additions and 9 deletions
|
@ -1,3 +1,9 @@
|
|||
Sun Apr 19 13:17:25 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* 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@fsij.org>
|
||||
|
||||
* process.c (proc_seteuid_m): defined to use rb_f_notimplement if not
|
||||
|
|
|
@ -245,15 +245,17 @@ if defined?(Gem) then
|
|||
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
|
||||
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
|
||||
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
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue