Class: Inspec::Resources::PostfixConf
Instance Attribute Summary
Attributes inherited from JsonConfig
#params, #raw_content
Instance Method Summary
collapse
Methods inherited from JsonConfig
#method_missing, #value
Methods included from FileReader
#read_file_content
#extract_value
Constructor Details
Allow user to specify a custom configuration path, use default Postfix configuration path if no custom path is provided
11
12
13
14
15
16
17
18
19
|
# File 'lib/inspec/resources/postfix_conf.rb', line 11
def initialize(*opts)
@params = {}
if opts.length == 1
@raw_content = load_raw_content(opts[0])
else
@raw_content = load_raw_content("/etc/postfix/main.cf")
end
@params = parse(@raw_content)
end
|
Instance Method Details
#parse(content) ⇒ Object
21
22
23
|
# File 'lib/inspec/resources/postfix_conf.rb', line 21
def parse(content)
SimpleConfig.new(content).params
end
|
#resource_id ⇒ Object
25
26
27
|
# File 'lib/inspec/resources/postfix_conf.rb', line 25
def resource_id
"Postfix Conf"
end
|
#to_s ⇒ Object
29
30
31
|
# File 'lib/inspec/resources/postfix_conf.rb', line 29
def to_s
"Postfix Mail Transfer Agent"
end
|