Project

inih

0.0
No commit activity in last 3 years
No release in over 3 years
A native library for parsing INI files.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

ruby-inih

license Gem Version Build Status

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.