Fix Path actions debug screen to display number of arguments
Dimitar Petrov [Mon, 21 Mar 2011 20:16:42 +0000 (21:16 +0100)]
lib/Catalyst/DispatchType/Path.pm

index 545e607..4c23aaa 100644 (file)
@@ -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" );
         }
     }