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

Version Path
tdiary-5.3.0 lib/tdiary/rack/static.rb
tdiary-5.2.4 lib/tdiary/rack/static.rb
tdiary-5.2.3 lib/tdiary/rack/static.rb
tdiary-5.2.2 lib/tdiary/rack/static.rb
tdiary-5.2.1 lib/tdiary/rack/static.rb
tdiary-5.2.0 lib/tdiary/rack/static.rb
tdiary-5.1.7 lib/tdiary/rack/static.rb
tdiary-5.1.6 lib/tdiary/rack/static.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/lib/tdiary/rack/static.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/lib/tdiary/rack/static.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/lib/tdiary/rack/static.rb
tdiary-5.1.5 lib/tdiary/rack/static.rb
tdiary-5.1.4 lib/tdiary/rack/static.rb
tdiary-5.1.3 lib/tdiary/rack/static.rb
tdiary-5.1.2 vendor/bundle/ruby/2.6.0/gems/tdiary-5.0.14/lib/tdiary/rack/static.rb
tdiary-5.1.2 lib/tdiary/rack/static.rb
tdiary-5.1.1 lib/tdiary/rack/static.rb
tdiary-5.1.1 vendor/bundle/ruby/2.6.0/gems/tdiary-5.0.14/lib/tdiary/rack/static.rb
tdiary-5.1.0 lib/tdiary/rack/static.rb
tdiary-5.0.14 lib/tdiary/rack/static.rb