X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FEngine.pm;h=fa8d9f1c5909684928ecdda7d824ac86e8bb1c7c;hb=b460ad78a952bcaaa8f468d6e578c17002d0645b;hp=262b91e856f9a206c2e5fc737a2fceaf8182b4f3;hpb=55c388c1c0fc13e0c8aae18f7957ab942cc28797;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index 262b91e..fa8d9f1 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -167,7 +167,7 @@ sub finalize { if ( my $location = $c->response->redirect ) { $c->log->debug(qq/Redirecting to "$location"/) if $c->debug; $c->response->header( Location => $location ); - $c->response->status(302) if $c->response->status !~ /3\d\d$/; + $c->response->status(302) if $c->response->status !~ /^3\d\d$/; } if ( $#{ $c->error } >= 0 ) { @@ -862,7 +862,7 @@ sub setup_components { $self->components->{ ref $comp } = $comp; $self->setup_actions($comp); } - my $t = Text::ASCIITable->new; + my $t = Text::ASCIITable->new({ hide_HeadRow => 1, hide_HeadLine => 1}); $t->setCols('Class'); $t->setColWidth( 'Class', 75, 1 ); $t->addRow( wrap( $_, 75 ) ) for keys %{ $self->components }; @@ -870,10 +870,10 @@ sub setup_components { if ( @{ $t->{tbl_rows} } && $self->debug ); my $actions = $self->actions; my $privates = Text::ASCIITable->new; - $privates->setCols( 'Action', 'Class', 'Code' ); - $privates->setColWidth( 'Action', 28, 1 ); - $privates->setColWidth( 'Class', 28, 1 ); - $privates->setColWidth( 'Code', 14, 1 ); + $privates->setCols( 'Private', 'Class', 'Code' ); + $privates->setColWidth( 'Private', 28, 1 ); + $privates->setColWidth( 'Class', 28, 1 ); + $privates->setColWidth( 'Code', 14, 1 ); my $walker = sub { my ( $walker, $parent, $prefix ) = @_; $prefix .= $parent->getNodeValue || ''; @@ -893,33 +893,25 @@ sub setup_components { $self->log->debug( 'Loaded private actions', $privates->draw ) if ( @{ $privates->{tbl_rows} } && $self->debug ); my $publics = Text::ASCIITable->new; - $publics->setCols( 'Action', 'Class', 'Code' ); - $publics->setColWidth( 'Action', 28, 1 ); - $publics->setColWidth( 'Class', 28, 1 ); - $publics->setColWidth( 'Code', 14, 1 ); + $publics->setCols( 'Public', 'Private' ); + $publics->setColWidth( 'Public', 37, 1 ); + $publics->setColWidth( 'Private', 36, 1 ); for my $plain ( sort keys %{ $actions->{plain} } ) { my ( $class, $code ) = @{ $actions->{plain}->{$plain} }; - $publics->addRow( - wrap( "/$plain", 28 ), - wrap( $class, 28 ), - wrap( $code, 14 ) - ); + $publics->addRow( wrap( "/$plain", 37 ), + wrap( $self->actions->{reverse}->{$code} || $code, 36 ) ); } $self->log->debug( 'Loaded public actions', $publics->draw ) if ( @{ $publics->{tbl_rows} } && $self->debug ); my $regexes = Text::ASCIITable->new; - $regexes->setCols( 'Action', 'Class', 'Code' ); - $regexes->setColWidth( 'Action', 28, 1 ); - $regexes->setColWidth( 'Class', 28, 1 ); - $regexes->setColWidth( 'Code', 14, 1 ); + $regexes->setCols( 'Regex', 'Private' ); + $regexes->setColWidth( 'Regex', 37, 1 ); + $regexes->setColWidth( 'Private', 36, 1 ); for my $regex ( sort keys %{ $actions->{regex} } ) { my ( $class, $code ) = @{ $actions->{regex}->{$regex} }; - $regexes->addRow( - wrap( $regex, 28 ), - wrap( $class, 28 ), - wrap( $code, 14 ) - ); + $regexes->addRow( wrap( $regex, 37 ), + wrap( $self->actions->{reverse}->{$class} || $class, 36 ) ); } $self->log->debug( 'Loaded regex actions', $regexes->draw ) if ( @{ $regexes->{tbl_rows} } && $self->debug );