Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/woodruffw/ruby-inih
A Ruby wrapper for inih (a simple C INI parser)
https://github.com/woodruffw/ruby-inih
c configuration ini inih iniparser ruby
Last synced: 22 days ago
JSON representation
A Ruby wrapper for inih (a simple C INI parser)
- Host: GitHub
- URL: https://github.com/woodruffw/ruby-inih
- Owner: woodruffw
- License: other
- Created: 2017-07-21T03:19:07.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-04-29T22:34:29.000Z (over 3 years ago)
- Last Synced: 2024-04-26T17:22:24.831Z (7 months ago)
- Topics: c, configuration, ini, inih, iniparser, ruby
- Language: C
- Homepage: https://rubygems.org/gems/inih
- Size: 39.1 KB
- Stars: 6
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- data-science-with-ruby - inih
README
ruby-inih
=========![license](https://raster.shields.io/badge/license-MIT%20with%20restrictions-green.png)
[![Gem Version](https://badge.fury.io/rb/inih.svg)](https://badge.fury.io/rb/inih)
[![Build Status](https://img.shields.io/github/workflow/status/woodruffw/ruby-inih/CI/master)](https://github.com/woodruffw/ruby-inih/actions?query=workflow%3ACI)A Ruby wrapper for [inih](https://github.com/benhoyt/inih), a simple INI parser.
### Installation
```bash
$ gem install inih
```### Example
Given the following INI data:
```ini
; example.ini
[example]
foo=bar
baz = quux
integer = 10
float = 3.14
bool = true
``````ruby
# 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](ext/inih/LICENSE) file.
ruby-inih is licensed under the MIT License.
For the exact terms, see the [LICENSE](./LICENSE) file.