class Reck::Application
Public Class Methods
call(env)
click to toggle source
# File lib/reck/application.rb, line 34 def self.call(env) req = Rack::Request.new(env) if route = routes.find {|r| r.path.chomp('/') == req.path_info.chomp('/') } route.call(req) fail 'invalid response' else [404, {}, ['Not Found']] end rescue Reck::Response => e [STATUS[e.class], {}, [e.head? ? nil : e.render].compact] rescue => e env['rack.exception'] = e [500, {}, ['Internal Server Error']] end
routes()
click to toggle source
# File lib/reck/application.rb, line 49 def self.routes @@routes ||= [] end