line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package |
2
|
|
|
|
|
|
|
Twitter::Text::Configuration; # hide from PAUSE |
3
|
4
|
|
|
4
|
|
502
|
use strict; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
140
|
|
4
|
4
|
|
|
4
|
|
22
|
use warnings; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
108
|
|
5
|
4
|
|
|
4
|
|
2395
|
use JSON (); |
|
4
|
|
|
|
|
35460
|
|
|
4
|
|
|
|
|
115
|
|
6
|
4
|
|
|
4
|
|
3339
|
use Path::Tiny qw(path); |
|
4
|
|
|
|
|
40545
|
|
|
4
|
|
|
|
|
363
|
|
7
|
4
|
|
|
4
|
|
479
|
use File::Share qw(dist_file); |
|
4
|
|
|
|
|
22248
|
|
|
4
|
|
|
|
|
742
|
|
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
|
122
|
my $config_name = shift; |
15
|
|
|
|
|
|
|
|
16
|
60
|
100
|
|
|
|
367
|
return $config_cache{$config_name} if exists $config_cache{$config_name}; |
17
|
|
|
|
|
|
|
|
18
|
3
|
|
33
|
|
|
26
|
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
|
13
|
return configuration_from_file('v1'); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub V2 { |
26
|
28
|
|
|
28
|
0
|
550068
|
return configuration_from_file('v2'); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub V3 { |
30
|
24
|
|
|
24
|
0
|
82
|
return configuration_from_file('v3'); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub default_configuration { |
34
|
24
|
|
|
24
|
0
|
102
|
return V3; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |