summaryrefslogtreecommitdiff
path: root/lib/rubygems/core_ext/kernel_require.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-28 01:16:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-28 01:16:43 +0000
commitb6139464f544ec511f741f5bbae2fb13adc51c21 (patch)
tree00e91ff57caed712ae08e8b657e8e0a52a030d7c /lib/rubygems/core_ext/kernel_require.rb
parent69934aeb8d7948c4ca590b7092504c41d8bce6ac (diff)
rubygems 2.6.7
* lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: Update rubygems to 2.6.7, not the master, with r56225. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/core_ext/kernel_require.rb')
-rwxr-xr-xlib/rubygems/core_ext/kernel_require.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/rubygems/core_ext/kernel_require.rb b/lib/rubygems/core_ext/kernel_require.rb
index d23a6fe90a..aa56ab5ec4 100755
--- a/lib/rubygems/core_ext/kernel_require.rb
+++ b/lib/rubygems/core_ext/kernel_require.rb
@@ -41,7 +41,8 @@ module Kernel
path = path.to_path if path.respond_to? :to_path
- if spec = Gem.find_unresolved_default_spec(path)
+ spec = Gem.find_unresolved_default_spec(path)
+ if spec
Gem.remove_unresolved_default_spec(spec)
gem(spec.name)
end
@@ -60,10 +61,12 @@ module Kernel
#--
# TODO request access to the C implementation of this to speed up RubyGems
- if Gem::Specification.find_active_stub_by_path(path)
+ spec = Gem::Specification.find_active_stub_by_path path
+
+ begin
RUBYGEMS_ACTIVATION_MONITOR.exit
return gem_original_require(path)
- end
+ end if spec
# Attempt to find +path+ in any unresolved gems...
@@ -101,7 +104,7 @@ module Kernel
# Ok, now find a gem that has no conflicts, starting
# at the highest version.
- valid = found_specs.find { |s| !s.has_conflicts? }
+ valid = found_specs.reject { |s| s.has_conflicts? }.first
unless valid then
le = Gem::LoadError.new "unable to find a version of '#{names.first}' to activate"
@@ -135,3 +138,4 @@ module Kernel
private :require
end
+