line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
300774
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
60
|
|
2
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
76
|
|
3
|
|
|
|
|
|
|
package Dancer2::Plugin::RootURIFor; |
4
|
|
|
|
|
|
|
{ |
5
|
|
|
|
|
|
|
$Dancer2::Plugin::RootURIFor::VERSION = '0.01'; |
6
|
|
|
|
|
|
|
} |
7
|
|
|
|
|
|
|
# ABSTRACT: Mountpoint-agnostic uri builder for Dancer2 |
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
337
|
use URI::Escape; |
|
2
|
|
|
|
|
861
|
|
|
2
|
|
|
|
|
95
|
|
10
|
2
|
|
|
2
|
|
799
|
use Dancer2::Plugin; |
|
2
|
|
|
|
|
70549
|
|
|
2
|
|
|
|
|
8
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
register root_uri_for => sub { |
13
|
4
|
|
|
4
|
|
100796
|
my ( $dsl, $part, $params, $dont_escape ) = @_; |
14
|
4
|
|
|
|
|
20
|
my $uri = $dsl->request->base; |
15
|
|
|
|
|
|
|
|
16
|
4
|
|
|
|
|
697
|
$part =~ s{^/*}{/}; |
17
|
4
|
|
|
|
|
8
|
$uri->path("$part"); |
18
|
|
|
|
|
|
|
|
19
|
4
|
100
|
|
|
|
61
|
$uri->query_form($params) if $params; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
0
|
return $dont_escape |
22
|
4
|
|
|
|
|
7
|
? uri_unescape( ${ $uri->canonical } ) |
23
|
4
|
50
|
|
|
|
83
|
: ${ $uri->canonical }; |
24
|
|
|
|
|
|
|
}; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
register_plugin; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
__END__ |