summaryrefslogtreecommitdiff
path: root/lib/chef/audit/reporter/json_file.rb
blob: 7eccea216a1e288faf02c0b26206d9ab6e1a3578 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require_relative "../../json_compat"

class Chef
  module Audit
    module Reporter
      class JsonFile
        def initialize(opts)
          @path = opts.fetch(:file)
        end

        def send_report(report)
          File.write(@path, Chef::JSONCompat.to_json(report))
        end
      end
    end
  end
end