X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FDispatchType%2FPath.pm;h=9135d70fbfbac817faa5a0690329c1d3488aafc1;hb=e73e3bad5248d5d16e6b32024ca341d1208e7bcb;hp=d983d8a0f7e11639e380d03f28750f82933d3525;hpb=53119b7876049abfe0d4e4bea5e85724dd4778d7;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/DispatchType/Path.pm b/lib/Catalyst/DispatchType/Path.pm index d983d8a..9135d70 100644 --- a/lib/Catalyst/DispatchType/Path.pm +++ b/lib/Catalyst/DispatchType/Path.pm @@ -3,6 +3,7 @@ package Catalyst::DispatchType::Path; use strict; use base qw/Catalyst::DispatchType/; use Text::SimpleTable; +use Catalyst::Utils; use URI; =head1 NAME @@ -25,7 +26,10 @@ Debug output for Path dispatch points sub list { my ( $self, $c ) = @_; - my $paths = Text::SimpleTable->new( [ 35, 'Path' ], [ 36, 'Private' ] ); + my $column_width = Catalyst::Utils::term_width() - 35 - 9; + my $paths = Text::SimpleTable->new( + [ 35, 'Path' ], [ $column_width, 'Private' ] + ); foreach my $path ( sort keys %{ $self->{paths} } ) { my $display_path = $path eq '/' ? $path : "/$path"; foreach my $action ( @{ $self->{paths}->{$path} } ) { @@ -47,7 +51,7 @@ first action that matches, if any; if not, returns 0. sub match { my ( $self, $c, $path ) = @_; - $path = '/' if !defined $path; + $path = '/' if !defined $path || !length $path; foreach my $action ( @{ $self->{paths}->{$path} || [] } ) { next unless $action->match($c); @@ -118,10 +122,9 @@ sub uri_for_action { } } -=head1 AUTHOR +=head1 AUTHORS -Matt S Trout -Sebastian Riedel, C +Catalyst Contributors, see Catalyst.pm =head1 COPYRIGHT