Class: Inspec::Reporters::JsonMerged

Inherits:
Json
  • Object
show all
Defined in:
lib/inspec/reporters/json_merged.rb

Direct Known Subclasses

Automate

Instance Attribute Summary

Attributes inherited from Base

#run_data

Instance Method Summary collapse

Methods inherited from Json

#report

Methods inherited from Base

#output, #rendered_output

Constructor Details

#initialize(config) ⇒ JsonMerged

Returns a new instance of JsonMerged.



7
8
9
10
# File 'lib/inspec/reporters/json_merged.rb', line 7

def initialize(config)
  super(config)
  @profiles = []
end

Instance Method Details

#renderObject



12
13
14
# File 'lib/inspec/reporters/json_merged.rb', line 12

def render
  output(report_merged.to_json, false)
end

#report_mergedObject



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/inspec/reporters/json_merged.rb', line 16

def report_merged
  # grab profiles from the json parent class
  @profiles = report[:profiles]

  {
    platform: platform,
    profiles: merge_profiles,
    statistics: {
      duration: run_data[:statistics][:duration],
    },
    version: run_data[:version],
  }
end