Sha256: 971dbd4059201cf25eceae8c3494b5a20780bcd5f6145ed0ca508b41e646c57e
Contents?: true
Size: 380 Bytes
Versions: 2
Compression:
Stored size: 380 Bytes
Contents
class 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
zemanta_client-0.0.2 | lib/zemanta/cache/disk.rb |
zemanta_client-0.0.1 | lib/zemanta/cache/disk.rb |