Build Status Code Climate

Conflate

Load YAML files in your config directory into the Rails.application.config.

If you're using Rails, you probably want to use conflate-rails, which automatically loads YAML files from config/ into Rails.application.config.

Usage

Let's suppose you have a file 'config/statsd.yml', with the following contents:

# statsd.yml
host: "localhost"
port: 8125

With Conflate, load this information (and any other YAML file in your config directory) like so.

settings = OpenStruct.new
Conflate::Conflator.new("config", settings).perform
settings.stats
# => {"host" => "localhost", "port" => 8125}

The conflate-rails gem does the following for you in a Rails app.

Conflate::Conflator.new(Rails.root.join("config"), Rails.application.config).perform
Rails.application.config.statsd
# => {"host" => "localhost", "port" => 8125}

Around the Web