mirror of
https://github.com/inspec/inspec
synced 2024-11-27 15:10:44 +00:00
35 lines
No EOL
601 B
Ruby
35 lines
No EOL
601 B
Ruby
# encoding: utf-8
|
|
# copyright: 2015, Vulcano Security GmbH
|
|
# license: All rights reserved
|
|
|
|
class PConfig < Vulcano::Resource
|
|
|
|
def initialize content
|
|
@runner = Specinfra::Runner
|
|
@content = content
|
|
@params = nil
|
|
read_content
|
|
end
|
|
|
|
def method_missing name
|
|
@params || read_content
|
|
@params[name.to_s]
|
|
end
|
|
|
|
def read_content
|
|
# parse the file
|
|
@params = SimpleConfig.new(@content,
|
|
multiple_values: false
|
|
).params
|
|
@content
|
|
end
|
|
end
|
|
|
|
module Serverspec
|
|
module Type
|
|
def parse_config(content)
|
|
p content
|
|
PConfig.new(content)
|
|
end
|
|
end
|
|
end |