Created
June 7, 2011 21:39
-
-
Save davidsnyder/1013238 to your computer and use it in GitHub Desktop.
Icss serialization bug
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 'yaml' | |
require 'json' | |
require 'icss' | |
require 'icss/brevity' | |
yaml_file = File.read("config.yaml") | |
#load a YAML ICSS | |
yaml_icss = Icss::Protocol.receive YAML.load(yaml_file) | |
#convert the icss to json | |
json_file = JSON.generate(yaml_icss) | |
#load the JSON ICSS | |
json_icss = Icss::Protocol.receive JSON.parse(json_file) | |
#These SHOULD be identical | |
p yaml_icss.messages['word_stats'] | |
p json_icss.messages['word_stats'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment