line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
313240
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
56
|
|
2
|
2
|
|
|
2
|
|
7
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
76
|
|
3
|
|
|
|
|
|
|
package Dancer2::Plugin::RootURIFor; |
4
|
|
|
|
|
|
|
{ |
5
|
|
|
|
|
|
|
$Dancer2::Plugin::RootURIFor::VERSION = '0.02'; |
6
|
|
|
|
|
|
|
} |
7
|
|
|
|
|
|
|
# ABSTRACT: Mountpoint-agnostic uri builder for Dancer2 |
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
344
|
use URI::Escape; |
|
2
|
|
|
|
|
929
|
|
|
2
|
|
|
|
|
106
|
|
10
|
2
|
|
|
2
|
|
327
|
use Dancer2 0.15; |
|
2
|
|
|
|
|
225223
|
|
|
2
|
|
|
|
|
11
|
|
11
|
2
|
|
|
2
|
|
53931
|
use Dancer2::Plugin; |
|
2
|
|
|
|
|
3487
|
|
|
2
|
|
|
|
|
10
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
register root_uri_for => sub { |
14
|
4
|
|
|
4
|
|
116521
|
my ( $dsl, $part, $params, $dont_escape ) = @_; |
15
|
4
|
|
|
|
|
22
|
my $uri = $dsl->request->base; |
16
|
|
|
|
|
|
|
|
17
|
4
|
|
|
|
|
814
|
$part =~ s{^/*}{/}; |
18
|
4
|
|
|
|
|
12
|
$uri->path("$part"); |
19
|
|
|
|
|
|
|
|
20
|
4
|
100
|
|
|
|
96
|
$uri->query_form($params) if $params; |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
0
|
return $dont_escape |
23
|
4
|
|
|
|
|
7
|
? uri_unescape( ${ $uri->canonical } ) |
24
|
4
|
50
|
|
|
|
87
|
: ${ $uri->canonical }; |
25
|
|
|
|
|
|
|
}; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
register_plugin; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
__END__ |