Sha256: 744fba494b9a7a742ccd35880b0b40decda7c80e6bd6bd54c9ff699fde21c62d
Contents?: true
Size: 555 Bytes
Versions: 22
Compression:
Stored size: 555 Bytes
Contents
require 'rack/file' module TDiary module Rack class Static def initialize( app, base_dir ) @app = app @file = base_dir.map{|dir| ::Rack::File.new(dir) } end def call( env ) result = [] @file.each do |f| result = f.call(env) break if result[0].to_i < 400 || result[0].to_i >= 500 end if result[0].to_i >= 400 && result[0].to_i < 500 @app.call( env ) else result end end end end end # Local Variables: # mode: ruby # indent-tabs-mode: t # tab-width: 3 # ruby-indent-level: 3 # End:
Version data entries
22 entries across 17 versions & 1 rubygems