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

sartak at bestpractical.com sartak at bestpractical.com
Fri Mar 6 22:08:30 EST 2009


The branch, master has been updated
       via  b4b6fb564222823f7f4ecb91c9f414c3b05f3040 (commit)
      from  ea2c83d97d29b2d0fd9ae5e2aa12a8d96f21f4ca (commit)

Summary of changes:
 lib/Path/Dispatcher/Builder.pm     |    6 +++---
 lib/Path/Dispatcher/Declarative.pm |    7 ++-----
 2 files changed, 5 insertions(+), 8 deletions(-)

- Log -----------------------------------------------------------------
commit b4b6fb564222823f7f4ecb91c9f414c3b05f3040
Author: Shawn M Moore <sartak at gmail.com>
Date:   Fri Mar 6 22:08:18 2009 -0500

    Use $builder's next_rule and last_rule

diff --git a/lib/Path/Dispatcher/Builder.pm b/lib/Path/Dispatcher/Builder.pm
index a00f2f3..7afe38f 100644
--- a/lib/Path/Dispatcher/Builder.pm
+++ b/lib/Path/Dispatcher/Builder.pm
@@ -23,11 +23,11 @@ has token_delimiter => (
     default     => ' ',
 );
 
-sub _next_rule () {
+sub next_rule () {
     die "Path::Dispatcher next rule\n";
 }
 
-sub _last_rule () {
+sub last_rule () {
     die "Path::Dispatcher abort\n";
 }
 
@@ -72,7 +72,7 @@ sub then {
     my $rule = Path::Dispatcher::Rule::Always->new(
         block => sub {
             $block->(@_);
-            _next_rule;
+            next_rule;
         },
     );
     $self->_add_rule($rule);
diff --git a/lib/Path/Dispatcher/Declarative.pm b/lib/Path/Dispatcher/Declarative.pm
index ae85dcf..af490ab 100644
--- a/lib/Path/Dispatcher/Declarative.pm
+++ b/lib/Path/Dispatcher/Declarative.pm
@@ -15,9 +15,6 @@ my $exporter = Sub::Exporter::build_exporter({
     },
 });
 
-*_next_rule = \&Path::Dispatcher::Builder::_next_rule;
-*_last_rule = \&Path::Dispatcher::Builder::_last_rule;
-
 sub token_delimiter { ' ' }
 sub case_sensitive_tokens { undef }
 
@@ -84,8 +81,8 @@ sub build_sugar {
         chain           => sub (&) { $lazy_builder->()->chain(@_) },
         under           => sub { $lazy_builder->()->under(@_) },
         redispatch_to   => sub { $lazy_builder->()->redispatch_to(@_) },
-        next_rule       => \&_next_rule,
-        last_rule       => \&_last_rule,
+        next_rule       => sub { $lazy_builder->()->next_rule(@_) },
+        last_rule       => sub { $lazy_builder->()->last_rule(@_) },
     };
 }
 

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



More information about the Bps-public-commit mailing list