Skip to content

Instantly share code, notes, and snippets.

@cris
Created February 3, 2011 10:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cris/809309 to your computer and use it in GitHub Desktop.
Save cris/809309 to your computer and use it in GitHub Desktop.
Bug in psych(ruby 1.9.2) with yaml aliased sections
require 'psych'
require 'yaml'
yaml_config = <<-YAML
development: &common
encoding: utf-8
database: dev-base
production:
<<: *common
database: prod-base
YAML
config = YAML.load(yaml_config)
puts config['production']['database'] #=> "dev-base"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment