Class: TestProf::Autopilot::Merger
- Inherits:
-
Object
- Object
- TestProf::Autopilot::Merger
- Includes:
- Dsl
- Defined in:
- lib/test_prof/autopilot/merger.rb
Instance Attribute Summary collapse
-
#paths ⇒ Object
readonly
Returns the value of attribute paths.
-
#report_class ⇒ Object
readonly
Returns the value of attribute report_class.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(type, paths) ⇒ Merger
constructor
A new instance of Merger.
- #print_report ⇒ Object
Methods included from Dsl
#aggregate, #info, #run, #save
Constructor Details
#initialize(type, paths) ⇒ Merger
Returns a new instance of Merger.
26 27 28 29 30 |
# File 'lib/test_prof/autopilot/merger.rb', line 26 def initialize(type, paths) @type = type @paths = paths @report_class = Registry.fetch(:"#{type}_report") end |
Instance Attribute Details
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
24 25 26 |
# File 'lib/test_prof/autopilot/merger.rb', line 24 def paths @paths end |
#report_class ⇒ Object (readonly)
Returns the value of attribute report_class.
24 25 26 |
# File 'lib/test_prof/autopilot/merger.rb', line 24 def report_class @report_class end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
24 25 26 |
# File 'lib/test_prof/autopilot/merger.rb', line 24 def type @type end |
Class Method Details
.invoke(type, paths) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/test_prof/autopilot/merger.rb', line 15 def invoke(type, paths) paths = paths.flat_map(&Dir.method(:glob)).sort! Logging.log "Merging #{type} reports at #{paths.join(", ")}..." new(type, paths).print_report end |
Instance Method Details
#print_report ⇒ Object
32 33 34 35 36 37 38 39 |
# File 'lib/test_prof/autopilot/merger.rb', line 32 def print_report format = Autopilot.config.merge_format if format == "info" info agg_report else save agg_report, format: format, file_name: Autopilot.config.merge_file end end |