Sha256: c292f7f9e8da1cf90278fc5e21821f697f1bf6e9646622f172b54d6912e97cc3

Contents?: true

Size: 389 Bytes

Versions: 1

Compression:

Stored size: 389 Bytes

Contents

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ver-2010.08 lib/ver/vendor/json_store.rb