From: Dimitar Petrov Date: Mon, 21 Mar 2011 20:16:42 +0000 (+0100) Subject: Fix Path actions debug screen to display number of arguments X-Git-Tag: 5.80033~32 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=fb495632d15d5aa112371bb5c3c39a6189ddb9a0;hp=901991e63957ab5361ea13e867532d8d8ef2cf7a Fix Path actions debug screen to display number of arguments --- diff --git a/lib/Catalyst/DispatchType/Path.pm b/lib/Catalyst/DispatchType/Path.pm index 545e607..4c23aaa 100644 --- a/lib/Catalyst/DispatchType/Path.pm +++ b/lib/Catalyst/DispatchType/Path.pm @@ -54,8 +54,13 @@ sub list { [ $col1_width, 'Path' ], [ $col2_width, 'Private' ] ); foreach my $path ( sort keys %{ $self->_paths } ) { - my $display_path = $path eq '/' ? $path : "/$path"; foreach my $action ( @{ $self->_paths->{$path} } ) { + my $args = $action->attributes->{Args}->[0]; + my $parts = defined($args) ? '/*' x $args : '/...'; + + my $display_path = "/$path/$parts"; + $display_path =~ s{/{1,}}{/}g; + $paths->row( $display_path, "/$action" ); } }