Method: Secrets::YAML#initialize

Defined in:
lib/inspec/secrets/yaml.rb

#initialize(target) ⇒ YAML

array of yaml file paths



18
19
20
21
22
23
24
25
26
27
# File 'lib/inspec/secrets/yaml.rb', line 18

def initialize(target)
  @inputs = ::YAML.load_file(target)

  if @inputs == false || !@inputs.is_a?(Hash)
    Inspec::Log.warn("#{self.class} unable to parse #{target}: invalid YAML or contents is not a Hash")
    @inputs = nil
  end
rescue => e
  raise "Error reading InSpec inputs: #{e}"
end