Up to [cvs.NetBSD.org] / pkgsrc / devel / ruby-iniparse
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
devel/ruby-iniparse: add USE_LANGUAGES Add "USE_LANGUAGES= # none".
devel/ruby-iniparse: update to 1.5.0
Update ruby-iniparse to 1.5.0.
### 1.5.0
* OptionCollection no longer yields duplicate keys as an array, but instead yields each key in turn.
For example, given an INI file:
[test]
a = 1
a = 2
b = 3
IniParse would previously yield a single "a" key: an array containing two `Line`s:
doc['test'].map { |line| line }
# => [[<a = 1>, <a = 2>], <b = 3>]
Instead, each key/value pair will be yielded in turn:
doc['test'].map { |line| line }
# => [<a = 1>, <a = 2>, <b = 3>]
Directly accessing values via `[]` will still return an array of values as before:
doc['test']['a']
# => [1, 2]
* LineCollection#each may be called without a block, returning an Enumerator.
doc = IniParse.parse(<<~EOF)
[test]
a = x
b = y
EOF
doc[test].each
# => #<Enumerator: ...>
This allows for chaining as in the standard library:
doc['test'].map.with_index { |a, i| { index: i, value: a.value } }
# => [{ index: 0, value: 'x' }, { index: 1, value: 'y' }]
Update ruby-iniparse to 1.4.4. 1.4.4 2017/07/04 * Fix handling files with DOS line endings * Improve error message with unparseable lines
Add ruby-iniparse package version 1.4.3. IniParse is a pure Ruby library for parsing INI[http://en.wikipedia.org/wiki/INI_file] configuration and data files. === Main features * Support for duplicate options. While not common, some INI files contain an option more than once. IniParse does not overwrite previous options, but allows you to access all of the duplicate values. * Preservation of white space and blank lines. When writing back to your INI file, line indents, white space and comments (and their indents) are preserved. Only trailing white space (which has no significance in INI files) will be removed. * Preservation of section and option ordering. Sections and options are kept in the same order they are in the original document ensuring that nothing gets mangled when writing back to the file.