From f431794917fc5d2c5aac167992441a1f3bc18df2 Mon Sep 17 00:00:00 2001 From: Steven Danna Date: Wed, 7 Sep 2016 11:38:37 +0100 Subject: [PATCH] Clean up Inspec::Profile initialize to make it clear what options we use --- lib/inspec/profile.rb | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/inspec/profile.rb b/lib/inspec/profile.rb index a0741b2a6..8703c441a 100644 --- a/lib/inspec/profile.rb +++ b/lib/inspec/profile.rb @@ -46,18 +46,18 @@ module Inspec # rubocop:disable Metrics/AbcSize def initialize(source_reader, options = {}) - @options = options - @target = @options.delete(:target) - @logger = @options[:logger] || Logger.new(nil) - @source_reader = source_reader - if options[:dependencies] - @locked_dependencies = options[:dependencies] - end + @target = options.delete(:target) + @logger = options[:logger] || Logger.new(nil) + @locked_dependencies = options[:dependencies] @controls = options[:controls] || [] - @profile_id = @options[:id] - @backend = @options[:backend] || Inspec::Backend.create(options) + @profile_id = options[:id] + @backend = options[:backend] || Inspec::Backend.create(options) + @source_reader = source_reader + @tests_collected = false 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 def name