blib/lib/Tapper/Reports/Web/Role/BehaviourModifications/Path.pm

filter: Statementstmt 100% 13 / 13 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 94.7% 18 / 19 CC 3 SCAR 9.2
CC
3
Cov
94%
__ANON__
3.0
BEGIN
1.0
CRAP 2.5
« blib/lib/Tapper/Reports/Web/Controller/Tapper/Preconditions/Id.pm ↑ Summary blib/script/tapper_reports_web_cgi.pl »
1 package Tapper::Reports::Web::Role::BehaviourModifications::Path;
2 13 our $AUTHORITY = 'cpan:TAPPER';
3 13 $Tapper::Reports::Web::Role::BehaviourModifications::Path::VERSION = '5.0.17';
4 13 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 # I am sick of getting relocated/rebase on our local path!
7 # Cut away a trailing 'tapper/' from base and prepend it to path.
8 # All conditionally only when this annoying environment is there.
9 21 ▶after 'prepare_path' => sub {
Subroutine __ANON__: called CC=3 SCAR=11.0
10 21 my ($c) = @_;
11  
12 21 my $base = $c->req->{base}."";
13 21 ▶ $base =~ s,tapper/$,, if $base;
Branch: 1 branch
BranchTrueFalseTotal
if $base 21 0 21
14 21 $c->req->{base} = bless( do{\(my $o = $base)}, 'URI::http' );
15 21 ▶ $c->req->path('tapper/'.$c->req->path) unless ( $c->req->path =~ m,^tapper/?,);
Branch: 1 branch
BranchTrueFalseTotal
unless $c->req->path =~ m[^tapper/?] 3 18 21
16 13 };
17  
18 13 1;
19  
20 __END__
« blib/lib/Tapper/Reports/Web/Controller/Tapper/Preconditions/Id.pm ↑ Summary blib/script/tapper_reports_web_cgi.pl »