Sha256: 1e048b3162dc6bbf0fd45f8a2b6e46e59dd464bf3672c401c1ed0d79a6a889b8

Contents?: true

Size: 384 Bytes

Versions: 44

Compression:

Stored size: 384 Bytes

Contents

require_relative "../../json_compat"

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

        def send_report(report)
          FileUtils.mkdir_p(File.dirname(@path), mode: 0700)

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

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
chef-16.13.16-universal-mingw32 lib/chef/compliance/reporter/json_file.rb
chef-16.13.16 lib/chef/compliance/reporter/json_file.rb
chef-16.12.3-universal-mingw32 lib/chef/compliance/reporter/json_file.rb
chef-16.12.3 lib/chef/compliance/reporter/json_file.rb
chef-16.11.7-universal-mingw32 lib/chef/compliance/reporter/json_file.rb
chef-16.11.7 lib/chef/compliance/reporter/json_file.rb
chef-16.10.17-universal-mingw32 lib/chef/compliance/reporter/json_file.rb
chef-16.10.17 lib/chef/compliance/reporter/json_file.rb
chef-16.10.8-universal-mingw32 lib/chef/compliance/reporter/json_file.rb
chef-16.10.8 lib/chef/compliance/reporter/json_file.rb
chef-16.9.32-universal-mingw32 lib/chef/compliance/reporter/json_file.rb
chef-16.9.32 lib/chef/compliance/reporter/json_file.rb
chef-16.9.29-universal-mingw32 lib/chef/compliance/reporter/json_file.rb
chef-16.9.29 lib/chef/compliance/reporter/json_file.rb
chef-16.9.20-universal-mingw32 lib/chef/compliance/reporter/json_file.rb
chef-16.9.20 lib/chef/compliance/reporter/json_file.rb
chef-16.9.17-universal-mingw32 lib/chef/compliance/reporter/json_file.rb
chef-16.9.17 lib/chef/compliance/reporter/json_file.rb
chef-16.9.16-universal-mingw32 lib/chef/compliance/reporter/json_file.rb
chef-16.9.16 lib/chef/compliance/reporter/json_file.rb