tests are passing
[catagits/CatalystX-Routes.git] / lib / CatalystX / Routes.pm
index 0d7f6b9..e284835 100644 (file)
@@ -92,6 +92,19 @@ sub _process_args {
 
     $p{ActionClass} ||= 'REST';
 
+    unless ( exists $p{Chained} ) {
+        $p{Chained} = q{/};
+
+        unless ( exists $p{PathPart} ) {
+            ( my $part = $path ) =~ s{^/}{};
+            $p{PathPart} = [$part];
+        }
+    }
+
+    unless ( exists $p{Args} ) {
+        $p{Args} = [0];
+    }
+
     ( my $name = $path ) =~ s/(\W)/'X' . sprintf( '%x', ord($1) )/eg;
 
     return $name, \%p, $sub;