Class: Xctracker::JSONReporter

Inherits:
AbstractReporter show all
Defined in:
lib/xctracker/reporters/json_reporter.rb

Instance Attribute Summary

Attributes inherited from AbstractReporter

#options

Instance Method Summary collapse

Methods inherited from AbstractReporter

#initialize

Constructor Details

This class inherits a constructor from Xctracker::AbstractReporter

Instance Method Details

#report!(executions) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/xctracker/reporters/json_reporter.rb', line 5

def report!(executions)
  json = filter_executions(executions).map(&:to_h)
  unless output_path
    raise OutputPathIsNotSpecified, '[JSONReporter] output_path is not specified'
  end

  File.open(output_path, "w") do |f|
    f.write(JSON.pretty_generate(json))
  end
end