use Moose;
extends 'Catalyst::DispatchType::Path';
+
use Text::SimpleTable;
use Text::Balanced ();
-has _compiled => (is => 'rw', isa => 'ArrayRef', required => 1, default => sub{[]});
+has _compiled => (
+ is => 'rw',
+ isa => 'ArrayRef',
+ required => 1,
+ default => sub{ [] },
+ );
+
+no Moose;
=head1 NAME
sub list {
my ( $self, $c ) = @_;
- my @regexes = @{ $self->_compiled };
- return unless @regexes;
my $re = Text::SimpleTable->new( [ 35, 'Regex' ], [ 36, 'Private' ] );
- for my $regex ( @regexes ) {
+ for my $regex ( @{ $self->_compiled } ) {
my $action = $regex->{action};
$re->row( $regex->{path}, "/$action" );
}
- $c->log->debug( "Loaded Regex actions:\n" . $re->draw . "\n" );
+ $c->log->debug( "Loaded Regex actions:\n" . $re->draw . "\n" )
+ if ( @{ $self->_compiled } );
}
=head2 $self->match( $c, $path )
=cut
-override match => sub {
+sub match {
my ( $self, $c, $path ) = @_;
- return if super();
+ return if $self->SUPER::match( $c, $path );
# Check path against plain text first
return undef;
}
-=head1 AUTHOR
+=head1 AUTHORS
-Matt S Trout
-Sebastian Riedel, C<sri@cpan.org>
+Catalyst Contributors, see Catalyst.pm
=head1 COPYRIGHT
=cut
+__PACKAGE__->meta->make_immutable;
+
1;