line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Plack::App::DirectoryIndex; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
102510
|
use parent qw[Plack::App::Directory]; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
4
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
93700
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
21
|
|
6
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
6
|
use Plack::Util::Accessor 'dir_index'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
10
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.0.2'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub serve_path { |
13
|
4
|
|
|
4
|
0
|
26164
|
my $self = shift; |
14
|
4
|
|
|
|
|
12
|
my ($env, $dir) = @_; |
15
|
|
|
|
|
|
|
|
16
|
4
|
|
100
|
|
|
13
|
my $dir_index = $self->dir_index // 'index.html'; |
17
|
|
|
|
|
|
|
|
18
|
4
|
100
|
66
|
|
|
143
|
if (-d $dir and $dir_index and -f "$dir$dir_index") { |
|
|
|
66
|
|
|
|
|
19
|
3
|
|
|
|
|
12
|
$dir .= $dir_index; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
4
|
|
|
|
|
22
|
return $self->SUPER::serve_path($env, $dir); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
__END__ |