File Coverage

blib/lib/Plack/App/PSGIBin.pm
Criterion Covered Total %
statement 18 19 94.7
branch n/a
condition 1 3 33.3
subroutine 5 6 83.3
pod 0 2 0.0
total 24 30 80.0


line stmt bran cond sub pod time code
1             package Plack::App::PSGIBin;
2 1     1   21013 use strict;
  1         3  
  1         25  
3 1     1   4 use warnings;
  1         2  
  1         23  
4 1     1   4 use parent qw/Plack::App::File/;
  1         1  
  1         6  
5 1     1   62 use Plack::Util;
  1         25  
  1         145  
6              
7 0     0 0 0 sub allow_path_info { 1 }
8              
9             sub serve_path {
10 1     1 0 3 my($self, $env, $file) = @_;
11              
12 1         1 local @{$env}{qw(SCRIPT_NAME PATH_INFO)} = @{$env}{qw( plack.file.SCRIPT_NAME plack.file.PATH_INFO )};
  1         3  
  1         3  
13              
14 1   33     10 my $app = $self->{_compiled}->{$file} ||= Plack::Util::load_psgi($file);
15 1         4 $app->($env);
16             }
17              
18             1;
19              
20             __END__