Sha256: 57f5bbf5999169c854c099b61ffb5ac241de37f9aa34782b287b7a956b010d65
Contents?: true
Size: 381 Bytes
Versions: 7
Compression:
Stored size: 381 Bytes
Contents
module Zemanta module Cache class Disk attr_accessor :db def initialize(directory='tmp/db') @db = Pathname.new(directory) @db.mkpath end def [](key) file = @db.join(key) file.read if file.exist? end def []=(key,value) @db.join(key).open('w') {|f| f.write(value.to_s)} end end end end
Version data entries
7 entries across 7 versions & 1 rubygems