HTTP::Handler is not a class anymore

This commit is contained in:
Serdar Dogruyol 2016-12-24 14:22:44 +03:00
parent ac8ec0a07b
commit 81a702264d
6 changed files with 13 additions and 6 deletions

View file

@ -1,6 +1,8 @@
module Kemal
# All loggers must inherit from `Kemal::BaseLogHandler`.
abstract class Kemal::BaseLogHandler < HTTP::Handler
abstract class Kemal::BaseLogHandler
include HTTP::Handler
abstract def call(context)
abstract def write(message)
end

View file

@ -1,6 +1,7 @@
module Kemal
# Kemal::CommonExceptionHandler handles all the exceptions including 404, custom errors and 500.
class CommonExceptionHandler < HTTP::Handler
class CommonExceptionHandler
include HTTP::Handler
INSTANCE = new
def call(context)

View file

@ -1,7 +1,8 @@
module Kemal
# Kemal::FilterHandler handle all code that should be evaluated before and after
# every request
class FilterHandler < HTTP::Handler
class FilterHandler
include HTTP::Handler
INSTANCE = new
# This middleware is lazily instantiated and added to the handlers as soon as a call to `after_X` or `before_X` is made.

View file

@ -1,4 +1,5 @@
class Kemal::Handler < HTTP::Handler
class Kemal::Handler
include HTTP::Handler
@@only_routes_tree = Radix::Tree(String).new
@@exclude_routes_tree = Radix::Tree(String).new

View file

@ -1,7 +1,8 @@
module Kemal
# Kemal::InitHandler is the first handler thus initializes the context with default values such as
# Content-Type, X-Powered-By.
class InitHandler < HTTP::Handler
class InitHandler
include HTTP::Handler
INSTANCE = new
def call(context)

View file

@ -3,7 +3,8 @@ require "radix"
module Kemal
# Kemal::RouteHandler is the main handler which handles all the HTTP requests. Routing, parsing, rendering e.g
# are done in this handler.
class RouteHandler < HTTP::Handler
class RouteHandler
include HTTP::Handler
INSTANCE = new
property tree