line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
3
|
|
|
3
|
|
689
|
use 5.006; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
149
|
|
2
|
3
|
|
|
3
|
|
19
|
use strict; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
131
|
|
3
|
3
|
|
|
3
|
|
18
|
use warnings; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
253
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package CHI::Config::Driver; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.001001'; # TRIAL |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# ABSTRACT: Container for Driver configuration |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
12
|
|
|
|
|
|
|
|
13
|
3
|
|
|
3
|
|
540
|
use Moo qw( has ); |
|
3
|
|
|
|
|
12839
|
|
|
3
|
|
|
|
|
34
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has 'name' => ( is => 'ro', required => 1 ); |
16
|
|
|
|
|
|
|
has 'file' => ( is => 'ro', required => 1 ); |
17
|
|
|
|
|
|
|
has 'entry_no' => ( is => 'ro', required => 1 ); |
18
|
|
|
|
|
|
|
has 'config' => ( is => 'ro', required => 1 ); |
19
|
|
|
|
|
|
|
has 'memoize' => ( is => 'ro', lazy => 1, default => sub { undef } ); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub get_cache { |
22
|
2
|
|
|
2
|
1
|
92
|
my ($self) = @_; |
23
|
2
|
50
|
|
|
|
10
|
return $self->{_cache} if exists $self->{_cache}; |
24
|
|
|
|
|
|
|
|
25
|
2
|
|
|
|
|
1134
|
require CHI; |
26
|
0
|
|
|
|
|
|
require Storable; |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
my $instance = CHI->new( %{ Storable::dclone( $self->config ) } ); |
|
0
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
0
|
0
|
|
|
|
|
$self->{_cache} = $instance if $self->memoize; |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
return $instance; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub source { |
36
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
37
|
0
|
|
|
|
|
|
return sprintf '%s ( entry #%s )', $self->file, $self->entry_no; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
3
|
|
|
3
|
|
2946
|
no Moo; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
17
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__END__ |