aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/audit.rb
diff options
context:
space:
mode:
authorMike McQuaid2015-07-09 12:31:17 +0100
committerMike McQuaid2015-07-09 14:50:55 +0100
commit3ac60059312dc7ca396500819d9f0f32dabf13e9 (patch)
tree996867efc2b2f39420f76b9af22d4055d122d76b /Library/Homebrew/cmd/audit.rb
parentb11ae2abdcb1ab91000109a4852f92ba2de0c285 (diff)
downloadbrew-3ac60059312dc7ca396500819d9f0f32dabf13e9.tar.bz2
audit: add --online flag.
Also add it to the manpage and brew-test-bot. Closes Homebrew/homebrew#41516. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Homebrew/cmd/audit.rb')
-rw-r--r--Library/Homebrew/cmd/audit.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index a73a0bef5..5a3e41d67 100644
--- a/Library/Homebrew/cmd/audit.rb
+++ b/Library/Homebrew/cmd/audit.rb
@@ -18,6 +18,8 @@ module Homebrew
style
end
+ online = ARGV.include? "--online"
+
ENV.activate_extensions!
ENV.setup_build_environment
@@ -50,7 +52,7 @@ module Homebrew
output_header = !strict
ff.each do |f|
- fa = FormulaAuditor.new(f, :strict => strict)
+ fa = FormulaAuditor.new(f, :strict => strict, :online => online)
fa.audit
unless fa.problems.empty?
@@ -131,6 +133,7 @@ class FormulaAuditor
def initialize(formula, options={})
@formula = formula
@strict = !!options[:strict]
+ @online = !!options[:online]
@problems = []
@text = FormulaText.new(formula.path)
@specs = %w{stable devel head}.map { |s| formula.send(s) }.compact
@@ -230,6 +233,7 @@ class FormulaAuditor
return
end
+ return unless @online
same_name_tap_formulae = Formula.tap_names.select do |tap_formula_name|
user_name, _, formula_name = tap_formula_name.split("/", 3)
user_name == "homebrew" && formula_name == name
@@ -423,7 +427,7 @@ class FormulaAuditor
end
def audit_github_repository
- return unless @strict
+ return unless @online
regex = %r{https?://github.com/([^/]+)/([^/]+)/?.*}
_, user, repo = *regex.match(formula.stable.url) if formula.stable