Class: Inspec::Reporters::JsonAutomate
  
  
  
  
  
    - Inherits:
- 
      Json
      
        
          - Object
- Base
- Json
- Inspec::Reporters::JsonAutomate
 show all
    - Defined in:
- lib/inspec/reporters/json_automate.rb
 
  Instance Attribute Summary
  
  Attributes inherited from Base
  #run_data
  
    
      Instance Method Summary
      collapse
    
    
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  Methods inherited from Base
  #output, #rendered_output
  Constructor Details
  
    
  
  
    
Returns a new instance of JsonAutomate.
   
 
  
  
    | 
7
8
9
10 | # File 'lib/inspec/reporters/json_automate.rb', line 7
def initialize(config)
  super(config)
  @profiles = []
end | 
 
  
 
  
    Instance Method Details
    
      
  
  
    #render  ⇒ Object 
  
  
  
  
    | 
12
13
14 | # File 'lib/inspec/reporters/json_automate.rb', line 12
def render
  output(report.to_json, false)
end | 
 
    
      
  
  
    #report  ⇒ Object 
  
  
  
  
    | 
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 | # File 'lib/inspec/reporters/json_automate.rb', line 16
def report
    @profiles = profiles
  output = {
    platform: platform,
    profiles: merge_profiles,
    statistics: {
      duration: run_data[:statistics][:duration],
    },
    version: run_data[:version],
  }
    %w{node_name environment roles job_uuid passthrough}.each do |option|
    output[option.to_sym] = @config[option] unless @config[option].nil?
  end
  output
end |