From: Rafael Kitover Date: Thu, 25 Jun 2009 00:41:38 +0000 (+0000) Subject: add C::DispatchType::_is_low_precedence X-Git-Tag: 5.80006~38 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=c4586fd07d4c17c49b4da9c224c6dcf1a782a099;hp=ddd00df4aedc3a55e04a9ef5109103ebfa8bba4c add C::DispatchType::_is_low_precedence --- diff --git a/lib/Catalyst/DispatchType.pm b/lib/Catalyst/DispatchType.pm index 75de1c5..0cde651 100644 --- a/lib/Catalyst/DispatchType.pm +++ b/lib/Catalyst/DispatchType.pm @@ -73,6 +73,8 @@ about expand_action. sub expand_action { } +sub _is_low_precedence { 0 } + =head1 AUTHORS Catalyst Contributors, see Catalyst.pm diff --git a/lib/Catalyst/DispatchType/Default.pm b/lib/Catalyst/DispatchType/Default.pm index a642eea..6586351 100644 --- a/lib/Catalyst/DispatchType/Default.pm +++ b/lib/Catalyst/DispatchType/Default.pm @@ -58,6 +58,8 @@ sub match { return 0; } +sub _is_low_precedence { 1 } + =head1 AUTHORS Catalyst Contributors, see Catalyst.pm diff --git a/lib/Catalyst/DispatchType/Index.pm b/lib/Catalyst/DispatchType/Index.pm index d55ca00..c0be9e6 100644 --- a/lib/Catalyst/DispatchType/Index.pm +++ b/lib/Catalyst/DispatchType/Index.pm @@ -89,6 +89,8 @@ sub uri_for_action { return "/".$action->namespace; } +sub _is_low_precedence { 1 } + =head1 AUTHORS Catalyst Contributors, see Catalyst.pm diff --git a/lib/Catalyst/Dispatcher.pm b/lib/Catalyst/Dispatcher.pm index 680a76b..9249f1c 100644 --- a/lib/Catalyst/Dispatcher.pm +++ b/lib/Catalyst/Dispatcher.pm @@ -531,8 +531,7 @@ sub register { my @low_precedence_dtypes; for my $type ( @dtypes ) { - if ($type->isa('Catalyst::DispatchType::Index') || - $type->isa('Catalyst::DispatchType::Default')) { + if ($type->_is_low_precedence) { push @low_precedence_dtypes, $type; } else { push @normal_dtypes, $type;