ribbon-config
A general purpose configuration utility to simplify and standardize configuration of ruby libraries.
Installation
Add this to your Gemfile:
gem 'ribbon-config'
Then run
bundle
Or you can install it manually:
gem install ribbon-config
Basic Usage
config = Ribbon::Config.new {
##
# Key-Values.
# Must be namespaced.
namespace.key = 'value'
another_namespace.some_config_value = 'can be any object, including nil'
##
# Arrays
an_array 1
an_array 2
an_array 3
proc_array { 'one' }
proc_array { :two }
proc_array { 3 }
proc_array { |a| a }
}
config.namespace.key # => 'value'
config.another_namespace.some_config_value # => 'can be any object, including nil'
config.an_array # => [1, 2, 3]
config.proc_array.call('4') # => ['one', :two, 3, '4']