mirror of
https://github.com/inspec/inspec
synced 2024-11-27 15:10:44 +00:00
Clean up Inspec::Profile initialize to make it clear what options we use
This commit is contained in:
parent
e44a3802dd
commit
f431794917
1 changed files with 10 additions and 10 deletions
|
@ -46,18 +46,18 @@ module Inspec
|
||||||
|
|
||||||
# rubocop:disable Metrics/AbcSize
|
# rubocop:disable Metrics/AbcSize
|
||||||
def initialize(source_reader, options = {})
|
def initialize(source_reader, options = {})
|
||||||
@options = options
|
@target = options.delete(:target)
|
||||||
@target = @options.delete(:target)
|
@logger = options[:logger] || Logger.new(nil)
|
||||||
@logger = @options[:logger] || Logger.new(nil)
|
@locked_dependencies = options[:dependencies]
|
||||||
@source_reader = source_reader
|
|
||||||
if options[:dependencies]
|
|
||||||
@locked_dependencies = options[:dependencies]
|
|
||||||
end
|
|
||||||
@controls = options[:controls] || []
|
@controls = options[:controls] || []
|
||||||
@profile_id = @options[:id]
|
@profile_id = options[:id]
|
||||||
@backend = @options[:backend] || Inspec::Backend.create(options)
|
@backend = options[:backend] || Inspec::Backend.create(options)
|
||||||
|
@source_reader = source_reader
|
||||||
|
@tests_collected = false
|
||||||
Metadata.finalize(@source_reader.metadata, @profile_id)
|
Metadata.finalize(@source_reader.metadata, @profile_id)
|
||||||
@runner_context = @options[:profile_context] || Inspec::ProfileContext.for_profile(self, @backend, @options[:attributes])
|
@runner_context = options[:profile_context] || Inspec::ProfileContext.for_profile(self,
|
||||||
|
@backend,
|
||||||
|
options[:attributes])
|
||||||
end
|
end
|
||||||
|
|
||||||
def name
|
def name
|
||||||
|
|
Loading…
Reference in a new issue