Class: Cask::Cmd::Audit

Inherits:
AbstractCommand show all
Defined in:
brew/Library/Homebrew/cask/cmd/audit.rb

Instance Attribute Summary

Attributes inherited from AbstractCommand

#args

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractCommand

abstract?, command_name, #initialize, run, visible

Methods included from Homebrew::Search

#query_regexp, #search_casks, #search_descriptions, #search_formulae, #search_taps

Methods included from Options

#process_arguments

Constructor Details

This class inherits a constructor from Cask::Cmd::AbstractCommand

Class Method Details

.helpObject



10
11
12
# File 'brew/Library/Homebrew/cask/cmd/audit.rb', line 10

def self.help
  "verifies installability of Casks"
end

Instance Method Details

#audit(cask) ⇒ Object



23
24
25
26
27
28
29
# File 'brew/Library/Homebrew/cask/cmd/audit.rb', line 23

def audit(cask)
  odebug "Auditing Cask #{cask}"
  Auditor.audit(cask, audit_download:        download?,
                      audit_appcast:         appcast?,
                      check_token_conflicts: token_conflicts?,
                      quarantine:            quarantine?)
end

#runObject

Raises:



14
15
16
17
18
19
20
21
# File 'brew/Library/Homebrew/cask/cmd/audit.rb', line 14

def run
  failed_casks = casks(alternative: -> { Cask.to_a })
                 .reject { |cask| audit(cask) }

  return if failed_casks.empty?

  raise CaskError, "audit failed for casks: #{failed_casks.join(" ")}"
end