configurates
DESCRIPTION
customizable_configuration is a lib that provides agile way to work with configuration, which can be useful for object initialization.
Travis CI
https://travis-ci.org/Medvedu/customizable_configuration
SAMPLES
SAMPLE 1. BASICS
conf = Settings::Config.create do
merge_storage Settings::Yaml.load('../configs/first.yml')
end
puts conf['string']
puts conf.string
puts conf.sample.dd.to_s
puts conf.sample
puts conf[42].root?
SAMPLE 2. Tricks
yaml = Settings::Config.create do
merge_storage Settings::Yaml.load('../configs/second.yml')
end
puts yaml.config
puts yaml.Config
file = Settings::Yaml.load('../configs/second.yml')
part1 = Settings::Config.create { merge_storage file, root: 'config' }
puts part1.param1
part2 = Settings::Config.create { merge_storage file, root: 'Config/param3' }
print part2.super_deep_array
SAMPLE 3. PROVIDERS
dynamic = Settings::Config.create do
merge_storage Settings::ENV.load( RbConfig::CONFIG )
end
puts dynamic["RUBY_VERSION_NAME"]
yaml = Settings::Config.create do
merge_storage Settings::Yaml.load('../configs/second.yml')
end
puts yaml[:config][:param1]
dependencies
Ruby 2.0.0 or higher
License
MIT, see LICENSE