| 1 | package Mason::Plugin::PSGIHandler::Interp; | ||||||||||||||||||||||||||||
| 2 | 1 | ▶ | BEGIN { | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 1 | $Mason::Plugin::PSGIHandler::Interp::VERSION = '0.06'; | |||||||||||||||||||||||||||
| 4 | } | ||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use Mason::Plack::Request; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use Mason::PluginRole; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use Try::Tiny; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use Mason::Plugin::PSGIHandler::Extra::StackTrace; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 1 | ▶ | method handle_psgi ($env) { | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | # local $Plack::Middleware::StackTrace::StackTraceClass = | ||||||||||||||||||||||||||||
| 13 | # 'Mason::Plugin::PSGIHandler::Extra::StackTrace'; | ||||||||||||||||||||||||||||
| 14 | 7 | my $req = Mason::Plack::Request->new($env); | |||||||||||||||||||||||||||
| 15 | 7 | ▶ | my $response = try { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 16 | 7 | $self->run( { req => $req }, $self->psgi_comp_path($req), $self->psgi_parameters($req) ) | |||||||||||||||||||||||||||
| 17 | ->plack_response; | ||||||||||||||||||||||||||||
| 18 | } | ||||||||||||||||||||||||||||
| 19 | 2 | ▶ | catch { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||
| 20 | 2 | my $err = $_; | |||||||||||||||||||||||||||
| 21 | 2 | ▶ | if ( blessed($err) && $err->isa('Mason::Exception::TopLevelNotFound') ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
builtin::blessed($err) and $err->isa("Mason::Exception::TopLevelNotFound")
MC/DC50%1/2
builtin::blessed($err) and $err->isa("Mason::Exception::TopLevelNotFound")
builtin::blessed($err)
$err->isa("Mason::Exception::TopLevelNotFound")
Truth table66%2/3
A and B
A= builtin::blessed($err)B= $err->isa("Mason::Exception::TopLevelNotFound")
| |||||||||||||||||||||||||||||
| 22 | 1 | Mason::Plack::Response->new(404); | |||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||
| 24 | else { | ||||||||||||||||||||||||||||
| 25 | 1 | local $SIG{__DIE__} = undef; | |||||||||||||||||||||||||||
| 26 | 1 | die $err; | |||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | 7 | }; | |||||||||||||||||||||||||||
| 29 | 6 | return $response->finalize; | |||||||||||||||||||||||||||
| 30 | 1 | } | |||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 1 | ▶ | method psgi_comp_path ($req) { | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
psgi_comp_path: called CC=2 SCAR=7.0
| |||||||||||||||||||||||||||||
| 33 | 7 | my $comp_path = $req->path; | |||||||||||||||||||||||||||
| 34 | 7 | ▶ | $comp_path = "/$comp_path" if substr( $comp_path, 0, 1 ) ne '/'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 35 | 7 | return $comp_path; | |||||||||||||||||||||||||||
| 36 | 1 | } | |||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 1 | ▶ | method psgi_parameters ($req) { | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
psgi_parameters: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 39 | 7 | return $req->parameters; | |||||||||||||||||||||||||||
| 40 | 1 | } | |||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | 1 | 1; | |||||||||||||||||||||||||||