diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-08-17 12:35:30 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-08-17 15:12:46 +0900 |
commit | d041c6cebbe7fe973789616bef43200213e1a001 (patch) | |
tree | 66471a2fa82fb31e16426902d1f680cf31cc089e /lib/rubygems | |
parent | 260ef51a73c067599826c8ab110c53994c1b6226 (diff) | |
download | ruby-d041c6cebbe7fe973789616bef43200213e1a001.tar.gz |
Added comments for extended require by RubyGems
Diffstat (limited to 'lib/rubygems')
-rwxr-xr-x | lib/rubygems/core_ext/kernel_require.rb | 4 |
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 cc7ec7ee71..b4aebf878c 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) |