[Bug #19852] Use gem name without suffix
This commit is contained in:
parent
40efbc7e40
commit
7d32011399
Notes:
git
2023-08-25 17:47:23 +00:00
@ -51,7 +51,9 @@ module Gem::BUNDLED_GEMS
|
|||||||
conf = ::RbConfig::CONFIG
|
conf = ::RbConfig::CONFIG
|
||||||
LIBDIR = (conf["rubylibdir"] + "/").freeze
|
LIBDIR = (conf["rubylibdir"] + "/").freeze
|
||||||
ARCHDIR = (conf["rubyarchdir"] + "/").freeze
|
ARCHDIR = (conf["rubyarchdir"] + "/").freeze
|
||||||
DLEXT = /\.#{Regexp.union([conf["DLEXT"], "so"].uniq)}\z/
|
dlext = [conf["DLEXT"], "so"].uniq
|
||||||
|
DLEXT = /\.#{Regexp.union(dlext)}\z/
|
||||||
|
LIBEXT = /\.#{Regexp.union("rb", *dlext)}\z/
|
||||||
|
|
||||||
def self.find_gem(path)
|
def self.find_gem(path)
|
||||||
if !path
|
if !path
|
||||||
@ -69,12 +71,12 @@ module Gem::BUNDLED_GEMS
|
|||||||
def self.warning?(name)
|
def self.warning?(name)
|
||||||
_t, path = $:.resolve_feature_path(name)
|
_t, path = $:.resolve_feature_path(name)
|
||||||
return unless gem = find_gem(path)
|
return unless gem = find_gem(path)
|
||||||
caller, = caller_locations(3, 1)
|
caller = caller_locations(3, 3).find {|c| c&.absolute_path}
|
||||||
return if find_gem(caller&.absolute_path)
|
return if find_gem(caller&.absolute_path)
|
||||||
return if WARNED[name]
|
return if WARNED[name]
|
||||||
WARNED[name] = true
|
WARNED[name] = true
|
||||||
if gem == true
|
if gem == true
|
||||||
gem = name
|
gem = name.sub(LIBEXT, "") # assume "foo.rb"/"foo.so" belongs to "foo" gem
|
||||||
elsif gem
|
elsif gem
|
||||||
return if WARNED[gem]
|
return if WARNED[gem]
|
||||||
WARNED[gem] = true
|
WARNED[gem] = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user