[rubygems/rubygems] Make clearing loaded spec cache really private

https://github.com/rubygems/rubygems/commit/19f117652b
This commit is contained in:
David Rodríguez 2021-11-17 18:01:25 +01:00 committed by git
parent d8dde444e9
commit f542ab2e6d

View File

@ -752,11 +752,12 @@ class Gem::Specification < Gem::BasicSpecification
@@all ||= Gem.loaded_specs.values | stubs.map(&:to_spec) @@all ||= Gem.loaded_specs.values | stubs.map(&:to_spec)
end end
def self._clear_load_cache # :nodoc: def self.clear_load_cache # :nodoc:
LOAD_CACHE_MUTEX.synchronize do LOAD_CACHE_MUTEX.synchronize do
LOAD_CACHE.clear LOAD_CACHE.clear
end end
end end
private_class_method :clear_load_cache
def self.each_gemspec(dirs) # :nodoc: def self.each_gemspec(dirs) # :nodoc:
dirs.each do |dir| dirs.each do |dir|
@ -1227,7 +1228,7 @@ class Gem::Specification < Gem::BasicSpecification
@@stubs_by_name = {} @@stubs_by_name = {}
@@spec_with_requirable_file = {} @@spec_with_requirable_file = {}
@@active_stub_with_requirable_file = {} @@active_stub_with_requirable_file = {}
_clear_load_cache clear_load_cache
unresolved = unresolved_deps unresolved = unresolved_deps
unless unresolved.empty? unless unresolved.empty?
w = "W" + "ARN" w = "W" + "ARN"