File Coverage

blib/lib/Devel/Command/Viz.pm
Criterion Covered Total %
statement 10 12 83.3
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 14 16 87.5


line stmt bran cond sub pod time code
1             package Devel::Command::Viz;
2              
3 1     1   28263 use 5.006;
  1         4  
  1         34  
4 1     1   6 use strict;
  1         2  
  1         33  
5 1     1   6 use warnings;
  1         5  
  1         34  
6 1     1   498 use GraphViz::Data::Structure;
  0            
  0            
7             use File::Temp qw(tempfile);
8              
9             use base qw(Devel::Command);
10              
11             our $VERSION = '0.02';
12              
13             sub command {
14             my ($arg) = (shift =~ /viz\s+(.*)/);
15             chomp $arg;
16             my $gvds = new GraphViz::Data::Structure(&eval($arg));
17             my ($fh, $filename) = tempfile();
18             print $fh $gvds->graph->as_canon;
19             close $fh;
20             system "dotty $filename";
21             1;
22             }
23              
24             1;
25             __END__