summaryrefslogtreecommitdiff
path: root/lib/rubygems/core_ext
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2020-05-19 14:08:19 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-06-05 07:32:42 +0900
commit5aa5aad48aa3effce60de3559d9bd107bfc9a91d (patch)
tree396d3dc4d6a78dccbae9f3fc7af8427ea8231f55 /lib/rubygems/core_ext
parenta18e81d797135de6e143a600e4f4d2b00ab23bf9 (diff)
[rubygems/rubygems] Refactor `Gem.load_path_insert_index`
https://github.com/rubygems/rubygems/commit/ae95885dff
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3184
Diffstat (limited to 'lib/rubygems/core_ext')
-rw-r--r--lib/rubygems/core_ext/kernel_require.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/rubygems/core_ext/kernel_require.rb b/lib/rubygems/core_ext/kernel_require.rb
index 7625ce1..decf482 100644
--- a/lib/rubygems/core_ext/kernel_require.rb
+++ b/lib/rubygems/core_ext/kernel_require.rb
@@ -44,10 +44,7 @@ module Kernel
resolved_path = begin
rp = nil
Gem.suffixes.each do |s|
- load_path_insert_index = Gem.load_path_insert_index
- break unless load_path_insert_index
-
- $LOAD_PATH[0...load_path_insert_index - Gem.activated_gem_paths].each do |lp|
+ $LOAD_PATH[0...Gem.load_path_insert_index - Gem.activated_gem_paths].each do |lp|
safe_lp = lp.dup.tap(&Gem::UNTAINT)
begin
if File.symlink? safe_lp # for backward compatibility