mirror of
https://github.com/inspec/inspec
synced 2024-12-19 09:33:20 +00:00
18 lines
345 B
Ruby
18 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
|