diff options
| author | Jack Nagel | 2013-04-06 22:10:33 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-04-06 22:10:33 -0500 |
| commit | 11774c888c7f78afb903ec75d942867d832d5899 (patch) | |
| tree | 968e61acf278bc931aff3d63115961265e46011b | |
| parent | 74381fef56b508de35ad12a975e849f59c52c047 (diff) | |
| download | homebrew-11774c888c7f78afb903ec75d942867d832d5899.tar.bz2 | |
audit: clean up URL audits
| -rw-r--r-- | Library/Homebrew/cmd/audit.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index 1504b4fe0..8523102a8 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -94,6 +94,7 @@ class FormulaAuditor @f = f @problems = [] @text = f.text.without_patch + @specs = %w{stable devel head}.map { |s| f.send(s) }.compact # We need to do this in case the formula defines a patch that uses DATA. f.class.redefine_const :DATA, "" @@ -196,7 +197,7 @@ class FormulaAuditor problem "GitHub pages should use the github.io domain (url is #{f.homepage})" end - urls = [(f.stable.url rescue nil), (f.devel.url rescue nil), (f.head.url rescue nil)].compact + urls = @specs.map(&:url) # Check GNU urls; doesn't apply to mirrors urls.grep(%r[^(?:https?|ftp)://(?!alpha).+/gnu/]).each do |u| @@ -204,7 +205,7 @@ class FormulaAuditor end # the rest of the checks apply to mirrors as well - urls.concat([(f.stable.mirrors rescue nil), (f.devel.mirrors rescue nil)].flatten.compact) + urls.concat(@specs.map(&:mirrors).flatten) # Check SourceForge urls urls.each do |p| |
