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   81667 use strict;
  7         15  
  7         202  
3 7     7   32 use warnings;
  7         13  
  7         256  
4 7     7   95 use parent qw/Plack::Middleware/;
  7         14  
  7         46  
5              
6 7     7   422 use Plack::Util;
  7         11  
  7         179  
7 7     7   36 use Plack::Util::Accessor qw( framework );
  7         9  
  7         42  
8              
9             sub call {
10 11     11 1 25 my $self = shift;
11              
12 11         49 my $res = $self->app->( @_ );
13             $self->response_cb($res, sub {
14 11     11   18 my $res = shift;
15 11 50       28 if ($self->framework) {
16 11         30 Plack::Util::header_set $res->[1], 'X-Framework' => $self->framework;
17             }
18 11         119 });
19             }
20              
21             1;
22              
23             __END__