X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FController.pm;h=10f290b110bf2974d2a914bf515c53c9c6047a1d;hp=b04ce962ef71148a8f195b840aca2c8fd686eb1b;hb=a0c37f08167f203244fbc479f2a7a3629797f447;hpb=ba3f8a81296a8aca76d63fc21d7a5397289e5c6f diff --git a/lib/Catalyst/Controller.pm b/lib/Catalyst/Controller.pm index b04ce96..10f290b 100644 --- a/lib/Catalyst/Controller.pm +++ b/lib/Catalyst/Controller.pm @@ -9,7 +9,10 @@ use List::Util qw/first/; use List::MoreUtils qw/uniq/; use namespace::clean -except => 'meta'; -BEGIN { extends qw/Catalyst::Component MooseX::MethodAttributes::Inheritable/; } +BEGIN { + extends qw/Catalyst::Component/; + with qw/MooseX::MethodAttributes::Role::AttrContainer::Inheritable/; +} use MooseX::MethodAttributes; use Catalyst::Exception; @@ -477,25 +480,6 @@ sub _parse_Path_attr { } } -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 +652,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. @@ -759,7 +743,7 @@ Handle various types of paths: ... sub myaction1 :Path { ... } # -> /baz - sub myaction2 :Path('foo') { ... } # -> /baz/bar + sub myaction2 :Path('foo') { ... } # -> /baz/foo sub myaction2 :Path('/bar') { ... } # -> /bar } @@ -770,7 +754,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 Use Chained methods or other techniques. +If you really depend on this, install the standalone +L distribution. A global way to match a give regular expression in the incoming request path. @@ -778,6 +764,10 @@ A global way to match a give regular expression in the incoming request path. =head2 LocalRegexp +B Use Chained methods or other techniques. +If you really depend on this, install the standalone +L distribution. + Like L but scoped under the namespace of the containing controller =head2 Chained