diff options
| author | Alyssa Ross | 2016-11-17 14:34:04 +0000 |
|---|---|---|
| committer | Alyssa Ross | 2016-11-17 14:36:49 +0000 |
| commit | 3555206a7fe83adb5fe6f48f5e2e20400e8a6ae8 (patch) | |
| tree | f27a4c031bc1932e59d46a9467c48fecbf0ea14e /Library | |
| parent | 5baf16f50e71cd8224dad58350e67fceb56942a1 (diff) | |
| download | brew-3555206a7fe83adb5fe6f48f5e2e20400e8a6ae8.tar.bz2 | |
formula: make cache clearing methods, *ahem*, clearer
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/formula.rb | 10 | ||||
| -rw-r--r-- | Library/Homebrew/tab.rb | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 5434d87c2..84c2fb7a7 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -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 diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index 6b274b143..3bb7d8b62 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -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) |
