Simplify getting the list of doctor checks

This commit is contained in:
Jack Nagel 2014-09-07 14:20:37 -05:00
parent 20923363c9
commit 269405995e

View File

@ -1109,6 +1109,10 @@ end
EOS EOS
end end
end end
def all
methods.map(&:to_s).grep(/^check_/)
end
end # end class Checks end # end class Checks
module Homebrew module Homebrew
@ -1116,18 +1120,19 @@ module Homebrew
checks = Checks.new checks = Checks.new
if ARGV.include? '--list-checks' if ARGV.include? '--list-checks'
puts checks.methods.grep(/^check_/).sort puts checks.all.sort
exit exit
end end
inject_dump_stats(checks) if ARGV.switch? 'D' inject_dump_stats(checks) if ARGV.switch? 'D'
methods = if ARGV.named.empty? if ARGV.named.empty?
# put slowest methods last methods = checks.all.sort
checks.methods.map(&:to_s).sort << "check_for_linked_keg_only_brews" << "check_for_outdated_homebrew" methods << "check_for_linked_keg_only_brews" << "check_for_outdated_homebrew"
methods = methods.reverse.uniq.reverse
else else
ARGV.named methods = ARGV.named
end.grep(/^check_/).reverse.uniq.reverse end
first_warning = true first_warning = true
methods.each do |method| methods.each do |method|