File Coverage

blib/lib/Data/Dumper/Concise/Aligned.pm
Criterion Covered Total %
statement 26 26 100.0
branch 3 4 75.0
condition n/a
subroutine 8 8 100.0
pod 0 2 0.0
total 37 40 92.5


line stmt bran cond sub pod time code
1             package Data::Dumper::Concise::Aligned;
2              
3 1     1   41761 use 5.010000;
  1         4  
  1         43  
4 1     1   6 use strict;
  1         2  
  1         82  
5 1     1   12 use warnings;
  1         7  
  1         33  
6 1     1   5 use Scalar::Util qw/reftype/;
  1         2  
  1         138  
7 1     1   10654 use Text::Wrap qw/wrap/;
  1         3834  
  1         112  
8              
9             our $VERSION = '0.23';
10             our @ISA;
11              
12             require Exporter;
13             require Data::Dumper;
14              
15 1     1   407 BEGIN { @ISA = qw/Exporter/ }
16             our @EXPORT = qw/DumperA DumperObjectA/;
17              
18             sub DumperObjectA {
19 1     1 0 11 my $dd = Data::Dumper->new( [] );
20 1         50 $dd->Terse(1)->Indent(0)->Useqq(1)->Deparse(1)->Quotekeys(0)->Sortkeys(1);
21             }
22              
23             sub DumperA {
24 1     1 0 946 my $str_buf;
25 1         3 my $prefix = '';
26 1         3 for my $o (@_) {
27 2 100       14 if ( defined reftype $o) {
28 1         5 $str_buf .=
29             wrap( $prefix, $prefix, DumperObjectA->Values( [$o] )->Dump ) . "\n";
30             } else {
31 1         3 $prefix = $o;
32 1 50       7 $prefix .= ' ' unless $prefix =~ m/\s$/;
33             }
34             }
35 1         1572 return $str_buf;
36             }
37              
38             1;
39             __END__