summaryrefslogtreecommitdiff
path: root/lib/rubygems/core_ext/kernel_gem.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-07 00:53:01 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-07 00:53:01 +0000
commit97f80207d0f0d13f28a419d8c92e96bb9064096a (patch)
treede416fff9bbc978434cb4c1185099151df2ac27c /lib/rubygems/core_ext/kernel_gem.rb
parenta0b80a44101708b5d66cdd87f16c98277954a77c (diff)
* lib/rubygems: Update to RubyGems 2.4.5.
* test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/core_ext/kernel_gem.rb')
-rw-r--r--lib/rubygems/core_ext/kernel_gem.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/rubygems/core_ext/kernel_gem.rb b/lib/rubygems/core_ext/kernel_gem.rb
index edce4ee..61e77fe 100644
--- a/lib/rubygems/core_ext/kernel_gem.rb
+++ b/lib/rubygems/core_ext/kernel_gem.rb
@@ -55,7 +55,14 @@ module Kernel
gem_name = gem_name.name
end
- spec = Gem::Dependency.new(gem_name, *requirements).to_spec
+ dep = Gem::Dependency.new(gem_name, *requirements)
+
+ loaded = Gem.loaded_specs[gem_name]
+
+ return false if loaded && dep.matches_spec?(loaded)
+
+ spec = dep.to_spec
+
Gem::LOADED_SPECS_MUTEX.synchronize {
spec.activate
} if spec