Awesome
ruby-inih
A Ruby wrapper for inih, a simple INI parser.
Installation
$ gem install inih
Example
Given the following INI data:
; example.ini
[example]
foo=bar
baz = quux
integer = 10
float = 3.14
bool = true
# load directly from a file
INIH.load "example.ini"
# => {"example"=>{"foo"=>"bar", "baz"=>"quux", "integer"=>10, "float"=>3.14, "bool"=>true}}
# parse from a string
INIH.parse "[section]\nkey=value"
#=> {"section"=>{"key"=>"value"}}
Integers, floating-point numbers, and booleans are coerced into their respective Ruby types by
default, unless normalize: false
is passed to either method.
TODO
- Coerce scientific notation?
License
inih itself is licensed under the BSD License.
For the exact terms, see the LICENSE file.
ruby-inih is licensed under the MIT License.
For the exact terms, see the LICENSE file.