Class: PigCI::Summary::CI

Inherits:
PigCI::Summary show all
Defined in:
lib/pig_ci/summary/ci.rb

Instance Method Summary collapse

Constructor Details

#initialize(reports:) ⇒ CI

Returns a new instance of CI.



4
5
6
7
# File 'lib/pig_ci/summary/ci.rb', line 4

def initialize(reports:)
  @reports = reports
  @timestamp = PigCI.run_timestamp
end

Instance Method Details

#call!Object



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/pig_ci/summary/ci.rb', line 9

def call!
  puts ""
  puts I18n.t("pig_ci.summary.ci_start")

  over_threshold = false
  @reports.each do |report|
    print_report(report)
    over_threshold = true if report.over_threshold_for?(@timestamp)
  end

  fail_with_error! if over_threshold
  puts ""
end