Armoire
A simple configuration tool for your ruby application settings
Installation
Add this line to your application's Gemfile:
gem 'armoire'
And then execute:
$ bundle
Or install it yourself as:
$ gem install armoire
Usage
Armoire should be simple. Simply create a yaml file in config/application.yml
with the following:
development:
foo: "bar"
baz: 42
nested_options:
nested_foo: "nested_bar"
nested_baz: 99.999
boolean_value: true
parsed_things: <% "something_in_erb" %>
test:
foo: "bar"
baz: 42
nested_options:
nested_foo: "nested bar"
nested_baz: 99.999
boolean_value: true
parsed_things: <% "something_in_erb" %>
Simply call Armoire["foo"]
to get "bar"
or Armoire["nested_options"]["nested_foo"]
to get "nested_bar"
. Any ERB will be parsed when the config file is loaded. If a configuration option is missing, it will throw an Armoire::ConfigSettingMissing
exception.
The configuration environment will initially be taken from ENV['RAILS_ENV']
, then ENV['RACK_ENV']
and if neither exist then it will fall back to development
Contributing
- Fork it
- 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