[Bps-public-commit] Path-Dispatcher branch, master, updated. e8b69931b484269e728c427022b82c8f6739b16b

Shawn Moore sartak at bestpractical.com
Sun Oct 24 03:00:20 EDT 2010


The branch, master has been updated
       via  e8b69931b484269e728c427022b82c8f6739b16b (commit)
       via  2e64fd36fef98008aca8feea683c0ae41e56a9e5 (commit)
      from  9aee21466d468477c499c8af94379d0230ff482d (commit)

Summary of changes:
 lib/Path/Dispatcher.pm |   30 +++++++++++++++++++++++++++++-
 1 files changed, 29 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit 2e64fd36fef98008aca8feea683c0ae41e56a9e5
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Sun Oct 24 15:58:36 2010 +0900

    A bit about the flexibility and extensibility

diff --git a/lib/Path/Dispatcher.pm b/lib/Path/Dispatcher.pm
index 1458442..a4688de 100644
--- a/lib/Path/Dispatcher.pm
+++ b/lib/Path/Dispatcher.pm
@@ -116,7 +116,34 @@ rules, and it returns a list of matches. From there you can "run" the rules
 that matched. These phases are distinct so that, if you need to, you can
 inspect which rules were matched without ever running their codeblocks.
 
-You want to use L<Path::Dispatcher::Declarative> which gives you some sugar
+Each rule may take a variety of different forms. Some of the rule types are:
+
+=over 4
+
+=item L<Path::Dispatcher::Rule::Regex>
+
+Matches the path against a regular expression.
+
+=item L<Path::Dispatcher::Rule::Enum>
+
+Match one of a set of strings.
+
+=item L<Path::Dispatcher::Rule::CodeRef>
+
+Execute a coderef to determine whether the path matches the rule.
+
+=item L<Path::Dispatcher::Rule::Dispatch>
+
+Use another L<Path::Dispatcher> to match the path.
+
+=back
+
+Since L<Path::Dispatcher> is designed with good object-oriented programming
+practices, you can also write your own domain-specific rule classes. For
+example, in L<Prophet>, we have a custom rule for matching, and tab completing,
+record IDs.
+
+You may want to use L<Path::Dispatcher::Declarative> which gives you some sugar
 inspired by L<Jifty::Dispatcher>.
 
 =head1 ATTRIBUTES

commit e8b69931b484269e728c427022b82c8f6739b16b
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Sun Oct 24 15:59:44 2010 +0900

    Justify "flexible" and "extensible" dispatch

diff --git a/lib/Path/Dispatcher.pm b/lib/Path/Dispatcher.pm
index a4688de..0572ad6 100644
--- a/lib/Path/Dispatcher.pm
+++ b/lib/Path/Dispatcher.pm
@@ -116,7 +116,8 @@ rules, and it returns a list of matches. From there you can "run" the rules
 that matched. These phases are distinct so that, if you need to, you can
 inspect which rules were matched without ever running their codeblocks.
 
-Each rule may take a variety of different forms. Some of the rule types are:
+Each rule may take a variety of different forms (which I think justifies the
+"flexible" adjective in the module's description). Some of the rule types are:
 
 =over 4
 
@@ -139,9 +140,9 @@ Use another L<Path::Dispatcher> to match the path.
 =back
 
 Since L<Path::Dispatcher> is designed with good object-oriented programming
-practices, you can also write your own domain-specific rule classes. For
-example, in L<Prophet>, we have a custom rule for matching, and tab completing,
-record IDs.
+practices, you can also write your own domain-specific rule classes (which
+earns it the "extensible" adjective). For example, in L<Prophet>, we have a
+custom rule for matching, and tab completing, record IDs.
 
 You may want to use L<Path::Dispatcher::Declarative> which gives you some sugar
 inspired by L<Jifty::Dispatcher>.

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list