137 Commits

Author SHA1 Message Date
Markus Reiter
9bee9ca575 Use “squiggly” heredocs. 2017-10-18 14:39:09 +02:00
Dominyk Tiller
f6bc7dc4c6
search: pass explicit sort to handle APFS 2017-10-14 04:17:03 +01:00
Mike McQuaid
cf5fdeef1d Rubocop: manual rule fixes. 2017-09-24 21:23:59 +01:00
Mike McQuaid
f0605f4a30 audit: don't output when searching taps.
This messaging was added for the `brew search` command and having it in
audit is annoying:
(https://github.com/Homebrew/brew/pull/3059#issuecomment-323638672)

As a side note: this is why randomly including `cmd/*` is a bad idea.
2017-08-23 18:40:30 +01:00
Viktor Szakats
b44c7a1022 upgrade more urls to https 2017-08-22 10:31:21 +00:00
Markus Reiter
3b92f69869 Merge pull request #3054 from BenMusch/github-refactor
Clean-up code in GitHub module to reduce duplication & coupling w/ Github API
2017-08-18 16:26:30 +02:00
Mike McQuaid
961d79011e search: explain why it takes the time it does.
Provide a bit of clarity that this isn't just searching a local database
but doing an GitHub API and Git history query.
2017-08-15 10:25:51 +01:00
Ben Muschol
603bdd01a8 Implement PR feedback 2017-08-14 11:08:56 -04:00
Ben Muschol
e93ec12b32 Remove duplicate url generation logic in Github module 2017-08-13 15:03:44 -04:00
Ben Muschol
cb1650075c Fix style 2017-08-11 15:59:08 -04:00
Ben Muschol
b06fceda57 Add a test 2017-08-11 15:49:57 -04:00
Ben Muschol
348fefea10 Replace search_tap with search_taps 2017-08-11 13:04:37 -04:00
Bob W. Hogg
3b7113b304 cmd/search: use new Fedora package search
pkgdb has been put into read-only mode,
so it won't be updated for new Fedora releases
going forward. Use apps.fedoraproject.org/packages instead.

Signed-off-by: Bob W. Hogg <rwhogg@linux.com>
2017-08-07 18:22:26 -07:00
Mike McQuaid
7a0aff1080 Autocorrect Rubocop Style/PerlBackrefs. 2017-06-10 20:23:20 +03:00
Markus Reiter
8d514ae8f0 Merge pull request #2716 from reitermarkus/re-revert
Re-revert "Fix operator spacing."
2017-06-03 00:49:06 +02:00
Mike McQuaid
8d2794212f search: don’t exclude Caskroom results even if tapped.
As they are not shown in the normal `brew search` output.
2017-06-02 22:19:04 +01:00
Markus Reiter
2d6ae61314 Re-revert "Fix operator spacing." 2017-06-02 19:22:05 +02:00
ilovezfs
197392b56d Revert "Fix operator spacing." 2017-06-01 04:06:40 -07:00
Markus Reiter
d34ba7395b Fix operator spacing. 2017-05-31 19:53:41 +02:00
Markus Reiter
2bda194bd9 Add GitHub::search_code method. 2017-04-25 12:29:01 +02:00
Mike McQuaid
b3c69aba87 search: use single HTTP call for tap searches.
Use GitHub's code search API to search using the filename based on the
search query. This means we only need a single HTTP call and no more
multithreading madness. This also means we're able to search everything
in the Homebrew and Caskroom organisation by default without having to
maintain a list of things to search (and not) in here.
2017-04-24 14:11:04 +01:00
Markus Reiter
6ce84c4fb8 Add OFFICIAL_CASK_TAPS in official_taps.rb. 2017-04-20 05:22:34 +02:00
Markus Reiter
3c017a7405 Lowercase Caskroom in search. 2017-04-20 05:22:34 +02:00
Mike McQuaid
35a4836dc3 search: silence searching git log. 2017-03-23 08:39:29 +00:00
Mike McQuaid
f59eb358c2 missing_formula: subsume historic logic.
These methods belong together so combine them in a single class to
provide a simpler API.
2017-03-20 20:37:12 +01:00
Mike McQuaid
80e95b684e blacklist: move to missing_formula class instead.
This will allow extending this class so it can be used by more than
just blacklisting.
2017-03-20 18:20:31 +02:00
Mike McQuaid
8cedd62750 search: tweak specific formula match formatting. 2017-03-20 18:20:31 +02: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
198bf4d3bd Convert puts_columns to puts Formatter.columns. 2016-10-15 17:13:38 +02:00
Markus Reiter
01d87f8107 Don’t use puts_columns if empty? or single item. 2016-10-15 17:13:38 +02:00
Markus Reiter
0ab750bf24 Use module_function for commands. 2016-10-02 00:24:47 +02:00
Markus Reiter
f732278cda Fix search_tap regex/string matching. 2016-09-25 16:27:43 +02:00
Markus Reiter
a5b11a6a5c Fix Style/GuardClause. 2016-09-23 15:30:07 +02:00
Markus Reiter
52ff988530 Fix RuboCop CaseEquality. 2016-09-23 15:30:06 +02:00
Mike McQuaid
b9b07fc082 cmd/search: fix Rubocop warnings. 2016-09-11 17:59:00 +01:00
Dominyk Tiller
ab203a749f
search: handle name@v.v formulae.
Before this change:
```
~> brew search openssl@1.1
openssl@1.1 ✔
==> Did you mean to perform a regular expression search?
==> Surround your query with /slashes/ to search by regex.
```
2016-08-28 03:08:21 +01:00
Mike McQuaid
b9efa6336e search: remove thread-unsafe Hash cache.
Doesn't appear to affect the speed of `brew search`.

Fixes #415.
2016-08-12 21:29:49 +01:00
Mike McQuaid
850db4ebf4 search: fix repositories with formulae and casks.
e.g. Caskroom/homebrew-cask.

Thanks to UniqMartin for the fix.

Fixes #655.
2016-08-08 10:55:12 +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
Martin Afanasjew
1c581a232c search: add alias -S back to zero-argument help
Amends 132ada2b0ebb3751c0f8f42ca83bb257b55a50fd until we properly figure
out a way of documenting built-in aliases (or not doing that) across all
commands that currently have aliases. See #270 for full discussion.
2016-05-26 17:52:58 +02:00
Joe Gallo
132ada2b0e Clarify brew search usage. (#270)
* Include --desc in brew search help text.
* Update brew search --desc text in README.
* Remove mention of alias in brew search help text to avoid any
  confusion.
2016-05-26 16:45:25 +02:00
Max Nordlund
fa1fd70a37 Add all the top level comments 2016-04-10 22:59:25 +02:00
Sam McTaggart
148da47571 Improve error message for invalid regex to search
Fixes https://github.com/Homebrew/homebrew/issues/50131

This commit removes the error backtrace and improves the error message
if a bad regexp is passed to `brew search`.

Closes Homebrew/homebrew#50173.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-03-19 19:14:50 +08:00
Tommy Sparber
d675fa0b5a Search also in Caskroom/versions Tap
Extending the current search functionallity to search in
https://github.com/caskroom/homebrew-versions

Closes Homebrew/homebrew#47954.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-01-17 21:53:20 +00:00
Mike McQuaid
bf2315b1f4 Use (installed) and emoji ticks consistently.
Across info, search and update.

Closes Homebrew/homebrew#45131.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-07 14:56:30 +00:00
Xu Cheng
b5ec74c3f6 search: various improvement
* Move listing all formula names in the top to speed up shell script.
* Simplify logic.
* Only search PR and check bad regex for tty?, which will benefit to
  shell script.

Closes Homebrew/homebrew#44985.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-10-15 17:24:41 +08:00
Xu Cheng
135efb39b8 search: highlight installed formulae 2015-10-15 17:24:41 +08:00
Xu Cheng
51a585e0b4 search: don't fail because broken formulae
Fixes Homebrew/homebrew#44687.

Closes Homebrew/homebrew#44770.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-10-10 01:33:44 +08:00
Xu Cheng
8a30f315d9 search: use full name to filter aliases result 2015-09-13 21:27:49 +08:00
Xu Cheng
0165a810f7 search: handle tap aliases 2015-09-13 17:47:53 +08:00