A Ruby wrapper for inih, a simple INI parser.
$ gem install inih
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.
- Coerce scientific notation?
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.