File Coverage

blib/lib/Tapper/Reports/Web/Role/BehaviourModifications/Path.pm
Criterion Covered Total %
statement 3 3 100.0
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 4 4 100.0


line stmt bran cond sub pod time code
1             package Tapper::Reports::Web::Role::BehaviourModifications::Path;
2             our $AUTHORITY = 'cpan:TAPPER';
3             $Tapper::Reports::Web::Role::BehaviourModifications::Path::VERSION = '5.0.13';
4 10     10   7013 use Moose::Role;
  10         17  
  10         87  
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             after 'prepare_path' => sub {
10             my ($c) = @_;
11              
12             my $base = $c->req->{base}."";
13             $base =~ s,tapper/$,, if $base;
14             $c->req->{base} = bless( do{\(my $o = $base)}, 'URI::http' );
15             $c->req->path('tapper/'.$c->req->path) unless ( $c->req->path =~ m,^tapper/?,);
16             };
17              
18             1;
19              
20             __END__
21              
22             =pod
23              
24             =encoding UTF-8
25              
26             =head1 NAME
27              
28             Tapper::Reports::Web::Role::BehaviourModifications::Path
29              
30             =head1 AUTHORS
31              
32             =over 4
33              
34             =item *
35              
36             AMD OSRC Tapper Team <tapper@amd64.org>
37              
38             =item *
39              
40             Tapper Team <tapper-ops@amazon.com>
41              
42             =back
43              
44             =head1 COPYRIGHT AND LICENSE
45              
46             This software is Copyright (c) 2017 by Advanced Micro Devices, Inc..
47              
48             This is free software, licensed under:
49              
50             The (two-clause) FreeBSD License
51              
52             =cut