Class: Hashira::CI::Gate

Inherits:
Object
  • Object
show all
Defined in:
lib/hashira/ci/gate.rb

Instance Method Summary collapse

Constructor Details

#initialize(findings, kinds, io: $stdout) ⇒ Gate

Returns a new instance of Gate.



6
7
8
9
10
# File 'lib/hashira/ci/gate.rb', line 6

def initialize(findings, kinds, io: $stdout)
  @findings = findings
  @kinds = kinds
  @io = io
end

Instance Method Details

#checkObject



12
13
14
15
# File 'lib/hashira/ci/gate.rb', line 12

def check
  offending = @findings.all.select { @kinds.include?(it.kind) }
  offending.empty? ? report_clean : report_failure(offending)
end