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

sartak at bestpractical.com sartak at bestpractical.com
Tue Mar 16 09:46:13 EDT 2010


The branch, master has been updated
       via  397da8a603e4a4b1d840424fb4102b5dd32383d3 (commit)
       via  d791c842fa78de5a0350847f605b6e5ec4561aef (commit)
       via  93478b4aa33c31b157c82422e00bba907c3f0234 (commit)
       via  f27868aa19071ed04dcf9081be3282dcc758303f (commit)
      from  49b983340e3396e779e35904ae563420dd42a620 (commit)

Summary of changes:
 lib/Path/Dispatcher/Rule/Enum.pm     |   15 +++++++++------
 lib/Path/Dispatcher/Rule/Eq.pm       |    2 +-
 lib/Path/Dispatcher/Rule/Sequence.pm |   27 +++++++++++++++++++++++++++
 3 files changed, 37 insertions(+), 7 deletions(-)

- Log -----------------------------------------------------------------
commit f27868aa19071ed04dcf9081be3282dcc758303f
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Mar 16 09:42:36 2010 -0400

    unimport Any::Moose and make_immutable in Sequence

diff --git a/lib/Path/Dispatcher/Rule/Sequence.pm b/lib/Path/Dispatcher/Rule/Sequence.pm
index 21ffc32..875aa3f 100644
--- a/lib/Path/Dispatcher/Rule/Sequence.pm
+++ b/lib/Path/Dispatcher/Rule/Sequence.pm
@@ -75,5 +75,8 @@ sub untokenize {
            @tokens;
 }
 
+__PACKAGE__->meta->make_immutable;
+no Any::Moose;
+
 1;
 

commit 93478b4aa33c31b157c82422e00bba907c3f0234
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Mar 16 09:42:47 2010 -0400

    Some doc for Sequence

diff --git a/lib/Path/Dispatcher/Rule/Sequence.pm b/lib/Path/Dispatcher/Rule/Sequence.pm
index 875aa3f..7cdc213 100644
--- a/lib/Path/Dispatcher/Rule/Sequence.pm
+++ b/lib/Path/Dispatcher/Rule/Sequence.pm
@@ -80,3 +80,27 @@ no Any::Moose;
 
 1;
 
+__END__
+
+=head1 NAME
+
+Path::Dispatcher::Rule::Sequence - a sequence of rules
+
+=head1 SYNOPSIS
+
+=head1 DESCRIPTION
+
+This is basically a more robust and flexible version of
+L<Path::Dispatcher::Rule::Tokens>.
+
+Instead of a mish-mash of strings, regexes, and array references,
+a Sequence rule has just a list of other rules.
+
+=head1 ATTRIBUTES
+
+=head2 rules
+
+=head2 delimiter
+
+=cut
+

commit d791c842fa78de5a0350847f605b6e5ec4561aef
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Mar 16 09:45:37 2010 -0400

    Fix Enum's doc to not be a copy of Eq's

diff --git a/lib/Path/Dispatcher/Rule/Enum.pm b/lib/Path/Dispatcher/Rule/Enum.pm
index 341597d..e88dc09 100644
--- a/lib/Path/Dispatcher/Rule/Enum.pm
+++ b/lib/Path/Dispatcher/Rule/Enum.pm
@@ -86,22 +86,25 @@ __END__
 
 =head1 NAME
 
-Path::Dispatcher::Rule::Eq - predicate is a string equality
+Path::Dispatcher::Rule::Enum - one of a list of strings must match
 
 =head1 SYNOPSIS
 
-    my $rule = Path::Dispatcher::Rule::Eq->new(
-        string => 'comment',
-        block  => sub { display_comment($2) },
+    my $rule = Path::Dispatcher::Rule::Enum->new(
+        enum  => [qw(perl ruby python php)],
+        block => sub { warn "$1 rules!" },
     );
 
 =head1 DESCRIPTION
 
-Rules of this class simply check whether the string is equal to the path.
+Rules of this class check whether the path matches any of its
+L</enum> strings.
 
 =head1 ATTRIBUTES
 
-=head2 string
+=head2 enum
+
+=head2 case_sensitive
 
 =cut
 

commit 397da8a603e4a4b1d840424fb4102b5dd32383d3
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Mar 16 09:46:06 2010 -0400

    $2 doesn't make sense here

diff --git a/lib/Path/Dispatcher/Rule/Eq.pm b/lib/Path/Dispatcher/Rule/Eq.pm
index 41d2c97..5818ea7 100644
--- a/lib/Path/Dispatcher/Rule/Eq.pm
+++ b/lib/Path/Dispatcher/Rule/Eq.pm
@@ -75,7 +75,7 @@ Path::Dispatcher::Rule::Eq - predicate is a string equality
 
     my $rule = Path::Dispatcher::Rule::Eq->new(
         string => 'comment',
-        block  => sub { display_comment($2) },
+        block  => sub { display_comment($1) },
     );
 
 =head1 DESCRIPTION

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



More information about the Bps-public-commit mailing list