[Bps-public-commit] Path-Dispatcher branch, master, updated. 56a45165bbeec000f73ed2e47c16c8e89edab517
sartak at bestpractical.com
sartak at bestpractical.com
Fri Dec 18 20:06:59 EST 2009
The branch, master has been updated
via 56a45165bbeec000f73ed2e47c16c8e89edab517 (commit)
from a379380aa70134d1b317932743e7c03e1d4e5bf4 (commit)
Summary of changes:
lib/Path/Dispatcher/Builder.pm | 10 ++++++++++
lib/Path/Dispatcher/Declarative.pm | 1 +
2 files changed, 11 insertions(+), 0 deletions(-)
- Log -----------------------------------------------------------------
commit 56a45165bbeec000f73ed2e47c16c8e89edab517
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Fri Dec 18 20:06:44 2009 -0500
Add ->complete to declarative dispatchers
diff --git a/lib/Path/Dispatcher/Builder.pm b/lib/Path/Dispatcher/Builder.pm
index 6821ef5..d5220d9 100644
--- a/lib/Path/Dispatcher/Builder.pm
+++ b/lib/Path/Dispatcher/Builder.pm
@@ -49,6 +49,16 @@ sub run {
$OUTERMOST_DISPATCHER->run(@_);
}
+sub complete {
+ my $self = shift;
+ my $dispatcher = shift;
+
+ local $OUTERMOST_DISPATCHER = $self->dispatcher
+ if !$OUTERMOST_DISPATCHER;
+
+ $OUTERMOST_DISPATCHER->complete(@_);
+}
+
sub rewrite {
my $self = shift;
my ($from, $to) = @_;
diff --git a/lib/Path/Dispatcher/Declarative.pm b/lib/Path/Dispatcher/Declarative.pm
index a000ef8..649932a 100644
--- a/lib/Path/Dispatcher/Declarative.pm
+++ b/lib/Path/Dispatcher/Declarative.pm
@@ -58,6 +58,7 @@ sub build_sugar {
redispatch_to => sub { $builder->redispatch_to(@_) },
next_rule => sub { $builder->next_rule(@_) },
last_rule => sub { $builder->last_rule(@_) },
+ complete => sub { $builder->complete(@_) },
then => sub (&) { $builder->then(@_) },
chain => sub (&) { $builder->chain(@_) },
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list