Sha256: 7bfa258ed978ffedccb64734d81a429d05b2c19ba1d686d1c750986ad9d7d53d
Contents?: true
Size: 1018 Bytes
Versions: 127
Compression:
Stored size: 1018 Bytes
Contents
module Picky module Backends class Memory # Index data in the Ruby Marshal format. # class Marshal < Basic # Uses the extension "dump". # def extension :dump end # Loads the index hash from marshal format. # def load ::Marshal.load ::File.open(cache_path, 'r:binary') end # Dumps the index internal backend in marshal format. # def dump internal create_directory cache_path dump_marshal internal end # Dumps binary self to the path given. Minus extension. # def dump_marshal internal ::File.open(cache_path, 'w:binary') do |out_file| ::Marshal.dump internal, out_file end end # A marshal file does not provide retrieve functionality. # def retrieve raise "Can't retrieve from marshalled file. Use text file." end end end end end
Version data entries
127 entries across 127 versions & 1 rubygems