line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Articulate::TestEnv; |
2
|
6
|
|
|
6
|
|
69942
|
use strict; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
274
|
|
3
|
6
|
|
|
6
|
|
2548
|
use FindBin; |
|
6
|
|
|
|
|
4433
|
|
|
6
|
|
|
|
|
232
|
|
4
|
6
|
|
|
6
|
|
2089
|
use YAML; |
|
6
|
|
|
|
|
35417
|
|
|
6
|
|
|
|
|
329
|
|
5
|
6
|
|
|
6
|
|
1585
|
use Articulate; |
|
6
|
|
|
|
|
18
|
|
|
6
|
|
|
|
|
198
|
|
6
|
6
|
|
|
6
|
|
36
|
use FindBin; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
274
|
|
7
|
6
|
|
|
6
|
|
31
|
use Exporter::Declare; |
|
6
|
|
|
|
|
8
|
|
|
6
|
|
|
|
|
41
|
|
8
|
|
|
|
|
|
|
default_exports qw( app_from_config app_from_data ); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub app_from_config { |
11
|
5
|
|
33
|
5
|
0
|
49
|
my $fn = shift // "$FindBin::Bin/environments/testing.yml"; |
12
|
5
|
|
|
|
|
124
|
$fn =~ s/(?
|
13
|
5
|
50
|
|
|
|
107
|
$fn =~ "$FindBin::Bin/environments/$fn" unless -e $fn; |
14
|
5
|
|
|
5
|
|
136
|
open my $fh, '<:encoding(utf8)', $fn; |
|
5
|
|
|
|
|
35
|
|
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
189
|
|
15
|
5
|
|
|
|
|
45181
|
my $yaml; |
16
|
5
|
|
|
|
|
155
|
while ( defined( my $line = <$fh> ) ) { $yaml .= $line } |
|
565
|
|
|
|
|
1418
|
|
17
|
5
|
|
|
|
|
32
|
my $data = YAML::Load $yaml; |
18
|
5
|
|
|
|
|
173918
|
return app_from_data( $data->{plugins}->{Articulate} ); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub app_from_data { |
22
|
5
|
|
|
5
|
0
|
52
|
my $app = Articulate->new(shift); |
23
|
5
|
|
|
|
|
607
|
$app->components->{'storage'}->empty_all_content; |
24
|
5
|
|
|
|
|
241
|
return $app; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |