| 1 | package | ||||||||||||||||||||
| 2 | Twitter::Text::Configuration; # hide from PAUSE | ||||||||||||||||||||
| 3 | 4 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 4 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 4 | ▶ | use JSON (); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 4 | ▶ | use Path::Tiny qw(path); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | 4 | ▶ | use File::Share qw(dist_file); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | # internal use only, do not use this module directly. | ||||||||||||||||||||
| 10 | |||||||||||||||||||||
| 11 | 4 | my %config_cache; | |||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 60 | ▶ | sub configuration_from_file { | ||||||||||||||||||
|
Subroutine
configuration_from_file: called CC=3 SCAR=11.4
Pod
undocumented
| |||||||||||||||||||||
| 14 | 60 | my $config_name = shift; | |||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | 60 | ▶ | return $config_cache{$config_name} if exists $config_cache{$config_name}; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | 3 | ▶ | return $config_cache{$config_name} ||= JSON::decode_json(path(dist_file('Twitter-Text', "config/$config_name.json"))->slurp); | ||||||||||||||||||
|
Condition33%1/3
$config_cache{$config_name} ||= &JSON::decode_json(scalar path(dist_file("Twitter-Text", "config/$config_name.json"))->slurp)
MC/DC0%0/2
$config_cache{$config_name} ||= &JSON::decode_json(scalar path(dist_file("Twitter-Text", "config/$config_name.json"))->slurp)
$config_cache{$config_name}
&JSON::decode_json(scalar path(dist_file("Twitter-Text", "config/$config_name.json"))->slurp)
Truth table33%1/3
A ||= B
A= $config_cache{$config_name}B= &JSON::decode_json(scalar path(dist_file("Twitter-Text", "config/$config_name.json"))->slurp)
| |||||||||||||||||||||
| 19 | } | ||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | 8 | ▶ | sub V1 { | ||||||||||||||||||
|
Subroutine
V1: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||
| 22 | 8 | return configuration_from_file('v1'); | |||||||||||||||||||
| 23 | } | ||||||||||||||||||||
| 24 | |||||||||||||||||||||
| 25 | 28 | ▶ | sub V2 { | ||||||||||||||||||
|
Subroutine
V2: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||
| 26 | 28 | return configuration_from_file('v2'); | |||||||||||||||||||
| 27 | } | ||||||||||||||||||||
| 28 | |||||||||||||||||||||
| 29 | 24 | ▶ | sub V3 { | ||||||||||||||||||
|
Subroutine
V3: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||
| 30 | 24 | return configuration_from_file('v3'); | |||||||||||||||||||
| 31 | } | ||||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | 24 | ▶ | sub default_configuration { | ||||||||||||||||||
|
Subroutine
default_configuration: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||
| 34 | 24 | return V3; | |||||||||||||||||||
| 35 | } | ||||||||||||||||||||
| 36 | |||||||||||||||||||||
| 37 | 4 | 1; | |||||||||||||||||||