[rubygems/rubygems] Extract a helper method to reset specs
https://github.com/rubygems/rubygems/commit/662de0c990
This commit is contained in:
parent
f542ab2e6d
commit
a5cd4a0568
@ -182,14 +182,19 @@ class Gem::Specification < Gem::BasicSpecification
|
|||||||
@@default_value[k].nil?
|
@@default_value[k].nil?
|
||||||
end
|
end
|
||||||
|
|
||||||
@@all = nil
|
def self.clear_specs # :nodoc:
|
||||||
@@stubs = nil
|
@@all = nil
|
||||||
@@stubs_by_name = {}
|
@@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
|
# Sentinel object to represent "not found" stubs
|
||||||
NOT_FOUND = Struct.new(:to_spec, :this).new # :nodoc:
|
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.
|
# Tracking removed method calls to warn users during build time.
|
||||||
REMOVED_METHODS = [:rubyforge_project=].freeze # :nodoc:
|
REMOVED_METHODS = [:rubyforge_project=].freeze # :nodoc:
|
||||||
@ -1223,11 +1228,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|||||||
def self.reset
|
def self.reset
|
||||||
@@dirs = nil
|
@@dirs = nil
|
||||||
Gem.pre_reset_hooks.each {|hook| hook.call }
|
Gem.pre_reset_hooks.each {|hook| hook.call }
|
||||||
@@all = nil
|
clear_specs
|
||||||
@@stubs = nil
|
|
||||||
@@stubs_by_name = {}
|
|
||||||
@@spec_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?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user