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?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to