Created
February 3, 2011 10:20
-
-
Save cris/809309 to your computer and use it in GitHub Desktop.
Bug in psych(ruby 1.9.2) with yaml aliased sections
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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