File Coverage

blib/lib/Plack/Middleware/XFramework.pm
Criterion Covered Total %
statement 21 21 100.0
branch 1 2 50.0
condition n/a
subroutine 7 7 100.0
pod 1 1 100.0
total 30 31 96.7


line stmt bran cond sub pod time code
1             package Plack::Middleware::XFramework;
2 7     7   93738 use strict;
  7         12  
  7         230  
3 7     7   24 use warnings;
  7         10  
  7         379  
4 7     7   27 use parent qw/Plack::Middleware/;
  7         9  
  7         37  
5              
6 7     7   353 use Plack::Util;
  7         29  
  7         162  
7 7     7   28 use Plack::Util::Accessor qw( framework );
  7         39  
  7         38  
8              
9             sub call {
10 11     11 1 17 my $self = shift;
11              
12 11         45 my $res = $self->app->( @_ );
13             $self->response_cb($res, sub {
14 11     11   16 my $res = shift;
15 11 50       29 if ($self->framework) {
16 11         26 Plack::Util::header_set $res->[1], 'X-Framework' => $self->framework;
17             }
18 11         117 });
19             }
20              
21             1;
22              
23             __END__