Skip to content

Instantly share code, notes, and snippets.

@davidsnyder
Created June 7, 2011 21:39
Show Gist options
  • Save davidsnyder/1013238 to your computer and use it in GitHub Desktop.
Save davidsnyder/1013238 to your computer and use it in GitHub Desktop.
Icss serialization bug
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