implement method missing for apache_conf resource

This commit is contained in:
Christoph Hartmann 2016-02-01 17:17:26 +01:00 committed by Dominik Richter
parent 69dca97c6d
commit a3eda1fcee

View file

@ -40,6 +40,18 @@ class ApacheConf < Inspec.resource(1)
res
end
def method_missing(name)
# ensure params are loaded
@params || read_content
# extract values
param = @params[name.to_s]
return nil if param.nil?
# extract first value if we have only one value in array
return param[0] if param.length == 1
param
end
def filter_comments(data)
content = ''
data.each_line do |line|