71 Commits

Author SHA1 Message Date
Xu Cheng
28f3dae8cd rename CoreFormulaRepository to CoreTap
Core tap will be separated from core code in the near future.
It makes sense to rename it to CoreTap.
2016-03-07 19:43:46 +08:00
Xu Cheng
0f84b976ba move CoreFormulaRepository into separate file
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"`.
2015-12-19 22:05:30 +08:00
Xu Cheng
f72d4f1722 readall: use Tap object to locate alias directory
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.
2015-12-19 22:05:30 +08:00
Xu Cheng
430cfbb557 readall: allow interrupt 2015-12-19 22:05:30 +08:00
Xu Cheng
2c25303949 remove unnecessary tap_args
It's now handled by Tap.fetch
2015-12-09 16:56:59 +08:00
Xu Cheng
3b520cf195 cache 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

Closes Homebrew/homebrew#44377.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-09-30 16:25:30 +08:00
Xu Cheng
ffdede2ac4 readall: put nostdout in outter layer
The previous code would fail to reset stdout after thread jobs are finshed.
2015-09-06 20:15:37 +08:00
Xu Cheng
1555edf4d6 readall: add --aliases 2015-09-06 20:15:37 +08:00
Xu Cheng
1af6ffa950 brew readall --syntax: skip vendor files 2015-08-03 21:27:40 +08:00
Xu Cheng
ac738ae2cd enumerate all formulae by files rather than names
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
```

Closes Homebrew/homebrew#42302.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-01 00:49:50 +08:00
Dominyk Tiller
895983fed5 readall: use RUBY_PATH 2015-07-22 05:10:27 +01:00
Xu Cheng
b88cb13718 add TapUnavailableError 2015-06-14 21:28:36 +08:00
Xu Cheng
44383fecb8 (un)tap/update/readall: use Tap class 2015-06-11 15:28:29 +08:00
Xu Cheng
e2b0bca931 add Formula.core_names Formula.tap_names and Formula.full_names 2015-05-27 13:53:40 +08:00
Xu Cheng
8297810e3c add Formulary::path method
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.

Closes Homebrew/homebrew#39313.
2015-05-08 13:51:26 +08:00
Mike McQuaid
dfcb26b2c3 readall: use named to check if ARGV is empty.
Otherwise e.g. --debug will be interpreted as a (bad) tap argument.

Closes Homebrew/homebrew#38569.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-04-12 21:37:29 -07:00
Mike McQuaid
2d1c8b4de4 test-bot: don't run readall on <=10.8.
The Ruby 1.8 implementation seems to be really flaky, unfortunately.
2015-03-20 16:59:21 +00:00
Mike McQuaid
d5f55334f1 cmd/readall: add --syntax to check for valid Ruby. 2015-03-08 11:13:33 +00:00
Jack Nagel
4d9d01893e Move deprecated Formula class methods to compat
These have all been moved to Formulary.
2014-06-22 15:03:17 -05:00
Adam Vandenberg
9c4d309a80 readall: fix permissions 2014-06-15 16:21:28 -07:00
Adam Vandenberg
53826bdb0e Migrate readall 2014-06-15 15:48:14 -07:00