diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2021-11-04 13:23:35 +0100 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2021-11-18 04:37:27 +0900 |
commit | a5cd4a056896cbc47c59617305b1ee8e1b5b7911 (patch) | |
tree | 588ded80041701b69dc2ea5ea9ded03cf1119f72 /lib/rubygems/specification.rb | |
parent | f542ab2e6de7e41fbdd3a14b21ac21afa37cb73d (diff) |
[rubygems/rubygems] Extract a helper method to reset specs
https://github.com/rubygems/rubygems/commit/662de0c990
Diffstat (limited to 'lib/rubygems/specification.rb')
-rw-r--r-- | lib/rubygems/specification.rb | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb index 304d9116fc..e1c1a60b1f 100644 --- a/lib/rubygems/specification.rb +++ b/lib/rubygems/specification.rb @@ -182,14 +182,19 @@ class Gem::Specification < Gem::BasicSpecification @@default_value[k].nil? end - @@all = nil - @@stubs = nil - @@stubs_by_name = {} + def self.clear_specs # :nodoc: + @@all = nil + @@stubs = nil + @@stubs_by_name = {} + @@spec_with_requirable_file = {} + @@active_stub_with_requirable_file = {} + end + private_class_method :clear_specs + + clear_specs # Sentinel object to represent "not found" stubs NOT_FOUND = Struct.new(:to_spec, :this).new # :nodoc: - @@spec_with_requirable_file = {} - @@active_stub_with_requirable_file = {} # Tracking removed method calls to warn users during build time. REMOVED_METHODS = [:rubyforge_project=].freeze # :nodoc: @@ -1223,11 +1228,7 @@ class Gem::Specification < Gem::BasicSpecification def self.reset @@dirs = nil Gem.pre_reset_hooks.each {|hook| hook.call } - @@all = nil - @@stubs = nil - @@stubs_by_name = {} - @@spec_with_requirable_file = {} - @@active_stub_with_requirable_file = {} + clear_specs clear_load_cache unresolved = unresolved_deps unless unresolved.empty? |