Class: Chef::Compliance::Reporter::Cli

Inherits:
Object
  • Object
show all
Defined in:
lib/chef/compliance/reporter/cli.rb

Instance Method Summary collapse

Instance Method Details

#send_report(report) ⇒ Object


5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/chef/compliance/reporter/cli.rb', line 5

def send_report(report)
  # iterate over each profile and control
  output = ["\nCompliance report:"]
  report[:profiles].each do |profile|
    next if profile[:controls].nil?

    output << " * #{profile[:title]}"
    profile[:controls].each do |control|
      next if control[:results].nil?

      output << "#{" " * 6}#{control[:title]}"
      control[:results].each do |result|
        output << format_result(result)
      end
    end
  end
  output << "\n"
  puts output.join("\n")
end

#validate_config!Object


25
26
27
# File 'lib/chef/compliance/reporter/cli.rb', line 25

def validate_config!
  true
end