A cache store implementation which stores everything on the filesystem.
# File lib/active_support/cache/file_store.rb, line 25 def delete(name, options = nil) super File.delete(real_file_path(name)) rescue SystemCallError => e # If there's no cache, then there's nothing to complain about end
# File lib/active_support/cache/file_store.rb, line 32 def delete_matched(matcher, options = nil) super search_dir(@cache_path) do |f| if f =~ matcher begin File.delete(f) rescue SystemCallError => e # If there's no cache, then there's nothing to complain about end end end end
# File lib/active_support/cache/file_store.rb, line 45 def exist?(name, options = nil) super File.exist?(real_file_path(name)) end
# File lib/active_support/cache/file_store.rb, line 11 def read(name, options = nil) super File.open(real_file_path(name), 'rb') { |f| Marshal.load(f) } rescue nil end
# File lib/active_support/cache/file_store.rb, line 16 def write(name, value, options = nil) super ensure_cache_path(File.dirname(real_file_path(name))) File.atomic_write(real_file_path(name), cache_path) { |f| Marshal.dump(value, f) } value rescue => e logger.error "Couldn't create cache directory: #{name} (#{e.message})" if logger end
Generated with the Darkfish Rdoc Generator 2.