For users whose local brew is at around 2015-06-11 to 2015-08-06,
running `brew update` will emit following error:
Error: uninitialized constant Formulary::CoreFormulaRepository
This is caused by the same bug described in Homebrew/homebrew#42553.
This commit workarounds this issue and restores `brew update` compatibility
for users mentioned above.
Also cleanup legacy `require "cmd/tap"`.
Let's hide implementation detail on where to find alias directory.
This will benefit future core code and formulae separation.
Also let `brew readall` check aliases for all taps.
There are plenty of IO operations inside Tap object, and it will be more
when implementing formula alias reverse look up(e.g. list all of alias
names for a formula). So let's cache them.
Some benchmark:
$ time brew info $(brew ruby -e 'puts Formula.tap_names') > /dev/null
Before: 6.40s user 2.42s system 96% cpu 9.134 total
After: 4.75s user 0.77s system 97% cpu 5.637 total
ClosesHomebrew/homebrew#44377.
Signed-off-by: Xu Cheng <xucheng@me.com>
Before
```
$ time brew readall
brew readall 10.63s user 0.36s system 99% cpu 11.003 total
```
After
```
$ time brew readall
brew readall 5.62s user 0.24s system 99% cpu 5.859 total
```
ClosesHomebrew/homebrew#42302.
Signed-off-by: Xu Cheng <xucheng@me.com>
This is a little code refactoring splited from Homebrew/homebrew#36753
The idea is to eliminate `Formula#path` outside of `formulary.rb`.
And I indent to deprecate `Formula#path` method when I reimplement
symlink free tap function.
ClosesHomebrew/homebrew#39313.