inspec/examples/profile/libraries/gordon_config.rb
2015-12-28 12:53:42 +01:00

17 lines
345 B
Ruby

require 'yaml'
class GordonConfig < Inspec.resource(1)
name 'gordon_config'
def initialize
@path = '/etc/gordon/config.yaml'
@file = inspec.file(@path)
return skip_resource "Can't find file \"#{@path}\"" if !@file.file?
@params = YAML.load(@file.content)
end
def method_missing(name)
@params[name.to_s]
end
end