Skip to content

Instantly share code, notes, and snippets.

@aquajach
Created November 26, 2010 16:28
Show Gist options
  • Save aquajach/716922 to your computer and use it in GitHub Desktop.
Save aquajach/716922 to your computer and use it in GitHub Desktop.
Parse YAML
DB_CONFIG = YAML.load_file(“#{RAILS_ROOT}/config/database.yml”)[RAILS_ENV]
p DB_CONFIG['host'] # 192.168.0.1
p DB_CONFIG['username'] # project
p DB_CONFIG['password'] # xxxxxx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment