Concrete MetaStore implementation that stores request/response pairs on disk.
# File lib/rack/cache/metastore.rb, line 239 239: def purge(key) 240: path = key_path(key) 241: File.unlink(path) 242: nil 243: rescue Errno::ENOENT, IOError 244: nil 245: end
# File lib/rack/cache/metastore.rb, line 221 221: def read(key) 222: path = key_path(key) 223: File.open(path, 'rb') { |io| Marshal.load(io) } 224: rescue Errno::ENOENT, IOError 225: [] 226: end
# File lib/rack/cache/metastore.rb, line 228 228: def write(key, entries) 229: tries = 0 230: begin 231: path = key_path(key) 232: File.open(path, 'wb') { |io| Marshal.dump(entries, io, 1) } 233: rescue Errno::ENOENT, IOError 234: Dir.mkdir(File.dirname(path), 0755) 235: retry if (tries += 1) == 1 236: end 237: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.