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   23070 use strict;
  1         2  
  1         27  
3 1     1   4 use warnings;
  1         1  
  1         35  
4 1     1   4 use parent qw/Plack::App::File/;
  1         1  
  1         3  
5 1     1   37 use Plack::Util;
  1         1  
  1         86  
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         3 local @{$env}{qw(SCRIPT_NAME PATH_INFO)} = @{$env}{qw( plack.file.SCRIPT_NAME plack.file.PATH_INFO )};
  1         5  
  1         3  
13              
14 1   33     18 my $app = $self->{_compiled}->{$file} ||= Plack::Util::load_psgi($file);
15 1         13 $app->($env);
16             }
17              
18             1;
19              
20             __END__