Tapper-Reports-Web

 view release on metacpan or  search on metacpan

lib/Tapper/Reports/Web/Role/BehaviourModifications/Path.pm  view on Meta::CPAN

package Tapper::Reports::Web::Role::BehaviourModifications::Path;
our $AUTHORITY = 'cpan:TAPPER';
$Tapper::Reports::Web::Role::BehaviourModifications::Path::VERSION = '5.0.17';
use Moose::Role;

# I am sick of getting relocated/rebase on our local path!
# Cut away a trailing 'tapper/' from base and prepend it to path.
# All conditionally only when this annoying environment is there.
after 'prepare_path' => sub {
                             my ($c) = @_;

                             my $base        =  $c->req->{base}."";
                             $base           =~ s,tapper/$,, if $base;
                             $c->req->{base} =  bless( do{\(my $o = $base)}, 'URI::http' );
                             $c->req->path('tapper/'.$c->req->path) unless ( $c->req->path =~ m,^tapper/?,);
                            };



( run in 0.680 second using v1.01-cache-2.11-cpan-5511b514fd6 )