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 2 2 100.0
total 39 40 97.5


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