mirror of
https://github.com/inspec/inspec
synced 2024-11-14 17:07:09 +00:00
implement method missing for apache_conf resource
This commit is contained in:
parent
69dca97c6d
commit
a3eda1fcee
1 changed files with 12 additions and 0 deletions
|
@ -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|
|
||||
|
|
Loading…
Reference in a new issue