Used by caches that serialize their contents to the filesystem. Right now we do not lock around write access to the file outside of the process, that means that all FileBased caches are not safe for use if you need more than one instance of your application.
# File lib/innate/cache/file_based.rb, line 21 21: def cache_clear 22: FileUtils.mkdir_p(@dir) 23: FileUtils.rm_f(@filename) 24: @store = self.class::STORE.new(@filename) 25: end
# File lib/innate/cache/file_based.rb, line 35 35: def cache_delete(*args) 36: super{|key| transaction{|store| store.delete(key) } } 37: end
# File lib/innate/cache/file_based.rb, line 31 31: def cache_fetch(*args) 32: super{|key| transaction{|store| store[key] } } 33: end
# File lib/innate/cache/file_based.rb, line 11 11: def cache_setup(*args) 12: @prefix = args.compact.join('-') 13: 14: @dir = File.join(Dir.tmpdir, self.class::DIR) 15: FileUtils.mkdir_p(@dir) 16: 17: @filename = File.join(@dir, @prefix + self.class::EXT) 18: @store = self.class::STORE.new(@filename) 19: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.