Skip to content

Commit

Permalink
Fix gem detection for names with dash
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez authored and hsbt committed Dec 15, 2023
1 parent 6408775 commit 8e37cd8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/bundled_gems.rb
Expand Up @@ -90,13 +90,12 @@ def self.find_gem(path)

def self.warning?(name, specs: nil)
feature = File.path(name) # name can be a feature name or a file path with String or Pathname
return if specs.to_a.map(&:name).include?(feature.sub(LIBEXT, ""))
name = feature.tr("/", "-").sub(LIBEXT, "")
return if specs.to_a.map(&:name).include?(name)
_t, path = $:.resolve_feature_path(feature)
name = feature.tr("/", "-")
if 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
elsif SINCE[name]
gem = true
else
Expand Down

0 comments on commit 8e37cd8

Please sign in to comment.