Most of configuration files in ruby such as Gemfile, gemspec, are just ruby code itself. Why database configuration file in rails is the exception?
Why rails use yaml to config database instead of plain ruby code?
ruby;ruby on rails
Personal theory is ruby code is scary to administrators, and the one configuration file they would often have to mess with is the database configuration. YAML is a bit more approachable.