lib/roda/plugins/middleware.rb
# When calling the middleware, first call the current middleware.
# If this returns a result, return that result directly.  Otherwise,
# pass handling of the request to the next middleware.
When calling the middleware, first call the current middleware.
If this returns a result, return that result directly.  Otherwise,
pass handling of the request to the next middleware.
When calling the middleware first call the current middleware . If this returns a result return that result directly . Otherwise pass handling of the request to the next middleware .
def call(env)
          res = nil
          call_next = catch(:next) do
            env[@mid.opts[:middleware_env_var]] = true
            res = @mid.call(env)
            false
          end
          if call_next
            res = @app.call(env)
          end
          if handle_result = @mid.opts[:middleware_handle_result]
            handle_result.call(env, res)
          end
          res
        end
def call ( env ) res = nil call_next = catch ( :next ) do env [ @mid . opts [ :middleware_env_var ] ] = true res = @mid . call ( env ) false end if call_next res = @app . call ( env ) end if handle_result = @mid . opts [ :middleware_handle_result ] handle_result . call ( env , res ) end res end
When calling the middleware, first call the current middleware.
When calling the middleware first call the current middleware .
env