[Bps-public-commit] r16618 - in Path-Dispatcher/trunk: lib/Path/Dispatcher

sartak at bestpractical.com sartak at bestpractical.com
Wed Oct 29 21:19:26 EDT 2008


Author: sartak
Date: Wed Oct 29 21:19:26 2008
New Revision: 16618

Modified:
   Path-Dispatcher/trunk/   (props changed)
   Path-Dispatcher/trunk/lib/Path/Dispatcher/Dispatch.pm
   Path-Dispatcher/trunk/lib/Path/Dispatcher/Match.pm

Log:
 r74850 at onn:  sartak | 2008-10-29 21:17:57 -0400
 Turn ends_dispatch into an attribute


Modified: Path-Dispatcher/trunk/lib/Path/Dispatcher/Dispatch.pm
==============================================================================
--- Path-Dispatcher/trunk/lib/Path/Dispatcher/Dispatch.pm	(original)
+++ Path-Dispatcher/trunk/lib/Path/Dispatcher/Dispatch.pm	Wed Oct 29 21:19:26 2008
@@ -33,7 +33,7 @@
             push @results, scalar $match->run(@args);
 
             die "Path::Dispatcher abort\n"
-                if $match->ends_dispatch($self);
+                if $match->ends_dispatch;
         };
 
         if ($@) {

Modified: Path-Dispatcher/trunk/lib/Path/Dispatcher/Match.pm
==============================================================================
--- Path-Dispatcher/trunk/lib/Path/Dispatcher/Match.pm	(original)
+++ Path-Dispatcher/trunk/lib/Path/Dispatcher/Match.pm	Wed Oct 29 21:19:26 2008
@@ -32,6 +32,14 @@
     default => sub { ref(shift->result) eq 'ARRAY' },
 );
 
+# If we're a before/after (qualified) rule, then yeah, we want to continue
+# dispatching. If we're an "on" (unqualified) rule, then no, you only get one.
+has ends_dispatch => (
+    is      => 'rw',
+    isa     => 'Bool',
+    default => 1,
+);
+
 sub run {
     my $self = shift;
     my @args = @_;
@@ -69,14 +77,6 @@
     $code->();
 }
 
-# If we're a before/after (qualified) rule, then yeah, we want to continue
-# dispatching. If we're an "on" (unqualified) rule, then no, you only get one.
-sub ends_dispatch {
-    my $self = shift;
-
-    return 1;
-}
-
 __PACKAGE__->meta->make_immutable;
 no Moose;
 



More information about the Bps-public-commit mailing list