line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Bootylicious::DocumentMetadataLoader; |
2
|
|
|
|
|
|
|
|
3
|
15
|
|
|
15
|
|
91
|
use strict; |
|
15
|
|
|
|
|
31
|
|
|
15
|
|
|
|
|
356
|
|
4
|
15
|
|
|
15
|
|
82
|
use warnings; |
|
15
|
|
|
|
|
27
|
|
|
15
|
|
|
|
|
327
|
|
5
|
|
|
|
|
|
|
|
6
|
15
|
|
|
15
|
|
72
|
use base 'Mojo::Base'; |
|
15
|
|
|
|
|
28
|
|
|
15
|
|
|
|
|
2502
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
__PACKAGE__->attr('path'); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub load { |
11
|
30
|
|
|
30
|
0
|
459
|
my $self = shift; |
12
|
|
|
|
|
|
|
|
13
|
30
|
|
|
|
|
92
|
my $path = $self->path; |
14
|
|
|
|
|
|
|
|
15
|
4
|
50
|
|
4
|
|
25
|
open my $fh, '<:encoding(UTF-8)', $path or return; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
28
|
|
|
30
|
|
|
|
|
1054
|
|
16
|
|
|
|
|
|
|
|
17
|
30
|
|
|
|
|
5222
|
my $metadata = {}; |
18
|
30
|
|
|
|
|
467
|
while (my $line = <$fh>) { |
19
|
73
|
50
|
|
|
|
407
|
last unless $line; |
20
|
73
|
100
|
|
|
|
441
|
last unless $line =~ m/^(.*?): (.*)/; |
21
|
|
|
|
|
|
|
|
22
|
56
|
|
|
|
|
195
|
my $key = lc $1; |
23
|
56
|
|
|
|
|
107
|
my $value = $2; |
24
|
|
|
|
|
|
|
|
25
|
56
|
|
|
|
|
277
|
$metadata->{$key} = $value; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
30
|
|
|
|
|
389
|
return $metadata; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |