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.18.30-universal-mingw32 lib/chef/compliance/reporter/json_file.rb
chef-16.18.30 lib/chef/compliance/reporter/json_file.rb
chef-16.18.0-universal-mingw32 lib/chef/compliance/reporter/json_file.rb
chef-16.18.0 lib/chef/compliance/reporter/json_file.rb
chef-16.17.51-universal-mingw32 lib/chef/compliance/reporter/json_file.rb
chef-16.17.51 lib/chef/compliance/reporter/json_file.rb
chef-16.17.39-universal-mingw32 lib/chef/compliance/reporter/json_file.rb
chef-16.17.39 lib/chef/compliance/reporter/json_file.rb
chef-16.17.18-universal-mingw32 lib/chef/compliance/reporter/json_file.rb
chef-16.17.18 lib/chef/compliance/reporter/json_file.rb
chef-16.17.4-universal-mingw32 lib/chef/compliance/reporter/json_file.rb
chef-16.17.4 lib/chef/compliance/reporter/json_file.rb
chef-16.16.13-universal-mingw32 lib/chef/compliance/reporter/json_file.rb
chef-16.16.13 lib/chef/compliance/reporter/json_file.rb
chef-16.16.7-universal-mingw32 lib/chef/compliance/reporter/json_file.rb
chef-16.16.7 lib/chef/compliance/reporter/json_file.rb
chef-16.15.22-universal-mingw32 lib/chef/compliance/reporter/json_file.rb
chef-16.15.22 lib/chef/compliance/reporter/json_file.rb
chef-16.14.1-universal-mingw32 lib/chef/compliance/reporter/json_file.rb
chef-16.14.1 lib/chef/compliance/reporter/json_file.rb