Bread::Board::GraphViz::App - display a L<Bread::Board>'s dependency graph


Bread-Board documentation Contained in the Bread-Board distribution.

Index


Code Index:

NAME

Top

Bread::Board::GraphViz::App - display a Bread::Board's dependency graph

SYNOPSIS

Top

See visualize-breadboard.pl.

BUGS

Top

All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT.

AUTHOR

Top

Jonathan Rockway - <jrockway@cpan.org>

COPYRIGHT AND LICENSE

Top


Bread-Board documentation Contained in the Bread-Board distribution.

package Bread::Board::GraphViz::App;
use Moose;

use Bread::Board::GraphViz;

our $AUTHORITY = 'cpan:STEVAN';
our $VERSION   = '0.20';

with 'MooseX::Runnable';

sub run {
    my ($self, @code) = @_;
    my $board = eval( 'no strict; '. join ' ', @code );
    die if $@;

    if(!blessed $board || !$board->isa('Bread::Board::Container')){
        print {*STDERR} "That code did not evaluate to a Bread::Board::Container.\n";
        return 1;
    }

    my $g = Bread::Board::GraphViz->new;
    $g->add_container($board);
    print $g->graph->as_debug;

    return 0;
}

__PACKAGE__->meta->make_immutable;

no Moose; 1;

__END__