Skip to content

Commit

Permalink
We need only one line for detecting caller gem name
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Dec 13, 2023
1 parent e282d7b commit a7ad9f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/bundled_gems.rb
Expand Up @@ -124,7 +124,7 @@ def self.build_message(gem)
# We detect the gem name from caller_locations. We need to skip 2 frames like:
# lib/ruby/3.3.0+0/bundled_gems.rb:90:in `warning?'",
# lib/ruby/3.3.0+0/bundler/rubygems_integration.rb:247:in `block (2 levels) in replace_require'",
location = caller_locations(3,3)[0]&.path
location = caller_locations(3,1)[0]&.path
if File.file?(location) && !location.start_with?(Gem::BUNDLED_GEMS::LIBDIR)
caller_gem = nil
Gem.path.each do |path|
Expand Down

0 comments on commit a7ad9f3

Please sign in to comment.