The custom configuration part of that is the most interesting. Sadly, we have a lot of Rails.env.production? scattered everywhere. I'm not sure I understand the examples DHH provided though.
I have written a configuration plug-in that I think is slightly better (for example allows local overwriting of the settings, not just per-environment):