Creates a new IniParse::Document using the specification you provide.
See IniParse::Generator.
# File lib/iniparse.rb, line 63 def gen(&blk) IniParse::Generator.new.gen(&blk) end
Opens the file at path, reads and parses it’s contents.
The path to the INI document.
# File lib/iniparse.rb, line 50 def open(path) document = parse(File.read(path)) document.path = path document end
Parse given given INI document source source.
The source from the INI document.
# File lib/iniparse.rb, line 38 def parse(source) IniParse::Parser.new(source.gsub(/(?<!\)\\n/, '')).parse end