Entirely remove Path dispatch, in favour of Chained.
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Controller.pm
index b04ce96..afa3e3f 100644 (file)
@@ -458,7 +458,10 @@ sub _parse_Absolute_attr { shift->_parse_Global_attr(@_); }
 sub _parse_Local_attr {
     my ( $self, $c, $name, $value ) = @_;
     # _parse_attr will call _parse_Path_attr for us
-    return Path => $name;
+    return (
+        'Chained' => '/',
+        'PathPart' => join( '/', $self->path_prefix($c), $name)
+    );
 }
 
 sub _parse_Relative_attr { shift->_parse_Local_attr(@_); }
@@ -466,36 +469,26 @@ sub _parse_Relative_attr { shift->_parse_Local_attr(@_); }
 sub _parse_Path_attr {
     my ( $self, $c, $name, $value ) = @_;
     $value = '' if !defined $value;
-    if ( $value =~ m!^/! ) {
-        return ( 'Path', $value );
+    if ( $value =~ s!^/!! ) {
+        return (
+            'Chained' => '/',
+            'PathPart' => $value
+        );
     }
     elsif ( length $value ) {
-        return ( 'Path', join( '/', $self->path_prefix($c), $value ) );
+        return (
+            'Chained' => '/',
+            'PathPart' => join( '/', $self->path_prefix($c), $value )
+        );
     }
     else {
-        return ( 'Path', $self->path_prefix($c) );
+        return (
+            'Chained' => '/',
+            'PathPart' => $self->path_prefix($c)
+        );
     }
 }
 
-sub _parse_Regex_attr {
-    my ( $self, $c, $name, $value ) = @_;
-    return ( 'Regex', $value );
-}
-
-sub _parse_Regexp_attr { shift->_parse_Regex_attr(@_); }
-
-sub _parse_LocalRegex_attr {
-    my ( $self, $c, $name, $value ) = @_;
-    unless ( $value =~ s/^\^// ) { $value = "(?:.*?)$value"; }
-
-    my $prefix = $self->path_prefix( $c );
-    $prefix .= '/' if length( $prefix );
-
-    return ( 'Regex', "^${prefix}${value}" );
-}
-
-sub _parse_LocalRegexp_attr { shift->_parse_LocalRegex_attr(@_); }
-
 sub _parse_Chained_attr {
     my ($self, $c, $name, $value) = @_;
 
@@ -668,7 +661,7 @@ overridden from the "namespace" config key.
 
 =head2 $self->path_prefix($c)
 
-Returns the default path prefix for :PathPrefix, :Local, :LocalRegex and
+Returns the default path prefix for :PathPrefix, :Local and
 relative :Path actions in this component. Defaults to the action_namespace or
 can be overridden from the "path" config key.
 
@@ -770,7 +763,9 @@ This is a general toolbox for attaching your action to a give path.
 
 =head2 Regexp
 
-Status: Deprecated.  Use Chained methods or other techniques
+B<Status: Deprecated.>  Use Chained methods or other techniques.
+If you really depend on this, install the standalone 
+L<Catalyst::DispatchType::Regex> distribution.
 
 A global way to match a give regular expression in the incoming request path.
 
@@ -778,6 +773,10 @@ A global way to match a give regular expression in the incoming request path.
 
 =head2 LocalRegexp
 
+B<Status: Deprecated.>  Use Chained methods or other techniques.
+If you really depend on this, install the standalone 
+L<Catalyst::DispatchType::Regex> distribution.
+
 Like L</Regex> but scoped under the namespace of the containing controller
 
 =head2 Chained