blib/lib/Plack/Middleware/SetLocalEnv.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 16 | 16 | 100.0 |
branch | n/a | ||
condition | n/a | ||
subroutine | 5 | 5 | 100.0 |
pod | 1 | 1 | 100.0 |
total | 22 | 22 | 100.0 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Plack::Middleware::SetLocalEnv; | ||||||
2 | 2 | 2 | 1370 | use 5.008001; | |||
2 | 5 | ||||||
3 | 2 | 2 | 7 | use strict; | |||
2 | 2 | ||||||
2 | 43 | ||||||
4 | 2 | 2 | 14 | use warnings; | |||
2 | 0 | ||||||
2 | 85 | ||||||
5 | 2 | 2 | 469 | use parent "Plack::Middleware"; | |||
2 | 279 | ||||||
2 | 12 | ||||||
6 | |||||||
7 | our $VERSION = "0.01"; | ||||||
8 | |||||||
9 | sub call { | ||||||
10 | 4 | 4 | 1 | 20116 | my ($self, $env) = @_; | ||
11 | |||||||
12 | 4 | 101 | local %ENV = %ENV; | ||||
13 | 4 | 53 | for my $key (keys %$self) { | ||||
14 | 7 | 24 | $ENV{$key} = $env->{ $self->{$key} }; | ||||
15 | } | ||||||
16 | 4 | 14 | $self->app->($env); | ||||
17 | } | ||||||
18 | |||||||
19 | 1; | ||||||
20 | __END__ |