This gem provides an abstraction layer over key value stores such as YAML or Redis. The original application is as an application configuration store to migrate from local YAML files to a centralized Redis configuration store.
Add this line to your application's Gemfile:
gem 'greenbrick'
And then execute:
$ bundle
Or install it yourself as:
$ gem install greenbrick
# store as an in-memory hash
app_config = Greenbrick::Config.new Greenbrick::Storage::Null.new
app_config['s3_bucket'] = 'bucket_name' # => 'bucket_name'
app_config['s3_bucket'] # => 'bucket_name'
app_config.each do |k,v|
puts "#{k}: #{v}"
end
# "s3_bucket: bucket_name"
app_config = Greenbrick::Config.new Greenbrick::Storage::Yaml.new( 'config/config.yml' )
app_config = Greenbrick::Config.new( Greenbrick::Storage::Redis.new( 'key' , { host: 'localhost' , port: 123456 } ) )
- Fork it ( http://github.com//greenbrick/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request