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, err: $stderr) ⇒ Gate

Returns a new instance of Gate.



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

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

Instance Method Details

#checkObject



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

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