Keeping database.yml dry

That would be dry as in Don’t Repeat Yourself

defaults: &defaults
    adapter: mysql
    encoding: utf8
    username: root
    password: root
    #Wherever mysqld.sock is located
    socket: /opt/local/var/run/mysql5/mysqld.sock
 
development:
    database: blog_development
    <<: *defaults
 
test:
    database: blog_test
    <<: *defaults
 
production:
    database: blog_production
    <<: *defaults


Related posts:

  1. Backing things up a la Crashplan
  2. Why implement PHP in Java?
  3. Komodo Edit on Ubuntu (Linux)
  4. Smarty… again
  5. Exceptions Are Not For Flow Control

Tags: , , , , , , ,