use strict;
use base qw/Catalyst::DispatchType/;
+use Text::ASCIITable;
=head1 NAME
=over 4
+=item $self->list($c)
+
+=cut
+
+sub list {
+ my ( $self, $c ) = @_;
+ my $paths = Text::ASCIITable->new;
+ $paths->setCols( 'Path', 'Private' );
+ $paths->setColWidth( 'Path', 36, 1 );
+ $paths->setColWidth( 'Private', 37, 1 );
+ for my $path ( sort keys %{ $self->{paths} } ) {
+ my $action = $self->{paths}->{$path};
+ $paths->addRow( "/$path", "/$action" );
+ }
+ $c->log->debug( "Loaded Path actions:\n" . $paths->draw )
+ if ( @{ $paths->{tbl_rows} } );
+}
+
=item $self->match( $c, $path )
=cut
$c->req->action($path);
$c->req->match($path);
$c->action($action);
- $c->namespace( $action->prefix );
+ $c->namespace( $action->namespace );
return 1;
}
foreach my $r ( @{ $attrs->{Path} || [] } ) {
unless ( $r =~ m!^/! ) { # It's a relative path
- $r = $action->prefix . "/$r";
+ $r = $action->namespace . "/$r";
}
push( @register, $r );
}
}
if ( $attrs->{Local} || $attrs->{Relative} ) {
- push( @register, join( '/', $action->prefix, $action->name ) );
+ push( @register, join( '/', $action->namespace, $action->name ) );
# Register sub name as a relative path
}