qw/counter depth request response state action namespace/
);
-attributes->import(__PACKAGE__, \&namespace, 'lvalue');
+attributes->import( __PACKAGE__, \&namespace, 'lvalue' );
# Laziness++
*comp = \&component;
$class->setup_components;
if ( $class->debug ) {
- my $t = Text::SimpleTable->new(76);
- $t->row($_) for sort keys %{ $class->components };
+ my $t = Text::SimpleTable->new( [ 37, 'Class' ], [ 36, 'Type' ] );
+ for my $comp ( sort keys %{ $class->components } ) {
+ my $type = ref $class->components->{$comp} ? 'instance' : 'class';
+ $t->row( $comp, $type );
+ }
$class->log->debug( "Loaded components:\n" . $t->draw )
if ( keys %{ $class->components } );
}
=cut
-sub get_action { my $c = shift; $c->dispatcher->get_action( @_ ) }
+sub get_action { my $c = shift; $c->dispatcher->get_action(@_) }
=item $c->get_actions( $action, $namespace )
package Catalyst::Component;
use strict;
-use base qw/Class::Data::Inheritable/;
+use base qw/Class::Accessor::Fast Class::Data::Inheritable/;
use NEXT;
__PACKAGE__->mk_classdata($_) for qw/_config/;
return unless @match;
- if ( my $action = $match[-1]->get_action( $name ) ) {
+ if ( my $action = $match[-1]->get_action($name) ) {
return $action if $action->namespace eq $namespace;
}
}
my @match = $self->get_containers($namespace);
- return map { $_->get_action( $action ) } @match;
+ return map { $_->get_action($action) } @match;
}
=item $self->get_containers( $namespace )
return unless $c->debug;
- my $privates = Text::SimpleTable->new( [ 36, 'Private' ], [ 37, 'Class' ] );
+ my $privates = Text::SimpleTable->new(
+ [ 24, 'Private' ],
+ [ 23, 'Class' ],
+ [ 23, 'Method' ]
+ );
my $has_private = 0;
my $walker = sub {
next
if ( ( $action =~ /^_.*/ )
&& ( !$c->config->{show_internal_actions} ) );
- $privates->row( "$prefix$action", $action_obj->class );
+ $privates->row( "$prefix$action", $action_obj->class, $action );
$has_private = 1;
}
package TestApp::Controller::Action;
use strict;
-use base 'Catalyst::Base';
+use base 'Catalyst::Controller';
sub begin : Private {
my ( $self, $c ) = @_;