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