The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

graph-meta.pl - graph-meta.pl - create graphs for Moose Objects

VERSION

version 1.03

SYNOPSIS

   shell$ graph-meta.pl --package='My::Package::Name' --output='diagram.png'

DESCRIPTION

This command allows you to create graphs of your Moose classes showing a directed graph of the parent classes and roles that your class consumes recursively. In short, it can visually answer the questions like "Why did I end up consuming that role" and, with the right renderer backend, "Where did that method come from?"

This is best shown with a couple of examples

With the GraphViz renderer (no methods/attributes):

With the PlantUML renderer:

Command Line Options

package

Required. The name of the package that you're going to be generating a graph for.

renderer

The renderer you'd like to use. For example:

   graph-meta.pl --renderer=plantuml --package='My::Package::Name' --output='diagram.png'

This is programmatically transformed into the class name that performs the renderer (by adding command )

Renderers bundled with this distribution can be accessed with the graphviz or plantuml options (that load either the Meta::Grapher::Moose::Renderer::Graphviz or Meta::Grapher::Moose::Renderer::Plantuml renderers.) By default graphviz is used.

Renderer output options

Both the graphviz and plantuml renderers support the following command line options (though it's conceivable that other third party renderers do not support these options)

output

The name of the file that output should be written to. For example foo.png. If no output is specified then output will be sent to STDOUT.

format

The format of the output, for example png or svg.

If this is not specified then, if possible, it will be extracted from the extension of the output. If either the output has not been set or the output filename has no file extension then the output will default to outputting the source code for the external tool the renderer uses (i.e. it'll be dot format for the graphviz renderer and plantuml source for the plantuml renderer.)

formatting

This can be used to set extra formatting information for the graph (colors, etc.) Please see the documentation for the individual classes on how this can be set.

SUPPORT

Bugs may be submitted through the RT bug tracker (or bug-meta-grapher-moose@rt.cpan.org).

I am also usually active on IRC as 'drolsky' on irc://irc.perl.org.

AUTHOR

Dave Rolsky <autarch@urth.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2016 by Dave Rolsky.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)