X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FDispatchType%2FRegex.pm;h=313a5c3d2f06cc1ba300ea4e89c04a48d085c543;hp=b906f6967d26579288cd26277277fca3ed560929;hb=8c11318848e17f92027484614d393b6ebd365f7d;hpb=fe958228637b4d263d563f64303d1511176ac545 diff --git a/lib/Catalyst/DispatchType/Regex.pm b/lib/Catalyst/DispatchType/Regex.pm index b906f69..313a5c3 100644 --- a/lib/Catalyst/DispatchType/Regex.pm +++ b/lib/Catalyst/DispatchType/Regex.pm @@ -2,7 +2,7 @@ package Catalyst::DispatchType::Regex; use strict; use base qw/Catalyst::DispatchType::Path/; -use Text::ASCIITable; +use Text::SimpleTable; =head1 NAME @@ -24,17 +24,14 @@ See L. sub list { my ( $self, $c ) = @_; - my $re = Text::ASCIITable->new; - $re->setCols( 'Regex', 'Private' ); - $re->setColWidth( 'Regex', 36, 1 ); - $re->setColWidth( 'Private', 37, 1 ); + my $re = Text::SimpleTable->new( [ 36, 'Regex' ], [ 37, 'Private' ] ); for my $regex ( @{ $self->{compiled} } ) { my $compiled = $regex->{re}; my $action = $regex->{action}; - $re->addRow( $compiled, "/$action" ); + $re->row( $compiled, "/$action" ); } $c->log->debug( "Loaded Regex actions:\n" . $re->draw ) - if ( @{ $re->{tbl_rows} } ); + if ( @{ $self->{compiled} } ); } =item $self->match( $c, $path ) @@ -71,8 +68,8 @@ sub register { my $attrs = $action->attributes; my @register = map { @{ $_ || [] } } @{$attrs}{ 'Regex', 'Regexp' }; foreach my $r (@register) { - unless ($r =~ /^\^/) { # Relative regex - $r = '^'.$action->namespace.'/'.$r; + unless ( $r =~ /^\^/ ) { # Relative regex + $r = '^' . $action->namespace . '/' . $r; } $self->{paths}{$r} = $action; # Register path for superclass push(