Module: IniParse
- Defined in:
- lib/iniparse.rb,
lib/iniparse/lines.rb,
lib/iniparse/parser.rb,
lib/iniparse/document.rb,
lib/iniparse/generator.rb,
lib/iniparse/line_collection.rb
Defined Under Namespace
Modules: LineCollection, Lines Classes: Document, Generator, IniParseError, LineNotAllowed, NoSectionError, OptionCollection, ParseError, Parser, SectionCollection
Constant Summary collapse
- VERSION =
'1.3.3'
Class Method Summary collapse
-
.gen(&blk) ⇒ Object
Creates a new IniParse::Document using the specification you provide.
-
.open(path) ⇒ Object
Opens the file at
path
, reads and parses it’s contents. -
.parse(source) ⇒ Object
Parse given given INI document source
source
.
Class Method Details
.gen(&blk) ⇒ Object
Creates a new IniParse::Document using the specification you provide.
See IniParse::Generator.
Returns
IniParse::Document
63 64 65 |
# File 'lib/iniparse.rb', line 63 def gen(&blk) IniParse::Generator.new.gen(&blk) end |
.open(path) ⇒ Object
Opens the file at path
, reads and parses it’s contents.
Parameters
- path<String>
-
The path to the INI document.
Returns
IniParse::Document
50 51 52 53 54 |
# File 'lib/iniparse.rb', line 50 def open(path) document = IniParse::Parser.new(File.read(path)).parse document.path = path document end |