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 00:57:53 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-28 00:57:53 +0000
commit69934aeb8d7948c4ca590b7092504c41d8bce6ac (patch)
tree7ea2cdc73f64c5fd001a4e626613ba435a425c0c /lib/rubygems/core_ext/kernel_require.rb
parentcc00f5bf36a2053e561d968a7e667ff31a9d72d7 (diff)
rubygems 2.6.7
* lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: Update rubygems to 2.6.7. Release note of 2.6.7: https://github.com/rubygems/rubygems/commit/60f35bd1d2359fc30301d2d4cd72bc6833e8d12a git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56277 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, 4 insertions, 8 deletions
diff --git a/lib/rubygems/core_ext/kernel_require.rb b/lib/rubygems/core_ext/kernel_require.rb
index aa56ab5ec4..d23a6fe90a 100755
--- a/lib/rubygems/core_ext/kernel_require.rb
+++ b/lib/rubygems/core_ext/kernel_require.rb
@@ -41,8 +41,7 @@ module Kernel
path = path.to_path if path.respond_to? :to_path
- spec = Gem.find_unresolved_default_spec(path)
- if spec
+ if spec = Gem.find_unresolved_default_spec(path)
Gem.remove_unresolved_default_spec(spec)
gem(spec.name)
end
@@ -61,12 +60,10 @@ module Kernel
#--
# TODO request access to the C implementation of this to speed up RubyGems
- spec = Gem::Specification.find_active_stub_by_path path
-
- begin
+ if Gem::Specification.find_active_stub_by_path(path)
RUBYGEMS_ACTIVATION_MONITOR.exit
return gem_original_require(path)
- end if spec
+ end
# Attempt to find +path+ in any unresolved gems...
@@ -104,7 +101,7 @@ module Kernel
# Ok, now find a gem that has no conflicts, starting
# at the highest version.
- valid = found_specs.reject { |s| s.has_conflicts? }.first
+ valid = found_specs.find { |s| !s.has_conflicts? }
unless valid then
le = Gem::LoadError.new "unable to find a version of '#{names.first}' to activate"
@@ -138,4 +135,3 @@ module Kernel
private :require
end
-