35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
# File 'lib/resources/inetd_conf.rb', line 35
def read_params
return @params if defined?(@params)
file = inspec.file(@conf_path)
if !file.file?
skip_resource "Can't find file \"#{@conf_path}\""
return @params = {}
end
content = file.content
if content.empty? && !file.empty?
skip_resource "Can't read file \"#{@conf_path}\""
return @params = {}
end
conf = SimpleConfig.new(
content,
assignment_regex: /^\s*(\S+?)\s+(.*?)\s+(.*?)\s+(.*?)\s+(.*?)\s+(.*?)\s+(.*?)\s*$/,
key_values: 6,
multiple_values: false,
)
@params = conf.params
end
|