README.md in config-1.3.0 vs README.md in config-1.4.0

- old
+ new

@@ -62,10 +62,19 @@ ```ruby set :root, File.dirname(__FILE__) register Config ``` +### Installing on other ruby projects + +Add the gem to your `Gemfile` and run `bundle install` to install it. +Then initialize `Config` manually within your configure block. + +```ruby +Config.load_and_set_settings(Config.setting_files("/path/to/config_root", "your_project_environment")) +``` + It's also possible to initialize `Config` manually within your configure block if you want to just give it some yml paths to load from. ```ruby Config.load_and_set_settings("/path/to/yaml1", "/path/to/yaml2", ...) @@ -181,9 +190,18 @@ Settings.reload! ``` > Note: this is an example usage, it is easier to just use the default local files `settings.local.yml, settings/#{Rails.env}.local.yml and environments/#{Rails.env}.local.yml` for your developer specific settings. + +You also have the option to add a raw hash as a source. One use case might be storing settings in the database or in environment variables that overwrite what is in the YML files. + +```ruby +Settings.add_source!({some_secret: ENV['some_secret']}) +Settings.reload! +``` + +You may pass a hash to `prepend_source!` as well. ## Embedded Ruby (ERB) Embedded Ruby is allowed in the configuration files. Consider the two following config files.