Created
August 2, 2010 07:56
-
-
Save manveru/504302 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 'json' | |
require 'pstore' | |
class JSON::Store < PStore | |
def dump(table) | |
JSON.pretty_unparse(@table) | |
end | |
def load(content) | |
JSON.load(content) | |
end | |
EMPTY_MARSHAL_DATA = {}.to_json | |
EMPTY_MARSHAL_CHECKSUM = Digest::MD5.digest(EMPTY_MARSHAL_DATA) | |
def empty_marshal_data | |
EMPTY_MARSHAL_DATA | |
end | |
def empty_marshal_checksum | |
EMPTY_MARSHAL_CHECKSUM | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment