Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!perl
- use strict;
- use warnings;
- use Test::More 'no_plan';
- use MojoX::Routes;
- use MojoX::Routes::AsGraph;
- ### The top level container
- my $r = MojoX::Routes->new;
- ### A couple of simple paths
- $r->route('/')->to( controller => 'site', action => 'homepage' );
- $r->route('/about')->to( controller => 'site', action => 'about' );
- my $g = MojoX::Routes::AsGraph->new({ routes => $r });
- ok($g);
- my $graph = $g->graph($r);
- print $graph->as_ascii;
- +---------+ +----------+
- | <empty> | --> | * /about |
- +---------+ +----------+
- |
- |
- v
- +---------+
- | * / |
- +---------+
Add Comment
Please, Sign In to add comment