aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/audit.rb
diff options
context:
space:
mode:
authorJack Nagel2014-09-14 15:43:20 -0500
committerJack Nagel2014-09-14 15:43:20 -0500
commite717508b7b63b5bb0f84b2c62d3c621857baa67c (patch)
tree3ee4fe0e0946441b3d5d55704096296e0364696b /Library/Homebrew/cmd/audit.rb
parentf3b7c3236bc7dc9516e67c780701ec5a0caae6c9 (diff)
downloadbrew-e717508b7b63b5bb0f84b2c62d3c621857baa67c.tar.bz2
audit: access the homepage attribute once
Diffstat (limited to 'Library/Homebrew/cmd/audit.rb')
-rw-r--r--Library/Homebrew/cmd/audit.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index 6dd70cd67..78a65952b 100644
--- a/Library/Homebrew/cmd/audit.rb
+++ b/Library/Homebrew/cmd/audit.rb
@@ -181,19 +181,21 @@ class FormulaAuditor
end
def audit_urls
- unless f.homepage =~ %r[^https?://]
- problem "The homepage should start with http or https (url is #{f.homepage})."
+ homepage = f.homepage
+
+ unless homepage =~ %r[^https?://]
+ problem "The homepage should start with http or https (URL is #{homepage})."
end
# Check for http:// GitHub homepage urls, https:// is preferred.
# Note: only check homepages that are repo pages, not *.github.com hosts
- if f.homepage =~ %r[^http://github\.com/]
- problem "Use https:// URLs for homepages on GitHub (url is #{f.homepage})."
+ if homepage =~ %r[^http://github\.com/]
+ problem "Use https:// URLs for homepages on GitHub (URL is #{homepage})."
end
# Google Code homepages should end in a slash
- if f.homepage =~ %r[^https?://code\.google\.com/p/[^/]+[^/]$]
- problem "Google Code homepage should end with a slash (url is #{f.homepage})."
+ if homepage =~ %r[^https?://code\.google\.com/p/[^/]+[^/]$]
+ problem "Google Code homepage should end with a slash (URL is #{homepage})."
end
urls = @specs.map(&:url)