From db38c448c262f5cadaa71a96eafd9f640a5abf5a Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Mon, 14 Aug 2023 08:53:34 -0700 Subject: [PATCH] Bump version to 3.71.0 --- CHANGELOG | 2 +- doc/release_notes/3.71.0.txt | 33 +++++++++++++++++++++++++++++++++ lib/roda/version.rb | 2 +- 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 doc/release_notes/3.71.0.txt diff --git a/CHANGELOG b/CHANGELOG index 570e0f6f..40d29778 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -= master += 3.71.0 (2023-08-14) * Add match_hook_args plugin, similar to match_hooks but support matchers and block args as hook arguments (jeremyevans) diff --git a/doc/release_notes/3.71.0.txt b/doc/release_notes/3.71.0.txt new file mode 100644 index 00000000..065aae8a --- /dev/null +++ b/doc/release_notes/3.71.0.txt @@ -0,0 +1,33 @@ += New Feature + +* A match_hook_args plugin has been added. This is similar to the + existing match_hook plugin, but passes through the matchers and + block arguments (values yielded to the match block). Example: + + plugin :match_hook_args + + add_match_hook do |matchers, block_args| + logger.debug("matchers: #{matchers.inspect}. #{block_args.inspect} yielded.") + end + + # Term is an implicit matcher used for terminating matches, and + # will be included in the array of matchers yielded to the match hook + # if a terminating match is used. + term = self.class::RodaRequest::TERM + + route do |r| + r.root do + # for a request for / + # matchers: nil, block_args: nil + end + + r.on 'a', ['b', 'c'], Integer do |segment, id| + # for a request for /a/b/1 + # matchers: ["a", ["b", "c"], Integer], block_args: ["b", 1] + end + + r.get 'd' do + # for a request for /d + # matchers: ["d", term], block_args: [] + end + end diff --git a/lib/roda/version.rb b/lib/roda/version.rb index 4d88b1b0..3148353c 100644 --- a/lib/roda/version.rb +++ b/lib/roda/version.rb @@ -4,7 +4,7 @@ class Roda RodaMajorVersion = 3 # The minor version of Roda, updated for new feature releases of Roda. - RodaMinorVersion = 70 + RodaMinorVersion = 71 # The patch version of Roda, updated only for bug fixes from the last # feature release.