4 ms·
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 SMT
by paulannesley 13y ago
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/envconfig/smtp.rb https://github.com/broadstack/envconfig/blob/master/lib/envc... you'll see that it knows about ENV-provided, and static, configuration for each provider.