Skip to content

Instantly share code, notes, and snippets.

@jjn1056
Created July 22, 2015 15:40
Show Gist options
  • Save jjn1056/a455d0cf857871c40ab8 to your computer and use it in GitHub Desktop.
Save jjn1056/a455d0cf857871c40ab8 to your computer and use it in GitHub Desktop.
package Lace::Test::Controller::Root;
use Moose;
use MooseX::MethodAttributes;
extends 'Catalyst::Controller';
sub root :Chained(/) PathPart('') CaptureArgs(0) { }
sub part1 :Chained(root) { }
sub part2 :Chained(part1) { }
__PACKAGE__->meta->make_immutable;
__END__
[debug] Loaded Chained actions:
.-------------------------------------------------------+-------------------------------------------------------.
| Path Spec | Private |
+-------------------------------------------------------+-------------------------------------------------------+
| /part1/... | /root (0) |
| | => /part1 (...) |
| /part1/part2/... | /root (0) |
| | -> /part1 (0) |
| | => /part2 (...) |
'-------------------------------------------------------+-------------------------------------------------------'
@jjn1056
Copy link
Author

jjn1056 commented Jul 22, 2015

even worse

package Lace::Test::Controller::Root;

use Moose;
use MooseX::MethodAttributes;

extends 'Catalyst::Controller';

sub root :Chained(/) PathPart('') CaptureArgs(0) { }

sub part1 :Chained(root) Args(1) { }

sub part2 :Chained(part1) { }

PACKAGE->meta->make_immutable;

END

[debug] Loaded Chained actions:
.-------------------------------------------------------+-------------------------------------------------------.
| Path Spec | Private |
+-------------------------------------------------------+-------------------------------------------------------+
| /part1/* | /root (0) |
| | => /part1 (1) |
| /part1/part2/... | /root (0) |
| | -> /part1 (0) |
| | => /part2 (...) |
'-------------------------------------------------------+-------------------------------------------------------'

@jjn1056
Copy link
Author

jjn1056 commented Jul 22, 2015

you can see the whole 'midpoint can be an endpoint' gets really confused when you declare Args(1). you get an endpoint with Args(1) AND a midpoint with CaptureArgs(0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment