67 Commits

Author SHA1 Message Date
Jack Nagel
0291a579fb Respect tap directory layout when searching
This matches the logic in find_formula.
2014-04-27 17:28:19 -05:00
Jack Nagel
ccc62a0cad Use canonical_name to canonicalize aliases 2014-04-27 16:03:32 -05:00
Jack Nagel
82047ed901 Search results should always be sorted 2014-04-27 16:03:08 -05:00
Jack Nagel
3b15b58d00 Use Formulary.factory to find formula in taps 2014-04-27 15:32:28 -05:00
Jack Nagel
bdee729a41 Yield absolute paths from find_formula 2014-04-25 18:58:16 -05:00
Tsukasa OMOTO
54004a4759 Make the on-disk representation of taps unambiguous
This commit supports "-" and "_" in names of user and repository.

Closes Homebrew/homebrew#28203.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-04-24 17:10:41 -05:00
Mike McQuaid
daa7b7b6db search: move nginx to Homebrew organisation. 2014-04-18 10:59:12 +01:00
Mike McQuaid
513a1f2ebd Migrate homebrew-php to Homebrew organization. 2014-04-10 16:22:24 +01:00
Jack Nagel
7bdaa7ffe1 search: use a queue to collect errors
The threading in the tap search code makes handling errors difficult. If
an API-related error is raised in one thread, it is likely to be raised
in each of the rest as well. This results in duplicated error messages,
which is ugly and bad UX.

This patch adds a synchronized queue to collect these exceptions. The
first one added to the queue is re-raised after all operations are
complete.

It's not ideal, but it's minimally invasive and I don't have the energy
or time to do a rewrite.
2014-02-16 23:19:09 -05:00
Jack Nagel
a7b515e503 Use a more accurate method name and drop unhelpful block 2014-02-13 23:22:43 -05:00
Jack Nagel
345457b33e Pass the string instead of reconstructing it from a regexp 2014-02-12 13:59:18 -05:00
Jack Nagel
d01c671d74 Drop unnecessary map + compact in search_tap 2014-02-08 17:53:08 -05:00
Jack Nagel
7d4709d9d6 Prevent repeated warnings when GitHub API rate limit is exceeded 2014-02-08 16:04:53 -05:00
Jack Nagel
2e3871c076 Raise only GitHub::Error from GitHub.open 2014-02-08 16:04:53 -05:00
Jack Nagel
4d6df3e3bc Parse JSON early in GitHub module 2014-02-08 16:04:53 -05:00
Jack Nagel
f7e1244e6d Don't mutate argument in search_tap 2014-02-08 16:04:52 -05:00
Mike McQuaid
30e409adfd search: handle tap not found and suggest update.
Closes Homebrew/homebrew#25706.
Closes Homebrew/homebrew#25682.
2014-01-09 17:20:54 +00:00
Mike McQuaid
5b95710254 homebrew-python has moved to Homebrew org. 2013-12-28 12:14:38 +00:00
Adam Vandenberg
f37e84d766 retire homebrew/x11
Closes Homebrew/homebrew#24405.
2013-11-17 12:20:28 -08:00
David MacMahon
a999ddc002 Add HOMEBREW_NO_GITHUB_API env var.
This patch allows users to "opt out" of using the GitHub API altogether
by setting the HOMEBREW_NO_GITHUB_API environment variable. The
value of the environment variable does not matter (it can even be
empty!).

For Bash/ZSH: export HOMEBREW_NO_GITHUB_API=1

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2013-10-25 21:12:28 +01:00
Mike McQuaid
98b28f5ac3 Different regex for user/tap/formula and user/tap.
Closes Homebrew/homebrew#23430.
2013-10-22 11:58:40 +01:00
Mike McQuaid
077f09e4ea global: unify tap regex.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2013-10-21 18:53:24 +01:00
Samuel John
9b755e5ad2 brew search <user>/<repo> [substring]
For example `brew search homebrew/science` to get a list of all formulae
from that tap, even if not yet tapped.

