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
commit5482092bd02a9ac45c62a543b3526e8556b701ae (patch)
tree41b25c37dd4764b32145908a865800642dc75a05 /Library
parente0fba99699e168d863dd7bcb57190766d612c95b (diff)
downloadbrew-5482092bd02a9ac45c62a543b3526e8556b701ae.tar.bz2
Extract search_taps method
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/search.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb
index aaa0b5850..4dd050c67 100644
--- a/Library/Homebrew/cmd/search.rb
+++ b/Library/Homebrew/cmd/search.rb
@@ -28,15 +28,7 @@ module Homebrew extend self
if query
found = search_results.length
-
- results = []
-
- SEARCHABLE_TAPS.map do |user, repo|
- Thread.new { search_tap(user, repo, rx) }
- end.each do |t|
- results.concat(t.value)
- end
-
+ results = search_taps(rx)
puts_columns(results)
found += results.length
@@ -68,6 +60,14 @@ module Homebrew extend self
end
end
+ def search_taps(rx)
+ SEARCHABLE_TAPS.map do |user, repo|
+ Thread.new { search_tap(user, repo, rx) }
+ end.inject([]) do |results, t|
+ results.concat(t.value)
+ end
+ end
+
def search_tap user, repo, rx
return [] if (HOMEBREW_LIBRARY/"Taps/#{user.downcase}-#{repo.downcase}").directory?