Created
July 2, 2012 16:24
-
-
Save ejames/3034085 to your computer and use it in GitHub Desktop.
Class of alias nodes differs from class of anchor nodes in Psych
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
:original: &id001 2012-04-14 11:00:00 Z | |
:alias: *id001 |
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
# Ruby 1.9.2-p290 | |
require 'yaml' | |
from_syck = YAML.load_file("example.yaml") | |
from_syck[:original].class # => Time | |
from_syck[:alias].class # => Time | |
require 'psych' | |
YAML::ENGINE.yamler = 'psych' | |
from_psych = YAML.load_file("example.yaml") | |
from_psych[:original].class # => Time | |
from_psych[:alias].class # => String |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment