1
0
Fork 0
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:
nobu 2009-04-19 04:17:26 +00:00
parent f3d5d707cc
commit 53054c0ff6
2 changed files with 17 additions and 9 deletions

View file

@ -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

View file

@ -245,17 +245,19 @@ 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
if loaded_version = GemVersions[gem_name]
case requirement
when ">", ">="
if (loaded_version <=> Gem.calculate_integers_for_gem_version(version)) >= 0
return false
end
elsif requirement == "~>"
loaded_version = GemVersions[gem_name]
when "~>"
required_version = Gem.calculate_integers_for_gem_version(version)
if loaded_version && (loaded_version[0] == required_version[0])
if (loaded_version[0] == required_version[0])
return false
end
end
end
QuickLoader.load_full_rubygems_library
gem(gem_name, *version_requirements)