Create a gist now

Instantly share code, notes, and snippets.

Class of alias nodes differs from class of anchor nodes in Psych
:original: &id001 2012-04-14 11:00:00 Z
:alias: *id001
# 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