daily pastebin goal
10%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!perl
  2.  
  3. use strict;
  4. use warnings;
  5. use Test::More 'no_plan';
  6.  
  7. use MojoX::Routes;
  8. use MojoX::Routes::AsGraph;
  9.  
  10. ### The top level container
  11. my $r = MojoX::Routes->new;
  12.  
  13. ### A couple of simple paths
  14. $r->route('/')->to( controller => 'site', action => 'homepage' );
  15. $r->route('/about')->to( controller => 'site', action => 'about' );
  16.  
  17. my $g = MojoX::Routes::AsGraph->new({ routes => $r });
  18. ok($g);
  19.  
  20. my $graph = $g->graph($r);
  21. print $graph->as_ascii;
  22.  
  23. +---------+     +----------+
  24. | <empty> | --> | * /about |
  25. +---------+     +----------+
  26.   |
  27.   |
  28.   v
  29. +---------+
  30. |   * /   |
  31. +---------+
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top