From e0c7b38aa78f457573becd89121bc1fc927c9186 Mon Sep 17 00:00:00 2001 From: Baptiste Fontaine Date: Thu, 21 Jan 2016 00:12:16 +0100 Subject: audit: warn once about deprecated *Formula classes GithubGistFormula inherits from ScriptFileFormula so a problem is added for each one instead of the first only. --- Library/Homebrew/cmd/audit.rb | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index a546bcf8a..91a5cce2b 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -224,17 +224,12 @@ class FormulaAuditor end end - if Object.const_defined?("GithubGistFormula") && formula.class < GithubGistFormula - problem "GithubGistFormula is deprecated, use Formula instead" + classes = %w[GithubGistFormula ScriptFileFormula AmazonWebServicesFormula] + klass = classes.find do |c| + Object.const_defined?(c) && formula.class < Object.const_get(c) end - if Object.const_defined?("ScriptFileFormula") && formula.class < ScriptFileFormula - problem "ScriptFileFormula is deprecated, use Formula instead" - end - - if Object.const_defined?("AmazonWebServicesFormula") && formula.class < AmazonWebServicesFormula - problem "AmazonWebServicesFormula is deprecated, use Formula instead" - end + problem "#{klass} is deprecated, use Formula instead" if klass end # core aliases + tap alias names + tap alias full name -- cgit v1.2.3