autoload :JSON, "json"

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

        def send_report(report)
          File.write(@path, JSON.generate(report))
        end
      end
    end
  end
end

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

Use infra-client json lib in JsonFile reporter.
Use infra-client json lib in JsonFile reporter.

Signed-off-by: Pete Higgins <e3b6cda228242c30b711ac17cb264f1dbadfd0b6@peterhiggins.org>
