Skip to content

Commit

Permalink
Ignore duplicated warning with native extension
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Oct 13, 2023
1 parent 1e0837b commit beab6b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/bundled_gems.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@ def self.find_gem(path)
EXACT[n] or PREFIXED[n = n[%r[\A[^/]+(?=/)]]] && n
end

# for Bundler environment especially Bundler.setup.
def self.warning?(name)
name = name.tr("/", "-")
_t, path = $:.resolve_feature_path(name)
return unless gem = find_gem(path)
caller = caller_locations(3, 3).find {|c| c&.absolute_path}
return if find_gem(caller&.absolute_path)
name = name.sub(LIBEXT, "") # assume "foo.rb"/"foo.so" belongs to "foo" gem
return if WARNED[name]
WARNED[name] = true
if gem == true
gem = name.sub(LIBEXT, "") # assume "foo.rb"/"foo.so" belongs to "foo" gem
gem = name
elsif gem
return if WARNED[gem]
WARNED[gem] = true
Expand Down

0 comments on commit beab6b8

Please sign in to comment.