lib/roda/plugins/match_affix.rb in roda-2.16.0 vs lib/roda/plugins/match_affix.rb in roda-2.17.0
- old
+ new
@@ -13,18 +13,19 @@
#
# You set the prefix and suffix to use by passing arguments when loading the plugin:
#
# plugin :match_affix, ""
#
- # will load the plugin and use an empty prefix.
+ # will load the plugin and use an empty prefix (instead of a slash).
#
# plugin :match_affix, "", /(\/|\z)/
#
# will use an empty prefix and change the suffix to consume a trailing slash.
#
- # plugin :match_affix, nil, /(\/|\z)/
+ # plugin :match_affix, nil, /(?:\/\z|(?=\/|\z))/
#
- # will not modify the prefix and will change the suffix to consume a trailing slash.
+ # will not modify the prefix and will change the suffix so that it consumes a trailing slash
+ # at the end of the path only.
module MatchAffix
PREFIX = "/".freeze
SUFFIX = "(?=\/|\z)".freeze
# Set the default prefix and suffix to use in match patterns, if a non-nil value