lib/inspec/profile.rb in inspec-1.45.9 vs lib/inspec/profile.rb in inspec-1.45.13

- old
+ new

@@ -104,11 +104,11 @@ # This is necessary since we store the RuntimeProfile on the backend object. If a user runs `inspec exec` # with multiple profiles, only the RuntimeProfile for the last-loaded profile will be available if # we share the backend between profiles. # # This will cause issues if a profile attempts to load a file via `inspec.profile.file` - train_options = options.select { |k, _| k != 'target' } # See https://github.com/chef/inspec/pull/1646 + train_options = options.reject { |k, _| k == 'target' } # See https://github.com/chef/inspec/pull/1646 @backend = options[:backend].nil? ? Inspec::Backend.create(train_options) : options[:backend].dup @runtime_profile = RuntimeProfile.new(self) @backend.profile = @runtime_profile @runner_context = @@ -419,10 +419,10 @@ files = source_reader.tests.to_a + source_reader.libraries.to_a + source_reader.data_files.to_a + [['inspec.yml', source_reader.metadata.content]] + [['inspec.lock.deps', YAML.dump(deps)]] - files.sort { |a, b| a[0] <=> b[0] } + files.sort_by { |a| a[0] } .map { |f| res << f[0] << "\0" << f[1] << "\0" } res.digest.unpack('H*')[0] end