Extract search_taps method
This commit is contained in:
parent
e0fba99699
commit
5482092bd0
@ -28,15 +28,7 @@ module Homebrew extend self
|
|||||||
|
|
||||||
if query
|
if query
|
||||||
found = search_results.length
|
found = search_results.length
|
||||||
|
results = search_taps(rx)
|
||||||
results = []
|
|
||||||
|
|
||||||
SEARCHABLE_TAPS.map do |user, repo|
|
|
||||||
Thread.new { search_tap(user, repo, rx) }
|
|
||||||
end.each do |t|
|
|
||||||
results.concat(t.value)
|
|
||||||
end
|
|
||||||
|
|
||||||
puts_columns(results)
|
puts_columns(results)
|
||||||
found += results.length
|
found += results.length
|
||||||
|
|
||||||
@ -68,6 +60,14 @@ module Homebrew extend self
|
|||||||
end
|
end
|
||||||
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
|
def search_tap user, repo, rx
|
||||||
return [] if (HOMEBREW_LIBRARY/"Taps/#{user.downcase}-#{repo.downcase}").directory?
|
return [] if (HOMEBREW_LIBRARY/"Taps/#{user.downcase}-#{repo.downcase}").directory?
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user