

Envconfig: Environmentally friendly Ruby configuration - paulannesley
http://blog.broadstack.com/envconfig-ruby-rails-configuration.html

======
amalag
How is this different from dotenv ?

~~~
paulannesley
dotenv reads a file into Ruby's ENV.

envconfig reads Ruby's ENV and exposes it as a useful configuration object.
envconfig-rails uses that to e.g. push the SMTP settings into ActionMailer.

The key value, though, is that envconfig knows about Heroku and Broadstack
add-on ENV names.

e.g. when you add the MemCachier Addon, it simply puts MEMCACHIER_SERVERS,
MEMCACHIER_USERNAME, MEMCACHIER_PASSWORD into your ENV. Envconfig knows those
var names, and assigns them to the memcached service.

If you looks at the various provider mappings in e.g.
[https://github.com/broadstack/envconfig/blob/master/lib/envc...](https://github.com/broadstack/envconfig/blob/master/lib/envconfig/smtp.rb)
you'll see that it knows about ENV-provided, and static, configuration for
each provider.

