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   100391 use strict;
  7         9  
  7         226  
3 7     7   22 use warnings;
  7         9  
  7         372  
4 7     7   23 use parent qw/Plack::Middleware/;
  7         11  
  7         36  
5              
6 7     7   389 use Plack::Util;
  7         11  
  7         182  
7 7     7   22 use Plack::Util::Accessor qw( framework );
  7         10  
  7         58  
8              
9             sub call {
10 11     11 1 19 my $self = shift;
11              
12 11         42 my $res = $self->app->( @_ );
13             $self->response_cb($res, sub {
14 11     11   15 my $res = shift;
15 11 50       33 if ($self->framework) {
16 11         24 Plack::Util::header_set $res->[1], 'X-Framework' => $self->framework;
17             }
18 11         104 });
19             }
20              
21             1;
22              
23             __END__