module IniParse

Constants

VERSION

Public Instance Methods

gen(&blk) click to toggle source

Creates a new IniParse::Document using the specification you provide.

See IniParse::Generator.

Returns

IniParse::Document

# File lib/iniparse.rb, line 63
def gen(&blk)
  IniParse::Generator.new.gen(&blk)
end
open(path) click to toggle source

Opens the file at path, reads and parses it's contents.

Parameters

path<String>

The path to the INI document.

Returns

IniParse::Document

# File lib/iniparse.rb, line 50
def open(path)
  document = parse(File.read(path))
  document.path = path
  document
end
parse(source) click to toggle source

Parse given given INI document source source.

See IniParse::Parser.parse

Parameters

source<String>

The source from the INI document.

Returns

IniParse::Document

# File lib/iniparse.rb, line 38
def parse(source)
  IniParse::Parser.new(source.gsub(/(?<!\\)\\\n/, '')).parse
end