File Coverage

blib/lib/Plack/App/Data/Printer.pm
Criterion Covered Total %
statement 27 27 100.0
branch 2 2 100.0
condition n/a
subroutine 8 8 100.0
pod 2 2 100.0
total 39 39 100.0


line stmt bran cond sub pod time code
1             package Plack::App::Data::Printer;
2              
3 3     3   85007 use base qw(Plack::Component);
  3         14  
  3         1169  
4 3     3   29850 use strict;
  3         6  
  3         46  
5 3     3   12 use warnings;
  3         6  
  3         55  
6              
7 3     3   1381 use Data::Printer;
  3         76064  
  3         16  
8 3     3   2502 use Error::Pure qw(err);
  3         24879  
  3         46  
9 3     3   1225 use Plack::Util::Accessor qw(data);
  3         686  
  3         19  
10              
11             our $VERSION = 0.03;
12              
13             sub call {
14 1     1 1 8 my ($self, $env) = @_;
15              
16 1         2 my $output;
17 1         4 my $data = $self->data;
18 1         7 p $data, 'output' => \$output;
19              
20             return [
21 1         5462 200,
22             ['Content-Type' => 'text/plain'],
23             [$output],
24             ];
25             }
26              
27             sub prepare_app {
28 2     2 1 20820 my $self = shift;
29              
30 2 100       5 if (! $self->data) {
31 1         7 err 'No data.';
32             }
33              
34 1         8 return;
35             }
36              
37             1;
38              
39             __END__