Fixed public action lists
[catagits/Catalyst-Runtime.git] / lib / Catalyst / DispatchType / Regex.pm
index c373d2f..975aebb 100644 (file)
@@ -2,6 +2,7 @@ package Catalyst::DispatchType::Regex;
 
 use strict;
 use base qw/Catalyst::DispatchType::Path/;
+use Text::ASCIITable;
 
 =head1 NAME
 
@@ -17,6 +18,25 @@ See L<Catalyst>.
 
 =over 4
 
+=item $self->list($c)
+
+=cut
+
+sub list {
+    my ( $self, $c ) = @_;
+    my $re = Text::ASCIITable->new;
+    $re->setCols( 'Regex', 'Private' );
+    $re->setColWidth( 'Regex',   36, 1 );
+    $re->setColWidth( 'Private', 37, 1 );
+    for my $regex ( @{ $self->{compiled} } ) {
+        my $compiled = $regex->{re};
+        my $action   = $regex->{action};
+        $re->addRow( $compiled, "/$action" );
+    }
+    $c->log->debug( "Loaded Regex actions:\n" . $re->draw )
+      if ( @{ $re->{tbl_rows} } );
+}
+
 =item $self->match( $c, $path )
 
 =cut