laserlemon/figaro — pull request #124 by raul (2014-04-21 02:00:33+00:00)
Title: Allow documenting required keys

I typically document the purpose of each config variable and how to get it. I'd love Figaro to help me with that and this is a first step in that direction (only dealing with required variables right now):

```ruby
# config/initializers/figaro.rb

Figaro.require({
google_analytics_key: 'Get it at https://www.google.com/analytics/web/ (e.g: UA-12345678-1)',
# ...
})
```

```bash
# Execute the app without ENV['GOOGLE_ANALYTICS_KEY']
$ bundle exec rails s

Missing required configuration keys: (Figaro::MissingKeys)
- google_analytics_key: Get it at https://www.google.com/analytics/web/ (e.g: UA-12345678-1)
```

The existing array-based interface is still available.

I'd love to expand Figaro to do something like:

```bash
$ figaro
== Required
[x] AAA: Credentials to access the Aaa service, get them at http://aaa.com/credentials
[x] ZZZ: Credentials to access the Zzz service, get them at http://zzz.com/account
[ ] BBB: Credentials to access the Bbb add-on, get them with `heroku addons:add bbb`

== Optional
[x] YYY: Credentials to access the Yyy service, get them at http://yyy.com/account
[ ] CCC: Credentials to access the Ccc service, get them at http://ccc.com/credentials
```

and
```bash
$ figaro missing
[ ] BBB: Credentials to access the Bbb service, get them at http://bbb.com/profile
```

How do you like this approach?