I was considering creating a pull request to add this functionality, but just wanted to get some thoughts on the idea first.
Basically, since Rails 4 added the handy config_for() functionality to support loading custom yml files from the config directory, I thought it would be nice if we had a generator to compliment it.
Here's an example:
"rails config facebook app_id app_secret" will create config/facebook.yml (if it doesn't already exist) with the keys stubbed out for each environment:
development:
app_id: <%= ENV["FACEBOOK_APP_ID"] %>
app_secret: <%= ENV["FACEBOOK_APP_SECRET"] %>
test:
app_id: <%= ENV["FACEBOOK_APP_ID"] %>
app_secret: <%= ENV["FACEBOOK_APP_SECRET"] %>
# Do not keep production secrets in the repository,
# instead read values from the environment.
production:
app_id: <%= ENV["FACEBOOK_APP_ID"] %>
app_secret: <%= ENV["FACEBOOK_APP_SECRET"] %>
I think this could be handy, but also help reinforce the idea that secret values should not be stored in a repository.
Thoughts?