aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2013-06-12 14:48:17 -0500
committerJack Nagel2013-06-12 14:48:17 -0500
commitc30f00c37cf8a6405426bc7b4091b49aee68620e (patch)
tree8cdaa5a14014c5b206210250fbc232e746fb9a7d
parentd1a1a3b031ae2f8ac2d131046c86fe004a8b2505 (diff)
downloadbrew-c30f00c37cf8a6405426bc7b4091b49aee68620e.tar.bz2
Remove use of global variable
-rw-r--r--Library/Homebrew/cmd/search.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb
index b5942298e..5559835dd 100644
--- a/Library/Homebrew/cmd/search.rb
+++ b/Library/Homebrew/cmd/search.rb
@@ -27,7 +27,7 @@ module Homebrew extend self
end
if query
- $found = search_results.length
+ found = search_results.length
threads = []
results = []
@@ -42,12 +42,13 @@ module Homebrew extend self
threads << Thread.new { search_tap "Homebrew", "x11", rx }
threads.each do |t|
- results << t.value
+ results.concat(t.value)
end
- results.each { |r| puts_columns r }
+ puts_columns(results)
+ found += results.length
- if $found == 0 and not blacklisted? query
+ if found == 0 and not blacklisted? query
puts "No formula found for #{query.inspect}. Searching open pull requests..."
GitHub.find_pull_requests(rx) { |pull| puts pull }
end
@@ -73,7 +74,6 @@ module Homebrew extend self
name = File.basename(file, '.rb')
if file =~ /\.rb$/ and name =~ rx
results << "#{user}/#{repo}/#{name}"
- $found += 1
end
end
end