From 5fedf1c3ac4d92f0877759b16aec932541e85075 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 21 Aug 2024 14:24:17 +0900 Subject: [PATCH] Show correct script name with sub-feature case --- lib/bundled_gems.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/bundled_gems.rb b/lib/bundled_gems.rb index b1cc51c60c..7ab518973f 100644 --- a/lib/bundled_gems.rb +++ b/lib/bundled_gems.rb @@ -79,10 +79,12 @@ module Gem::BUNDLED_GEMS end def self.uplevel + frame_count = 0 frames_to_skip = 3 uplevel = 0 require_found = false Thread.each_caller_location do |cl| + frame_count += 1 if frames_to_skip >= 1 frames_to_skip -= 1 next @@ -98,7 +100,7 @@ module Gem::BUNDLED_GEMS end end end - require_found ? 1 : 2 + require_found ? 1 : frame_count - 1 end def self.find_gem(path)