File Coverage

blib/lib/Data/Tabulate/Plugin/ASCIITable.pm
Criterion Covered Total %
statement 9 15 60.0
branch n/a
condition n/a
subroutine 3 5 60.0
pod 2 2 100.0
total 14 22 63.6


line stmt bran cond sub pod time code
1             package Data::Tabulate::Plugin::ASCIITable;
2              
3             # ABSTRACT: generate ASCII tables with Data::Tabulate
4              
5 2     2   57110 use warnings;
  2         10  
  2         55  
6 2     2   8 use strict;
  2         3  
  2         32  
7 2     2   737 use Text::Table::Tiny;
  2         2939  
  2         298  
8              
9             our $VERSION = '0.04';
10              
11              
12             sub new{
13 0     0 1   return bless {}, shift;
14             }
15              
16              
17             sub output{
18 0     0 1   my ($self,@data) = @_;
19              
20 0           my $table = Text::Table::Tiny::table( rows => \@data );
21              
22             # some minor changes to generate the same output as the 0.01 version
23             # with Text::ASCIITable 0.17
24 0           $table =~ s/\+([+-]+)\+\n/.$1.\n/;
25 0           $table =~ s/\+([+-]+)\+\z/'$1'\n/ms;
26              
27 0           return $table;
28             }
29              
30             1; # End of Data::Tabulate::Plugin::ASCIITable
31              
32             __END__