55 Commits

Author SHA1 Message Date
Markus Reiter
5be4c9b5e0 Upgrade typed sigils. 2020-11-25 17:04:19 +01:00
Markus Reiter
da9289eff0 Add more type signatures. 2020-11-13 12:26:36 +01:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
d4c2ffd705 Refactor CLI::Parser. 2020-07-31 15:07:17 +02:00
Mike McQuaid
047738069f
Speed up timing-out tests.
- make `brew readall` only check Homebrew/brew syntax with no tap
  passed.
- pass specified tap to `brew readall` test for speed
- only shell out once in `FormulaInfo` test for speed
2020-07-27 14:01:22 +01:00
Sean Molenaar
3f6d3e5cf0
Support casks in readall 2020-06-18 20:15:07 +02:00
Mike McQuaid
a7fe0ed847
cmd: use more and cleanup new args APIs. 2020-03-05 09:40:15 +00:00
EricFromCanada
c246207ba0 cmd: updates for command descriptions 2019-12-13 15:24:00 -05:00
EricFromCanada
8a8359cdd4 manpages: sentence rewording for readability
Use active voice when applicable, better verbs & adjectives, preposition usage, proper tense, etc.
2019-08-20 09:05:45 -04:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
e40b171127
Rename cli_parser to cli/parser. 2019-04-17 22:16:50 +09:00
Mike McQuaid
6cb7a00f2d
cmd: remove --help headers and tweak docs. 2019-01-30 21:39:28 +00:00
Gautham Goli
bf51e3ea14
readall: Use CLI::Parser to parse args 2018-11-05 18:31:22 +05:30
EricFromCanada
1d2b4ed321 docs: add more missing option descriptions
and improve wording or formatting where necessary.
2018-02-01 16:06:17 -05:00
Mike McQuaid
6114f48d5d Unhide readall and update-reset from manpage.
These are both tools that end-users can find useful on occasion so it
doesn't make sense to hide them.
2017-10-26 16:14:14 +01:00
Mike McQuaid
ed28ed78d1 Merge pull request #3304 from richiethomas/refactor_uses
In 'readall.rb', replaced multi-step 'each' loop with one-line method chain of Ruby enumerator methods
2017-10-20 18:10:31 +01:00
richiethomas
43cbf08018 Remove memoization from uses.rb, as it doesn't result in the expected time complexity savings 2017-10-20 09:42:30 -04:00
richiethomas
b135a70c57 Fix brew style warnings 2017-10-18 20:21:49 -04:00
richiethomas
e5e84eec7d PR feedback- replace '#{HOMEBREW_LIBRARY}/Homebrew/**/*.rb' with '#{HOMEBREW_LIBRARY_PATH}/**/*.rb' 2017-10-18 18:20:44 -04:00
richiethomas
99bccaae13 Remove /cask/ from readall file filter 2017-10-18 17:44:09 -04:00
Maxim Belkin
ad3886b462
readall: update documentation 2017-10-18 14:50:44 -05:00
Richie Thomas
9ef82ae1e2 In 'readall.rb', replaced multi-step 'each' loop with one-line method chain of Ruby enumerator methods 2017-10-12 17:38:02 -04:00
Maxim Belkin
4c0e623bd4
readall: allow readall-ing multiple taps at once 2017-10-10 17:54:42 -05:00
EricFromCanada
afc539f86e Update brew's man page formatting and grammar
Also update command specifications to match descriptions.
2017-02-25 17:37:57 -05:00
Markus Reiter
0ab750bf24 Use module_function for commands. 2016-10-02 00:24:47 +02:00
Mike McQuaid
3982950e61 rubocop --auto-correct all hash-rocket usage. 2016-09-17 16:14:13 +01:00
Mike McQuaid
ebdb879fe4 Add --help to all developer commands.
Also, flag those that we never want to be in a manpage.
2016-09-08 09:05:00 +01:00
Mike McQuaid
135ecd1295 Prepare for Homebrew Cask to be imported.
- ignore Cask's files in `readall` (for now, there's an intentional
  syntax error that will need fixed)
- run Cask's tests if they exist
- don't check Cask's files in coverage reports (for now)
2016-08-17 09:11:11 +01:00
Xu Cheng
a8566c9848 various: eliminate the usage of any? (#638)
`any?` is not the opposite of `empty?`. Besides the case that
`[false, nil].any?` will return false, `any?`(O(n)) has much worse
performance than `empty?`(O(1)).
2016-08-05 22:01:32 +08:00
Mike McQuaid
4da990587f tap: run readall when tapping. (#396)
* readall: move readall logic to new class.

* tap: run readall when tapping.

This will prevent tapping an tap with syntax errors from causing issues
for users.

Fixes #58.
2016-07-09 13:51:19 +01:00
Martin Afanasjew
b5c27bb7e5 readall: also check 'brew.rb' for issues
Closes #119.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-04-22 00:47:43 +02:00
Martin Afanasjew
30c0d97e5c readall: stop using no longer needed 'nostdout'
Since switching from `system` to `Utils.popen_read` we no longer need to
suppress Ruby's output of `Syntax OK` to `$stdout`.
2016-04-22 00:47:43 +02:00
Martin Afanasjew
a61829da46 readall: fail on Ruby syntax warnings
Previously, syntax warnings were printed, but didn't cause `readall` to
exit with a non-zero exit code. Now they do, making it easier to catch
accidentally introduced syntax warnings in the test bot.
2016-04-22 00:47:43 +02:00
Xu Cheng
a5cfc011e0 various: Homebrew/core is the core tap
Also make `Homebrew/homebrew` as an alias of this tap to keep
backward compatibility.
2016-04-02 21:51:36 +08:00
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