inspec/examples/profile/libraries/gordon_config.rb

18 lines
345 B
Ruby
Raw Normal View History

2015-12-14 13:23:41 +00:00
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