Sha256: 5ec824a344096c41bfb6f5c6b3347d1be8f2c21cb05f49ec378e806c02725b97

Contents?: true

Size: 639 Bytes

Versions: 43

Compression:

Stored size: 639 Bytes

Contents

require_relative "../utils/run_data_filters"

module Inspec::Reporters
  class Base
    include Inspec::Utils::RunDataFilters

    attr_reader :run_data

    def initialize(config)
      @config = config
      @run_data = config[:run_data] || {}
      apply_run_data_filters_to_hash

      @output = ""
    end

    def output(str, newline = true)
      @output << str
      @output << "\n" if newline
    end

    def rendered_output
      @output
    end

    # each reporter must implement #render
    def render
      raise NotImplementedError, "#{self.class} must implement a `#render` method to format its output."
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
inspec-core-4.56.58 lib/inspec/reporters/base.rb
inspec-core-5.18.14 lib/inspec/reporters/base.rb
inspec-core-5.17.4 lib/inspec/reporters/base.rb
inspec-core-5.14.0 lib/inspec/reporters/base.rb
inspec-core-4.56.20 lib/inspec/reporters/base.rb
inspec-core-5.12.2 lib/inspec/reporters/base.rb
inspec-core-5.10.5 lib/inspec/reporters/base.rb
inspec-core-4.56.19 lib/inspec/reporters/base.rb
inspec-core-5.7.9 lib/inspec/reporters/base.rb
inspec-core-4.56.17 lib/inspec/reporters/base.rb
inspec-core-4.52.9 lib/inspec/reporters/base.rb
inspec-core-4.50.3 lib/inspec/reporters/base.rb
inspec-core-4.49.0 lib/inspec/reporters/base.rb
inspec-core-4.46.13 lib/inspec/reporters/base.rb
inspec-core-4.41.20 lib/inspec/reporters/base.rb
inspec-core-4.41.2 lib/inspec/reporters/base.rb
inspec-core-4.38.9 lib/inspec/reporters/base.rb
inspec-core-4.38.3 lib/inspec/reporters/base.rb
inspec-core-4.37.30 lib/inspec/reporters/base.rb
inspec-core-4.37.25 lib/inspec/reporters/base.rb