Files | Admin

Notes:

Release Name: 0.5

Notes:
Latest update adds a few new features, including the ability to do [grouping].  For example, reading a MySQL config file:

# -----------------------------------
#!/usr/bin/ruby

require('rubygems')
require('parseconfig')

c = ParseConfig.new('./my.cnf')
puts
puts "Available config groups: #{c.groups}"
puts
puts "config['client']['user'] => #{c.params['client']['user']}"
puts "config['client']['password'] => #{c.params['client']['password']}"
puts

# -----------------------------------

Available config groups: client

config['client']['user'] => johnny
config['client']['password'] => 3uS1F1eufy75


Changes: Mon Aug 31, 2009 - v0.5 - Added sub-groups feature per RubyForge tracker [#27019]. Config files can now have [subgroups] whose values are added to a nested Hash object. - Added the write() function per RubyForge tracker [#27019]. Will print to STDOUT by default, or to a file object if passed. - Added the add(), and add_to_group() functions to support new features per RubyForge tracker [#27019]. - Thank you to Titouan Christophe for the submissions listed above! - ParseConfig.get_params() returns all params including groups. ParseConfig.get_groups() returns available sub-groups. - See the demo.rb and demo.conf files which have been updated to reflect this update. - The methods override_value() and nil_value() are now deprecated and will be removed in future versions.