diff options
author | David RodrÃguez <[email protected]> | 2023-12-14 16:02:00 +0100 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2023-12-15 14:04:36 +0800 |
commit | 8e37cd8a8bd2263c66243a35f25b5e741635c893 (patch) | |
tree | db89f6b62be7f8d04d31d54777884aa9d245b642 /lib | |
parent | 6408775b08b3f36d8fee4e694760caffb852ee8a (diff) |
Fix gem detection for names with dash
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundled_gems.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/bundled_gems.rb b/lib/bundled_gems.rb index 3d7243e7a3..fe88cb3baf 100644 --- a/lib/bundled_gems.rb +++ b/lib/bundled_gems.rb @@ -90,13 +90,12 @@ module Gem::BUNDLED_GEMS 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 |