`brew search <user>/<repo>/<substr>` or
`brew search <user>/<repo> <substr>` to grep for `<substr>`
inside of the tap `<user>/<repo>`.
2013-09-03 11:52:34 +02:00
Adam Vandenberg
31348c34ae add ubuntu package search 2013-08-14 22:14:35 -07:00
Adam Vandenberg
bcaa823538 Add fedora to brew search 2013-08-09 09:32:51 -07:00
Adam Vandenberg
5600713bbb Add opensuse package search 2013-08-05 15:05:02 -07:00
Adam Vandenberg
1540b3aadd Search marcqualie/nginx
Closes Homebrew/homebrew#21678.
2013-08-05 13:32:23 -07:00
Adam Vandenberg
583dd38b08 Add homebrew-binary to search 2013-08-03 10:27:45 -07:00
Jack Nagel
366cb87aec search: silence JSON decode errors
Closes Homebrew/homebrew#21506.
Closes Homebrew/homebrew#21508.
2013-07-28 15:38:46 -05:00
Jack Nagel
6b299c4207 Clarify behavior of brew search without an argument
As documented in the man page, when given no arguments, `brew search`
will list all formulae. This is different than giving an *empty*
argument.
2013-07-15 10:59:00 -05:00
Jack Nagel
59fdcfd4d0 Better behavior for failed connections in brew search
Fixes Homebrew/homebrew#20868.
2013-07-01 17:00:08 -05:00
Jack Nagel
083b3c84d0 Add Utils::JSON to wrap the JSON implementation 2013-06-22 21:34:02 -05:00
Jack Nagel
630aa27c56 Rename variables for clarity 2013-06-12 14:48:17 -05:00
Jack Nagel
5482092bd0 Extract search_taps method 2013-06-12 14:48:17 -05:00
Jack Nagel
e0fba99699 Pull tap list into a constant 2013-06-12 14:48:17 -05:00
Jack Nagel
c30f00c37c Remove use of global variable 2013-06-12 14:48:17 -05:00
Jack Nagel
d1a1a3b031 Rename method 2013-06-12 14:48:16 -05:00
Jack Nagel
1d1c292bcb Extract query construction 2013-06-12 14:48:16 -05:00
Jack Nagel
90768d03d2 Use inspect instead of escaping quotes 2013-06-12 14:48:16 -05:00
Jack Nagel
13a2ceef5c Move require out of method 2013-06-12 12:23:45 -05:00
Adam Vandenberg
0e7d47332c Add brew search --debian <f> 2013-05-27 17:32:27 -07:00
Daniel Lee Harple
471502bc06 Remove unnecessary rescue-all exception handling
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-05-22 19:53:05 -05:00
Daniel Lee Harple
0fa5c47d7f Check GitHub API rate limit instead of silently failing
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-05-22 19:53:04 -05:00
Daniel Lee Harple
222f96d37b Pass a User-Agent when fetching data from the GitHub API
See <http://developer.github.com/v3/#user-agent-required>.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-05-22 19:53:01 -05:00
Adam Vandenberg
b85bf58007 search homebrew-x11 2013-02-10 11:15:20 -08:00
Mike McQuaid
36497f2a5d brew-search: search homebrew/apache tap. 2013-01-30 22:15:37 -08:00
Samuel John
04d22a88b1 brew search looks in samueljohn/python, too.
Closes Homebrew/homebrew#17267.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-01-23 19:53:46 -08:00
Adam Vandenberg
05eb740766 Add Homebrew-completions to search 2013-01-23 19:53:06 -08:00
Jack Nagel
9362a7c897 Respect BROWSER environment variable 2012-12-27 23:41:44 -06:00
Adam Vandenberg
31d70b5c33 Fix the name because adamv doesn't know what he's doing. 2012-09-01 19:01:56 -07:00