line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package |
2
|
|
|
|
|
|
|
Twitter::Text::Configuration; # hide from PAUSE |
3
|
4
|
|
|
4
|
|
546
|
use strict; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
140
|
|
4
|
4
|
|
|
4
|
|
22
|
use warnings; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
115
|
|
5
|
4
|
|
|
4
|
|
2541
|
use JSON (); |
|
4
|
|
|
|
|
37171
|
|
|
4
|
|
|
|
|
125
|
|
6
|
4
|
|
|
4
|
|
3189
|
use Path::Tiny qw(path); |
|
4
|
|
|
|
|
43555
|
|
|
4
|
|
|
|
|
257
|
|
7
|
4
|
|
|
4
|
|
511
|
use File::Share qw(dist_file); |
|
4
|
|
|
|
|
27653
|
|
|
4
|
|
|
|
|
829
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# internal use only, do not use this module directly. |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my %config_cache; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub configuration_from_file { |
14
|
60
|
|
|
60
|
0
|
128
|
my $config_name = shift; |
15
|
|
|
|
|
|
|
|
16
|
60
|
100
|
|
|
|
352
|
return $config_cache{$config_name} if exists $config_cache{$config_name}; |
17
|
|
|
|
|
|
|
|
18
|
3
|
|
33
|
|
|
38
|
return $config_cache{$config_name} ||= JSON::decode_json(path(dist_file('Twitter-Text', "config/$config_name.json"))->slurp); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub V1 { |
22
|
8
|
|
|
8
|
0
|
15
|
return configuration_from_file('v1'); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub V2 { |
26
|
28
|
|
|
28
|
0
|
658134
|
return configuration_from_file('v2'); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub V3 { |
30
|
24
|
|
|
24
|
0
|
70
|
return configuration_from_file('v3'); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub default_configuration { |
34
|
24
|
|
|
24
|
0
|
61
|
return V3; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |