drop namespace::autoclean
[catagits/Catalyst-Runtime.git] / t / lib / ChainedActionsApp / Controller / Root.pm
index e1f0ae9..e061123 100644 (file)
@@ -1,6 +1,6 @@
 package ChainedActionsApp::Controller::Root;
 use Moose;
-use namespace::autoclean;
+use namespace::clean -except => [ 'meta' ];
 
 BEGIN { extends 'Catalyst::Controller' }
 
@@ -10,24 +10,6 @@ BEGIN { extends 'Catalyst::Controller' }
 #
 __PACKAGE__->config(namespace => '');
 
-=head1 NAME
-
-test_chained::Controller::Root - Root Controller for test_chained
-
-=head1 DESCRIPTION
-
-[enter your description here]
-
-=head1 METHODS
-
-=head2 setup
-
-This is the C<setup> method that initializes the request. Any matching action
-will go through this, so it is an application-wide automatically executed
-action. For more information, see L<Catalyst::DispatchType::Chained>
-
-=cut
-
 sub setup : Chained('/') PathPart('') CaptureArgs(0) {
     my ( $self, $c ) = @_;
     # Common things here are to check for ACL and setup global contexts
@@ -38,14 +20,6 @@ sub home : Chained('setup') PathPart('') Args(0) {
     $c->response->body( "Application Home Page" );
 }
 
-=head2 home_base
-
-     Args:
-       project_id
-       project_title
-
-=cut
-
 sub home_base : Chained('setup') PathPart('') CaptureArgs(2) {
     my($self,$c,$proj_id,$title) = @_;
     $c->stash({project_id=>$proj_id, project_title=>$title});
@@ -76,36 +50,39 @@ sub account : Chained('account_base') PathPart('') Args(0) {
     $c->response->body( "This is account " . $c->stash->{account_id} );
 }
 
-=head2 default
-
-Standard 404 error page
-
-=cut
+sub profile_base : Chained('setup') PathPart('account/profile') CaptureArgs(1) {
+    my($self,$c,$acc_id) = @_;
+    $c->stash({account_id=>$acc_id});
+}
 
-sub default : Chained('setup') PathPart('') Args() {
-    my ( $self, $c ) = @_;
-    $c->response->body( 'Page not found' );
-    $c->response->status(404);
+sub profile : Chained('profile_base') PathPart('') Args(1) {
+    my($self,$c,$acc) = @_;
+    $c->response->body( "This is profile of " . $acc );
 }
 
-=head2 end
+=head2 downloads
 
-Attempt to render a view, if needed.
+    This is a different test, this function is void, just to let following in the chain
+    to declare downloads as PathPart.
 
 =cut
 
-sub end : ActionClass('RenderView') {}
-
-=head1 AUTHOR
-
-Ferruccio Zamuner
+sub downloads : Chained('setup') PathPart('') CaptureArgs(0) {
+    my($self,$c) = @_;
+}
 
-=head1 LICENSE
+sub downloads_index : Chained('downloads') PathPart('downloads') Args(0) {
+    my($self,$c) = @_;
+    $c->response->body( "This is download index");
+}
 
-This library is free software. You can redistribute it and/or modify
-it under the same terms as Perl itself.
+sub default : Chained('setup') PathPart('') Args() {
+    my ( $self, $c ) = @_;
+    $c->response->body( 'Page not found' );
+    $c->response->status(404);
+}
 
-=cut
+sub end : Action {}
 
 __PACKAGE__->meta->make_immutable;