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

sartak at bestpractical.com sartak at bestpractical.com
Fri Mar 6 21:30:27 EST 2009


The branch, master has been updated
       via  4bddecb585a28ebd883816fc7915f644deb52fc5 (commit)
      from  3251b72b1d61dd78998e162e18225b7cb5cb0dd7 (commit)

Summary of changes:
 lib/Path/Dispatcher/Builder.pm |    2 --
 t/010-return.t                 |   14 ++++++--------
 t/100-declarative.t            |    9 ---------
 3 files changed, 6 insertions(+), 19 deletions(-)

- Log -----------------------------------------------------------------
commit 4bddecb585a28ebd883816fc7915f644deb52fc5
Author: Shawn M Moore <sartak at gmail.com>
Date:   Fri Mar 6 21:30:12 2009 -0500

    Some more cleanup, killing stages harder

diff --git a/lib/Path/Dispatcher/Builder.pm b/lib/Path/Dispatcher/Builder.pm
index aba953b..9bbe836 100644
--- a/lib/Path/Dispatcher/Builder.pm
+++ b/lib/Path/Dispatcher/Builder.pm
@@ -70,7 +70,6 @@ sub then {
     my $self = shift;
     my $block = shift;
     my $rule = Path::Dispatcher::Rule::Always->new(
-        stage => 'on',
         block => sub {
             $block->(@_);
             _next_rule;
@@ -83,7 +82,6 @@ sub chain {
     my $self = shift;
     my $block = shift;
     my $rule = Path::Dispatcher::Rule::Chain->new(
-        stage => 'on',
         block => $block,
     );
     $self->_add_rule($rule);
diff --git a/t/010-return.t b/t/010-return.t
index b87f271..2952d88 100644
--- a/t/010-return.t
+++ b/t/010-return.t
@@ -19,14 +19,12 @@ is_deeply([$dispatcher->run('foo', 42)], ["foo"]);
 my $dispatch = $dispatcher->dispatch('foo');
 is_deeply([$dispatch->run(24)], ["foo"]);
 
-for my $stage (qw/before_on on after_on/) {
-    $dispatcher->add_rule(
-        Path::Dispatcher::Rule::Regex->new(
-            regex => qr/foo/,
-            block => sub { $stage },
-        ),
-    );
-}
+$dispatcher->add_rule(
+    Path::Dispatcher::Rule::Regex->new(
+        regex => qr/foo/,
+        block => sub { "jinkies" },
+    ),
+);
 
 is_deeply([$dispatcher->run('foo', 42)], ["foo"]);
 
diff --git a/t/100-declarative.t b/t/100-declarative.t
index 434cd31..3c3ada8 100644
--- a/t/100-declarative.t
+++ b/t/100-declarative.t
@@ -25,15 +25,6 @@ do {
     };
 
     under alpha => sub {
-    #    $Path::Dispatcher::Declarative::UNDER_RULE->add_rule(
-    #        Path::Dispatcher::Rule::Always->new(
-    #            stage => 'on',
-    #            block  => sub {
-    #                print "alpha (chain) ";
-    #                next_rule;
-    #            },
-    #        ),
-    #    );
         then {
             push @calls, "alpha (chain) "; 
         };

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



More information about the Bps-public-commit mailing list