This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
IniFile /
| name | age | message | |
|---|---|---|---|
| |
LICENSE | ||
| |
README.markdown | ||
| |
lib/ | ||
| |
test/ |
README.markdown
IniFile
IniFile is a class for reading and writing .ini files with various options on how to read/write them.
Features:
- different name/value delimiters (default is '=')
- support for number sign comments (default is ';')
- handlers for duplicate names (overwrite, concat and to_array)
- different section delimiters (default is '.') for hierarchy
- customizable intendation string (default: ' ')
Behaviour:
- blank lines are ignored
- whitespaces are ignored
- comments are ignored
- single and double quotes around values are deleted
- duplicate names by default raises an IndexError
If you want to preserve the format of your .ini file try Anthony Williams's iniparse.
Reading
config = IniFile.open(path) # or
app = IniFile.open(path) { |config| App.new config }
Writing
File.open(path, 'w') { |file| IniFile.dump config, file }
See rdoc for options on open and dump.
TODO
See IniFile::TODO.








