lib/roda.rb in roda-3.9.0 vs lib/roda.rb in roda-3.10.0
- old
+ new
@@ -226,11 +226,11 @@
end
# Add a middleware to use for the rack application. Must be
# called before calling #route to have an effect. Example:
#
- # Roda.use Rack::Session::Cookie, secret: ENV['secret']
+ # Roda.use Rack::ShowExceptions
def use(*args, &block)
@middleware << [args, block].freeze
build_rack_app
end
@@ -370,11 +370,11 @@
# Store the roda instance and environment.
def initialize(scope, env)
@scope = scope
@captures = []
@remaining_path = _remaining_path(env)
- super(env)
+ @env = env
end
# Handle match block return values. By default, if a string is given
# and the response is empty, use the string as the response body.
def block_result(result)
@@ -668,10 +668,10 @@
end
# The session for the current request. Raises a RodaError if
# a session handler has not been loaded.
def session
- @env['rack.session'] || raise(RodaError, "You're missing a session handler. You can get started by adding use Rack::Session::Cookie")
+ @env['rack.session'] || raise(RodaError, "You're missing a session handler, try using the sessions plugin.")
end
private
# Match any of the elements in the given array. Return at the