Skip to content

Instantly share code, notes, and snippets.

@manveru
Created August 2, 2010 07:56
Show Gist options
  • Save manveru/504302 to your computer and use it in GitHub Desktop.
Save manveru/504302 to your computer and use it in GitHub Desktop.
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