aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorBaptiste Fontaine2016-01-21 00:12:16 +0100
committerBaptiste Fontaine2016-01-25 01:26:24 +0100
commite0c7b38aa78f457573becd89121bc1fc927c9186 (patch)
treedd46abbd92a333cbe088259e7026926133a16062 /Library
parent3d9bc57feacf32d9050569b3645c29d2a0ddd749 (diff)
downloadbrew-e0c7b38aa78f457573becd89121bc1fc927c9186.tar.bz2
audit: warn once about deprecated *Formula classes
GithubGistFormula inherits from ScriptFileFormula so a problem is added for each one instead of the first only.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/audit.rb13
1 files changed, 4 insertions, 9 deletions
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