@api private
Parses puppet configuration files
# File lib/puppet/settings/config_file.rb, line 19 def parse_file(file, text) result = Conf.new ini = Puppet::Settings::IniFile.parse(StringIO.new(text)) unique_sections_in(ini, file).each do |section_name| section = Section.new(section_name.to_sym) result.with_section(section) ini.lines_in(section_name).each do |line| if line.is_a?(Puppet::Settings::IniFile::SettingLine) parse_setting(line, section) elsif line.text !~ /^\s*#|^\s*$/ raise Puppet::Settings::ParseError.new("Could not match line #{line.text}", file, line.line_number) end end end result end
@param value_converter [Proc] a function that will convert strings into ruby types
# File lib/puppet/settings/config_file.rb, line 15 def initialize(value_converter) @value_converter = value_converter end