module Roda::RodaPlugins::RunHandler::RequestMethods

  1. lib/roda/plugins/run_handler.rb

Methods

Public Instance

  1. run

Public Instance methods

run(app, opts=OPTS)

If a block is given, yield the rack response array to it. The response can be modified before it is returned by the current app.

If the not_found: :pass option is given, and the rack response returned by the app is a 404 response, do not return the response, continue routing normally.

[show source]
   # File lib/roda/plugins/run_handler.rb
35 def run(app, opts=OPTS)
36   res = catch(:halt){super(app)}
37   yield res if defined?(yield)
38   if opts[:not_found] == :pass && res[0] == 404
39     body = res[2]
40     body.close if body.respond_to?(:close)
41     nil
42   else
43     throw(:halt, res)
44   end
45 end