Method: Inspec::Profile#initialize

Defined in:
lib/inspec/profile.rb

#initialize(source_reader, options = {}) ⇒ Profile

rubocop:disable Metrics/AbcSize



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/inspec/profile.rb', line 84

def initialize(source_reader, options = {})
  @target = options.delete(:target)
  @logger = options[:logger] || Logger.new(nil)
  @locked_dependencies = options[:dependencies]
  @controls = options[:controls] || []
  @writable = options[:writable] || false
  @profile_id = options[:id]
  @cache = options[:cache] || Cache.new
  @backend = options[:backend] || Inspec::Backend.create(options)
  @attr_values = options[:attributes]
  @source_reader = source_reader
  @tests_collected = false
  @libraries_loaded = false
  Metadata.finalize(@source_reader., @profile_id)
  @runner_context =
    options[:profile_context] ||
    Inspec::ProfileContext.for_profile(self, @backend, @attr_values)
end