Skip to content
Permalink
Browse files

Change Hanami::Middleware to Hanami::MiddlewareStack (#954)

  • Loading branch information...
GustavoCaso authored and jodosha committed Sep 24, 2018
1 parent 94c7592 commit 44dcddb97a9cb4dccb69ca84ef0e584988ab5436
@@ -191,12 +191,12 @@ def configuration

# Rack middleware stack
#
# @return [Hanami::Middleware] the middleware stack
# @return [Hanami::MiddlewareStack] the middleware stack
#
# @since 0.1.0
# @api private
#
# @see Hanami::Middleware
# @see Hanami::MiddlewareStack
attr_reader :middleware
end
end
@@ -1,6 +1,6 @@
require 'hanami/utils/kernel'
require 'hanami/environment'
require 'hanami/middleware'
require 'hanami/middleware_stack'
require 'hanami/config/cookies'
require 'hanami/config/framework_configuration'
require 'hanami/config/load_paths'
@@ -670,7 +670,7 @@ def body_parsers(*parsers)
# @since 0.2.0
#
# @see http://rdoc.info/gems/rack/Rack/Static
# @see Hanami::Middleware#use
# @see Hanami::MiddlewareStack#use
#
# @example
# require 'hanami'
@@ -684,7 +684,7 @@ def body_parsers(*parsers)
# end
# end
def middleware
@middleware ||= Hanami::Middleware.new(self)
@middleware ||= Hanami::MiddlewareStack.new(self)
end

# Adapter configuration.
@@ -6,12 +6,12 @@ module Hanami
#
# @since 0.1.0
# @api private
class Middleware
class MiddlewareStack
# Instantiate a middleware stack
#
# @param configuration [Hanami::ApplicationConfiguration] the application's configuration
#
# @return [Hanami::Middleware] the new stack
# @return [Hanami::MiddlewareStack] the new stack
#
# @since 0.1.0
# @api private
@@ -25,7 +25,7 @@ def initialize(configuration)

# Load the middleware stack
#
# @return [Hanami::Middleware] the loaded middleware stack
# @return [Hanami::MiddlewareStack] the loaded middleware stack
#
# @since 0.2.0
# @api private
@@ -62,7 +62,7 @@ def call(env)
#
# @since 0.2.0
#
# @see Hanami::Middleware#prepend
# @see Hanami::MiddlewareStack#prepend
#
# @example
# # apps/web/application.rb
@@ -89,7 +89,7 @@ def use(middleware, *args, &blk)
#
# @since 0.6.0
#
# @see Hanami::Middleware#use
# @see Hanami::MiddlewareStack#use
#
# @example
# # apps/web/application.rb
@@ -1,4 +1,4 @@
RSpec.describe Hanami::Middleware, type: :integration do
RSpec.describe Hanami::MiddlewareStack, type: :integration do
describe "#load!" do
it "loads the middleware stack without duplicates" do
with_project do

0 comments on commit 44dcddb

Please sign in to comment.
You can’t perform that action at this time.