formula: make cache clearing methods, *ahem*, clearer
This commit is contained in:
parent
5baf16f50e
commit
3555206a7f
@ -1337,10 +1337,14 @@ class Formula
|
||||
end
|
||||
end
|
||||
|
||||
# Clear caches of .racks and .installed.
|
||||
# @private
|
||||
def self.clear_cache
|
||||
# Clear cache of .racks
|
||||
def self.clear_racks_cache
|
||||
@racks = nil
|
||||
end
|
||||
|
||||
# Clear caches of .racks and .installed.
|
||||
def self.clear_installed_formulae_cache
|
||||
clear_racks_cache
|
||||
@installed = nil
|
||||
end
|
||||
|
||||
|
||||
@ -319,7 +319,7 @@ class Tab < OpenStruct
|
||||
def write
|
||||
# If this is a new installation, the cache of installed formulae
|
||||
# will no longer be valid.
|
||||
Formula.clear_cache unless tabfile.exist?
|
||||
Formula.clear_installed_formulae_cache unless tabfile.exist?
|
||||
|
||||
CACHE[tabfile] = self
|
||||
tabfile.atomic_write(to_json)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user