diff options
author | Hiroshi SHIBATA <[email protected]> | 2020-02-06 22:07:39 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2020-02-06 22:07:39 +0900 |
commit | 8c67080381166f97a1153f092f40df699d020a53 (patch) | |
tree | 1d3cbd3237dda2d3cd29527c630bb40ddc522f6a /lib/rubygems | |
parent | bd0a02d1433b6d9a9dcde38eb9fb2dbc3b1071e9 (diff) |
Revert "[rubygems/rubygems] Fix require issue with file extension priority"
This reverts commit d767da428c28b7b9fec56b383bb32f6f76c6ad26.
It fails with spec/ruby/core/kernel/require_spec.rb:5
Diffstat (limited to 'lib/rubygems')
-rw-r--r-- | lib/rubygems/core_ext/kernel_require.rb | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/lib/rubygems/core_ext/kernel_require.rb b/lib/rubygems/core_ext/kernel_require.rb index 369f2c743e..60f4d18712 100644 --- a/lib/rubygems/core_ext/kernel_require.rb +++ b/lib/rubygems/core_ext/kernel_require.rb @@ -43,18 +43,18 @@ module Kernel # https://github.com/rubygems/rubygems/pull/1868 resolved_path = begin rp = nil - Gem.suffixes.each do |s| - $LOAD_PATH[0...Gem.load_path_insert_index || -1].each do |lp| - safe_lp = lp.dup.tap(&Gem::UNTAINT) - begin - if File.symlink? safe_lp # for backward compatibility - next - end - rescue SecurityError - RUBYGEMS_ACTIVATION_MONITOR.exit - raise + $LOAD_PATH[0...Gem.load_path_insert_index || -1].each do |lp| + safe_lp = lp.dup.tap(&Gem::UNTAINT) + begin + if File.symlink? safe_lp # for backward compatibility + next end + rescue SecurityError + RUBYGEMS_ACTIVATION_MONITOR.exit + raise + end + Gem.suffixes.each do |s| full_path = File.expand_path(File.join(safe_lp, "#{path}#{s}")) if File.file?(full_path) rp = full_path @@ -67,8 +67,12 @@ module Kernel end if resolved_path - RUBYGEMS_ACTIVATION_MONITOR.exit - return gem_original_require(resolved_path) + begin + RUBYGEMS_ACTIVATION_MONITOR.exit + return gem_original_require(resolved_path) + rescue LoadError + RUBYGEMS_ACTIVATION_MONITOR.enter + end end if spec = Gem.find_unresolved_default_spec(path) |