64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
# File 'lib/resources/apache_conf.rb', line 64
def read_content
@content = ''
@params = {}
read_file_content(conf_path)
to_read = [conf_path]
until to_read.empty?
raw_conf = read_file(to_read[0])
@content += raw_conf
params = SimpleConfig.new(
raw_conf,
assignment_regex: /^\s*(\S+)\s+['"]*((?=.*\s+$).*?|.*?)['"]*\s*$/,
multiple_values: true,
).params
params.values.map! do |value|
value.map! do |sub_value|
sub_value[/(?<=["|'])(?:\\.|[^"'\\])*(?=["|'])/] || sub_value
end
end
@params.merge!(params)
to_read = to_read.drop(1)
to_read += include_files(params).find_all do |fp|
not @files_contents.key? fp
end
end
@content = @content
@content
end
|