[Bps-public-commit] r16782 - in Path-Dispatcher/trunk: lib/Path/Dispatcher
sartak at bestpractical.com
sartak at bestpractical.com
Sun Nov 9 12:37:00 EST 2008
Author: sartak
Date: Sun Nov 9 12:36:59 2008
New Revision: 16782
Modified:
Path-Dispatcher/trunk/ (props changed)
Path-Dispatcher/trunk/lib/Path/Dispatcher/Declarative.pm
Log:
r75351 at onn: sartak | 2008-11-09 12:36:53 -0500
Add redispatch_to sugar
Modified: Path-Dispatcher/trunk/lib/Path/Dispatcher/Declarative.pm
==============================================================================
--- Path-Dispatcher/trunk/lib/Path/Dispatcher/Declarative.pm (original)
+++ Path-Dispatcher/trunk/lib/Path/Dispatcher/Declarative.pm Sun Nov 9 12:36:59 2008
@@ -106,6 +106,20 @@
$into->_add_rule($under, @_);
},
+ redispatch_to => sub {
+ my ($dispatcher) = @_;
+
+ # assume it's a declarative dispatcher
+ if (!ref($dispatcher)) {
+ $dispatcher = $dispatcher->dispatcher;
+ }
+
+ my $redispatch = Path::Dispatcher::Rule::Dispatch->new(
+ dispatcher => $dispatcher,
+ );
+
+ $into->_add_rule($redispatch);
+ },
next_rule => sub { die "Path::Dispatcher next rule\n" },
last_rule => sub { die "Path::Dispatcher abort\n" },
};
More information about the Bps-public-commit
mailing list