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   107951 use strict;
  7         18  
  7         313  
3 7     7   38 use warnings;
  7         28  
  7         576  
4 7     7   45 use parent qw/Plack::Middleware/;
  7         15  
  7         57  
5              
6 7     7   521 use Plack::Util;
  7         44  
  7         283  
7 7     7   77 use Plack::Util::Accessor qw( framework );
  7         16  
  7         55  
8              
9             sub call {
10 11     11 1 21 my $self = shift;
11              
12 11         72 my $res = $self->app->( @_ );
13             $self->response_cb($res, sub {
14 11     11   20 my $res = shift;
15 11 50       33 if ($self->framework) {
16 11         33 Plack::Util::header_set $res->[1], 'X-Framework' => $self->framework;
17             }
18 11         138 });
19             }
20              
21             1;
22              
23             __END__