231 Commits

Author SHA1 Message Date
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
Xu Cheng
80514ee5d7 desc: better way to handle options
We allow to use options like --verbose and --debug for all commands.
And we should support switch format options, e.g. `brew desc -vs foo`
2015-09-10 13:37:57 +08:00
Dan Martinez
8374374168 Improve description searching and add a cache.
Closes Homebrew/homebrew#42281.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-09-08 15:23:37 +01:00
Alex Dunn
79ea14b738 cmd/search: fix filtering of aliases in results
By directly modifying the results array with
`results[i] = "#{name} (installed)"`, it appeared on successive
iterations that the canonical name was no longer in the array, so
aliases were not removed.

See 9efe5b554c (commitcomment-12969631)

Closes Homebrew/homebrew#43433.
2015-08-31 07:54:59 -07:00
Alex Dunn
431ebba7af cmd/search: mark installed formulae
`brew search emacs`, with homebrew/emacs tapped:
```
real    0m2.586s
user    0m1.138s
sys     0m0.121s
```
Previously:
```
real    0m2.831s
user    0m1.385s
sys     0m0.087s
```

`brew search s`:
```
real    0m2.260s
user    0m1.201s
sys     0m0.114s
```

Previously:
```
real    0m5.953s
user    0m4.827s
sys     0m0.226s
```

Closes Homebrew/homebrew#35696.
Closes Homebrew/homebrew#42662.
2015-08-30 11:29:13 -07:00
Xu Cheng
d62095710f More core files style updates 2015-08-03 20:38:20 +08:00
BrewTestBot
13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00