script/graph-meta.pl untested

filter: Statementstmt 0.0% 0 / 11 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod n/a totaltotal 0.0% 0 / 14 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 #!/usr/bin/env perl
2  
3 use strict;
4 use warnings;
5  
6 # PODNAME: graph-meta.pl
7  
8 our $VERSION = '1.03';
9  
10 use Meta::Grapher::Moose::CommandLine;
11 exit Meta::Grapher::Moose::CommandLine->run;
12  
13 =pod
14  
15 =encoding UTF-8
16  
17 =head1 NAME
18  
19 graph-meta.pl - graph-meta.pl - create graphs for Moose Objects
20  
21 =head1 VERSION
22  
23 version 1.03
24  
25 =head1 SYNOPSIS
26  
27 shell$ graph-meta.pl --package='My::Package::Name' --output='diagram.png'
28  
29 =head1 DESCRIPTION
30  
31 This command allows you to create graphs of your Moose classes showing a
32 directed graph of the parent classes and roles that your class consumes
33 recursively. In short, it can visually answer the questions like "Why did I end
34 up consuming that role" and, with the right renderer backend, "Where did that
35 method come from?"
36  
37 This is best shown with a couple of examples
38  
39 With the GraphViz renderer (no methods/attributes):
40  
41 =for text http://st.aticpan.org/source/DROLSKY/Meta-Grapher-Moose-1.00/examples/output/graphviz/example.png
42 =for html
43 <img src="http://st.aticpan.org/source/DROLSKY/Meta-Grapher-Moose-1.00/examples/output/graphviz/example.png">
44  
45 With the PlantUML renderer:
46  
47 =for text http://st.aticpan.org/source/DROLSKY/Meta-Grapher-Moose-1.00/examples/output/plantuml/example.png
48 =for html
49 <img src="http://st.aticpan.org/source/DROLSKY/Meta-Grapher-Moose-1.00/examples/output/plantuml/example.png">
50  
51 =head2 Command Line Options
52  
53 =head4 package
54  
55 Required. The name of the package that you're going to be generating a
56 graph for.
57  
58 =head4 renderer
59  
60 The renderer you'd like to use. For example:
61  
62 graph-meta.pl --renderer=plantuml --package='My::Package::Name' --output='diagram.png'
63  
64 This is programmatically transformed into the class name that performs the
65 renderer (by adding command )
66  
67 Renderers bundled with this distribution can be accessed with the C<graphviz>
68 or C<plantuml> options (that load either the
69 L<Meta::Grapher::Moose::Renderer::Graphviz> or
70 L<Meta::Grapher::Moose::Renderer::Plantuml> renderers.) By default C<graphviz>
71 is used.
72  
73 =head3 Renderer output options
74  
75 Both the C<graphviz> and C<plantuml> renderers support the following command
76 line options (though it's conceivable that other third party renderers do not
77 support these options)
78  
79 =head4 output
80  
81 The name of the file that output should be written to. For example C<foo.png>.
82 If no output is specified then output will be sent to STDOUT.
83  
84 =head4 format
85  
86 The format of the output, for example C<png> or C<svg>.
87  
88 If this is not specified then, if possible, it will be extracted from the
89 extension of the C<output>. If either the C<output> has not been set or the
90 output filename has no file extension then the output will default to outputting
91 the source code for the external tool the renderer uses (i.e. it'll be C<dot>
92 format for the C<graphviz> renderer and C<plantuml> source for the C<plantuml>
93 renderer.)
94  
95 =head3 formatting
96  
97 This can be used to set extra formatting information for the graph (colors,
98 etc.) Please see the documentation for the individual classes on how this can be
99 set.
100  
101 =head1 SUPPORT
102  
103 Bugs may be submitted through L<the RT bug tracker|http://rt.cpan.org/Public/Dist/Display.html?Name=Meta-Grapher-Moose>
104 (or L<bug-meta-grapher-moose@rt.cpan.org|mailto:bug-meta-grapher-moose@rt.cpan.org>).
105  
106 I am also usually active on IRC as 'drolsky' on C<irc://irc.perl.org>.
107  
108 =head1 AUTHOR
109  
110 Dave Rolsky <autarch@urth.org>
111  
112 =head1 COPYRIGHT AND LICENSE
113  
114 This software is Copyright (c) 2016 by Dave Rolsky.
115  
116 This is free software, licensed under:
117  
118 The Artistic License 2.0 (GPL Compatible)
119  
120 =cut
121  
122 __END__