We should use uplevel:2 in another case.

Like the following scenario with bootsnap, that frames are same or smaller than frame_to_skip(=3).

---
"/Users/hsbt/.local/share/rbenv/versions/3.3-dev/lib/ruby/3.3.0/bundled_gems.rb:69:in `block (2 levels) in replace_require'"
"/Users/hsbt/.local/share/gem/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'"
"test_warn_bootsnap.rb:11:in `<main>'"
---
This commit is contained in:
Hiroshi SHIBATA 2024-08-08 16:18:06 +09:00
parent 7594a292b1
commit 7e0910a82c
No known key found for this signature in database
GPG Key ID: F9CF13417264FAC2

View File

@ -98,7 +98,7 @@ module Gem::BUNDLED_GEMS
end
end
end
1
require_found ? 1 : 2
end
def self.find_gem(path)