Class: Cask::Auditor

Inherits:
Object
  • Object
show all
Extended by:
Predicable
Includes:
Checkable
Defined in:
brew/Library/Homebrew/cask/auditor.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Predicable

attr_predicate

Methods included from Checkable

#add_error, #add_warning, #errors, #errors?, #result, #summary, #warnings, #warnings?

Constructor Details

#initialize(cask, audit_download: false, audit_appcast: false, check_token_conflicts: false, quarantine: true, commit_range: nil) ⇒ Auditor

Returns a new instance of Auditor



20
21
22
23
24
25
26
27
28
# File 'brew/Library/Homebrew/cask/auditor.rb', line 20

def initialize(cask, audit_download: false, audit_appcast: false,
               check_token_conflicts: false, quarantine: true, commit_range: nil)
  @cask = cask
  @audit_download = audit_download
  @audit_appcast = audit_appcast
  @quarantine = quarantine
  @commit_range = commit_range
  @check_token_conflicts = check_token_conflicts
end

Instance Attribute Details

#caskObject (readonly)

Returns the value of attribute cask



18
19
20
# File 'brew/Library/Homebrew/cask/auditor.rb', line 18

def cask
  @cask
end

#commit_rangeObject (readonly)

Returns the value of attribute commit_range



18
19
20
# File 'brew/Library/Homebrew/cask/auditor.rb', line 18

def commit_range
  @commit_range
end

Class Method Details

.audit(cask, audit_download: false, audit_appcast: false, check_token_conflicts: false, quarantine: true, commit_range: nil) ⇒ Object



10
11
12
13
14
15
16
# File 'brew/Library/Homebrew/cask/auditor.rb', line 10

def self.audit(cask, audit_download: false, audit_appcast: false,
               check_token_conflicts: false, quarantine: true, commit_range: nil)
  new(cask, audit_download: audit_download,
            audit_appcast: audit_appcast,
            check_token_conflicts: check_token_conflicts,
            quarantine: quarantine, commit_range: commit_range).audit
end

Instance Method Details

#auditObject



40
41
42
43
44
45
46
# File 'brew/Library/Homebrew/cask/auditor.rb', line 40

def audit
  if !ARGV.value("language") && language_blocks
    audit_all_languages
  else
    audit_cask_instance(cask)
  end
end

#audit_download?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'brew/Library/Homebrew/cask/auditor.rb', line 30

def audit_download?
  @audit_download
end

#check_token_conflicts?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'brew/Library/Homebrew/cask/auditor.rb', line 36

def check_token_conflicts?
  @check_token_conflicts
end