Q:

Alternate for environment dependent global variables

There are a couple of places in my Ruby on Rails project where I need to access a value dependent on which environment Ruby on Rails was started in. 
Specifically, it is the name of the MongoDB database that I need to make a connection to. 
Currently I just have something like:
MONGO_DB = "database_name"

in config/environments/< environment >.rb.
Then in the code I can call things like  Mongo::Connection.new.db(MONGO_DB).
Is there a better way to do this without global variables? Just using global variables rubs me the wrong way, though they never change once the application has been started. 

A:

Hopefully, there is a much better way. Find inspiration in YAML Configuration File.
Having all datas in YAML files is a really clean way to handle multiple cases.

