[rubygems/rubygems] Refactor Gem.load_path_insert_index

ae95885dff
This commit is contained in:
David Rodríguez 2020-05-19 14:08:19 +02:00 committed by Hiroshi SHIBATA
parent a18e81d797
commit 5aa5aad48a
Notes: git 2020-06-05 07:33:42 +09:00
2 changed files with 4 additions and 14 deletions

View file

@ -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