aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-09-07 14:20:37 -0500
committerJack Nagel2014-09-07 14:20:37 -0500
commit269405995eafbeb7c114e297521cae05a754ac5c (patch)
treebed9551d558988f9eeab6a53a9af30a6757654f4 /Library
parent20923363c90d5c2e7263914adadeed3c2d729093 (diff)
downloadbrew-269405995eafbeb7c114e297521cae05a754ac5c.tar.bz2
Simplify getting the list of doctor checks
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/doctor.rb17
1 files changed, 11 insertions, 6 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index 20e00f7eb..1dbe40191 100644
--- a/Library/Homebrew/cmd/doctor.rb
+++ b/Library/Homebrew/cmd/doctor.rb
@@ -1109,6 +1109,10 @@ end
EOS
end
end
+
+ def all
+ methods.map(&:to_s).grep(/^check_/)
+ end
end # end class Checks
module Homebrew
@@ -1116,18 +1120,19 @@ module Homebrew
checks = Checks.new
if ARGV.include? '--list-checks'
- puts checks.methods.grep(/^check_/).sort
+ puts checks.all.sort
exit
end
inject_dump_stats(checks) if ARGV.switch? 'D'
- methods = if ARGV.named.empty?
- # put slowest methods last
- checks.methods.map(&:to_s).sort << "check_for_linked_keg_only_brews" << "check_for_outdated_homebrew"
+ if ARGV.named.empty?
+ methods = checks.all.sort
+ methods << "check_for_linked_keg_only_brews" << "check_for_outdated_homebrew"
+ methods = methods.reverse.uniq.reverse
else
- ARGV.named
- end.grep(/^check_/).reverse.uniq.reverse
+ methods = ARGV.named
+ end
first_warning = true
methods.each do |method|