Sha256: 3194f88eb9eaee8373615428088d393c75e7122545695b820b858cc7fac03ef4
Contents?: true
Size: 517 Bytes
Versions: 4
Compression:
Stored size: 517 Bytes
Contents
module Thumbs class CacheRead def initialize(app, cache_type = "resized") @app = app @cache_type = cache_type end def call(env) if env["thumbs.#{@cache_type}_path"] begin status, headers, body = [200, {}, File.read(env["thumbs.#{@cache_type}_path"])] env['thumbs.logger'] << "#{@cache_type}_cache" return [status, headers, body] rescue Errno::ENOENT, IOError => e end end return @app.call(env) end end end
Version data entries
4 entries across 4 versions & 1 rubygems