librato/librato-rails — pull request #4 by jsmestad (2012-09-27 20:55:01+00:00)
Title: check_config to use ENV or config, not both.

Fixed a couple minor things:

1. `self.token` was not being set by ENV variables
2. Add debug logging to check_config displaying if YAML file is being used OR ENV variables
3. Only use ENV if the config is not there. The logic behind this change was first for debugging purposes, but also to allow for a configuration file that uses ERB. (see below)
4. Minor formatting things (nothing major)

What I would like a YAML file to look like so it works in local environments and a heroku (or self-hosted) environment without changes: (names may not be correct, pseudo-code)

```yaml
defaults: &defaults
prefix: <%= ENV['LIBRATO_METRICS_SOURCE'] || 'myblogapp' %>
user: <%= ENV['LIBRATO_METRICS_USER'] || 'development@example.com' %>
key: <%= ENV['LIBRATO_METRICS_KEY'] || 'development@example.com' %>

development:
<<: *defaults
prefix: 'development'

test:

production:
<<: *defaults
```