My rails application uses a gem, which requires some configuration parameters specified in the foo.yml file:
development:
username: MyDevUserName
password: MyDevPassword
production:
username: MyPRODUserName
password: MyPRODPassword
I do not want a password in my source code and want to do something like:
development:
username: <%= ENV['THE_USERNAME'] %>
password: <%= ENV['THE_PASSWORD'] %>
production:
username: <%= ENV['THE_USERNAME'] %>
password: <%= ENV['THE_PASSWORD'] %>
However, for some reason, <% = ENV ['XXX']%> works in my Settings.yml file, but does not work in my foo.yml file (I assume the foo gem load .yml file does not allow interpretation).
So...
I am wondering if Ruby / Rails has a universal way to specify variables in environment.rb instead of foo.yml?
For example, can I have an empty foo.yml file and add the following to environment.rb :
Foo::_something_._somethingelse =
{
:username => ENV['THE_USERNAME'],
:password => ENV['THE_PASSWORD']
}