Class: Danger::DangerReporter
- Inherits:
-
Xcprofiler::AbstractReporter
- Object
- Xcprofiler::AbstractReporter
- Danger::DangerReporter
- Defined in:
- lib/xcprofiler/danger_reporter.rb
Instance Method Summary collapse
-
#initialize(dangerfile, thresholds, inline_mode, working_dir) ⇒ DangerReporter
constructor
A new instance of DangerReporter.
- #report!(executions) ⇒ Object
Constructor Details
#initialize(dangerfile, thresholds, inline_mode, working_dir) ⇒ DangerReporter
Returns a new instance of DangerReporter.
6 7 8 9 10 11 12 |
# File 'lib/xcprofiler/danger_reporter.rb', line 6 def initialize(dangerfile, thresholds, inline_mode, working_dir) super({}) @dangerfile = dangerfile @thresholds = thresholds @inline_mode = inline_mode @working_dir = working_dir end |
Instance Method Details
#report!(executions) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/xcprofiler/danger_reporter.rb', line 14 def report!(executions) executions.each do |execution| = {} if @inline_mode [:file] = relative_path(execution.path) [:line] = execution.line end = "`#{execution.method_name}` takes #{execution.time} ms to build" if execution.time >= @thresholds[:fail] @dangerfile.fail(, ) elsif execution.time >= @thresholds[:warn] @dangerfile.warn(, ) end end end |