CatalystX::Dispatcher::AsGraph

This morning I saw this post from marcus ramberg about MojoX::Routes::AsGraph. I liked the idea. But as I Catalyst instead of Mojo, I thought I could give a try and do the same thing for Catalyst dispatcher, and I’ve coded CatalystX::Dispatcher::AsGraph. For the moment only private actions are graphed.

routes

You use it like this:

perl bin/catalyst_graph_dispatcher.pl --appname Arkham --output routes.png

You can create a simple script to output as text if you prefer:

#!/usr/bin/perl -w             
use strict;
use CatalystX::Dispatcher::AsGraph;
 
my $graph = CatalystX::Dispatcher::AsGraph->new_with_options();
$graph->run;
print $graph->graph->as_txt;

The code is on github for the moment.

For thoses who are interested by visualization, I’ll publish soon some (at least I think) really nice visualisations about CPAN, Perl, and his community, that we have created at $work.

Tags: , ,

2 Responses to “CatalystX::Dispatcher::AsGraph”

  1. Tim Bunce Says:

    Excellent! Release early release often, please :)

  2. Stephane Locatelli Says:

    I’ve a strange message and I’m not very familiar with Moose. Could you help me ?

    unknown option name ‘CatalystX::Dispatcher::AsGraph’ at /usr/local/lib/perl5/site_perl/5.8.8/MooseX/Declare/Syntax/NamespaceHandling.pm line 45
    Compilation failed in require at /usr/local/bin/catalyst_graph_dispatcher.pl line 3.
    BEGIN failed–compilation aborted at /usr/local/bin/catalyst_graph_dispatcher.pl line 3.

Leave a Reply