Sha256: 96fc8b4e0457e33dcf431f92e4f0ed8cd4519b168ca51f729d17f065e003dd50
Contents?: true
Size: 713 Bytes
Versions: 4
Compression:
Stored size: 713 Bytes
Contents
require 'yaml' require 'fileutils' require 'supermodel' # Zygote container module Zygote # A simple means of persistence # This can easily be swapped out for redis, but file-based is simpler and good enough for now # https://github.com/maccman/supermodel/blob/master/README module Memory extend self DATABASE_PATH = (ENV['DATABASE_PATH'] || File.expand_path('../data/memory.db', $PROGRAM_NAME)).freeze SuperModel::Marshal.path = DATABASE_PATH def save FileUtils.mkdir_p(File.dirname(DATABASE_PATH)) # FIXME: - don't make if it already exists SuperModel::Marshal.dump end def load SuperModel::Marshal.load end end at_exit do Memory.save end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
zygote-0.2.15 | lib/zygote/memory.rb |
zygote-0.2.14 | lib/zygote/memory.rb |
zygote-0.2.13 | lib/zygote/memory.rb |
zygote-0.2.12 | lib/zygote/memory.rb |