aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2013-06-12 14:48:17 -0500
committerJack Nagel2013-06-12 14:48:17 -0500
commite0fba99699e168d863dd7bcb57190766d612c95b (patch)
treed8e5381cf2336c7b29dd6e83bac7ac96bdc69063 /Library
parentc30f00c37cf8a6405426bc7b4091b49aee68620e (diff)
downloadbrew-e0fba99699e168d863dd7bcb57190766d612c95b.tar.bz2
Pull tap list into a constant
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/search.rb26
1 files changed, 15 insertions, 11 deletions
diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb
index 5559835dd..aaa0b5850 100644
--- a/Library/Homebrew/cmd/search.rb
+++ b/Library/Homebrew/cmd/search.rb
@@ -29,19 +29,11 @@ module Homebrew extend self
if query
found = search_results.length
- threads = []
results = []
- threads << Thread.new { search_tap "josegonzalez", "php", rx }
- threads << Thread.new { search_tap "samueljohn", "python", rx }
- threads << Thread.new { search_tap "Homebrew", "apache", rx }
- threads << Thread.new { search_tap "Homebrew", "versions", rx }
- threads << Thread.new { search_tap "Homebrew", "dupes", rx }
- threads << Thread.new { search_tap "Homebrew", "games", rx }
- threads << Thread.new { search_tap "Homebrew", "science", rx }
- threads << Thread.new { search_tap "Homebrew", "completions", rx }
- threads << Thread.new { search_tap "Homebrew", "x11", rx }
- threads.each do |t|
+ SEARCHABLE_TAPS.map do |user, repo|
+ Thread.new { search_tap(user, repo, rx) }
+ end.each do |t|
results.concat(t.value)
end
@@ -56,6 +48,18 @@ module Homebrew extend self
end
end
+ SEARCHABLE_TAPS = [
+ %w{josegonzalez php},
+ %w{samueljohn python},
+ %w{Homebrew apache},
+ %w{Homebrew versions},
+ %w{Homebrew dupes},
+ %w{Homebrew games},
+ %w{Homebrew science},
+ %w{Homebrew completions},
+ %w{Homebrew x11},
+ ]
+
def query_regexp(query)
case query
when nil then ""