summaryrefslogtreecommitdiff
path: root/lib/rubygems/core_ext
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2019-08-17 12:35:30 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-08-17 15:12:46 +0900
commitd041c6cebbe7fe973789616bef43200213e1a001 (patch)
tree66471a2fa82fb31e16426902d1f680cf31cc089e /lib/rubygems/core_ext
parent260ef51a73c067599826c8ab110c53994c1b6226 (diff)
Added comments for extended require by RubyGems
Diffstat (limited to 'lib/rubygems/core_ext')
-rwxr-xr-xlib/rubygems/core_ext/kernel_require.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/rubygems/core_ext/kernel_require.rb b/lib/rubygems/core_ext/kernel_require.rb
index cc7ec7e..b4aebf8 100755
--- a/lib/rubygems/core_ext/kernel_require.rb
+++ b/lib/rubygems/core_ext/kernel_require.rb
@@ -36,11 +36,13 @@ module Kernel
path = path.to_path if path.respond_to? :to_path
+ # Ensure -I beats a default gem
+ # https://github.com/rubygems/rubygems/pull/1868
resolved_path = begin
rp = nil
$LOAD_PATH[0...Gem.load_path_insert_index].each do |lp|
safe_lp = lp.dup.untaint
- next if File.symlink? safe_lp
+ next if File.symlink? safe_lp # for backword compatibility
Gem.suffixes.each do |s|
full_path = File.expand_path(File.join(safe_lp, "#{path}#{s}"))
if File.file?(full_path)