module Roda::RodaPlugins::RunAppendSlash::RequestMethods

  1. lib/roda/plugins/run_append_slash.rb

Methods

Public Instance

  1. run

Public Instance methods

run(*)

Calls the given rack app. If the path matches the root of the app but does not contain a trailing slash, a trailing slash is appended to the path internally, or a redirect is issued when configured with use_redirects: true.

[show source]
   # File lib/roda/plugins/run_append_slash.rb
36 def run(*)
37   if @remaining_path.empty?
38     if scope.opts[:run_append_slash_redirect]
39       redirect("#{path}/")
40     else
41       @remaining_path += '/'
42     end
43   end
44   super
45 end