Class: Hashira::CI::Gate
- Inherits:
-
Object
- Object
- Hashira::CI::Gate
- Defined in:
- lib/hashira/ci/gate.rb
Instance Method Summary collapse
- #check ⇒ Object
-
#initialize(findings, kinds, io: $stdout) ⇒ Gate
constructor
A new instance of Gate.
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
#check ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/hashira/ci/gate.rb', line 12 def check offending = @findings.all.select { @kinds.include?(_1.kind) } return report_clean if offending.empty? offending.each { Report::FindingLines.new(_1, io: @io).print } @io.puts "\nGate FAILED: #{offending.size} finding(s) of kind #{@kinds.join(", ")}." 1 end |