| 1 | package Brackup::DigestCache; | ||||||||||||
| 2 | 13 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 13 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | |||||||||||||
| 5 | 5 | ▶ | sub new { | ||||||||||
|
Subroutine
new: called CC=3 SCAR=11.1
Pod
undocumented
| |||||||||||||
| 6 | 5 | my ($class, $root, $rconf) = @_; | |||||||||||
| 7 | 5 | my $self = bless {}, $class; | |||||||||||
| 8 | |||||||||||||
| 9 | 5 | ▶ | my $file = $rconf->value('digestdb_file') || | ||||||||||
|
Condition50%1/2
$rconf->value('digestdb_file') || $root->path . '/' . default_filename()
MC/DC0%0/1
$rconf->value('digestdb_file') || $root->path . '/' . default_filename()
$rconf->value('digestdb_file')
Truth table50%1/2
A
A= $rconf->value('digestdb_file')
| |||||||||||||
| 10 | ($root->path . '/' . default_filename()); | ||||||||||||
| 11 | 5 | ▶ | my $type = $rconf->value('digestdb_type') || 'SQLite'; | ||||||||||
|
Condition50%1/2
$rconf->value('digestdb_type') || 'SQLite'
MC/DC0%0/1
$rconf->value('digestdb_type') || 'SQLite'
$rconf->value('digestdb_type')
Truth table50%1/2
A
A= $rconf->value('digestdb_type')
| |||||||||||||
| 12 | |||||||||||||
| 13 | 5 | my $dict_class = "Brackup::Dict::$type"; | |||||||||||
| 14 | 5 | eval "require $dict_class"; | |||||||||||
| 15 | 5 | $self->{dict} = $dict_class->new( | |||||||||||
| 16 | table => "digest_cache", | ||||||||||||
| 17 | file => $file, | ||||||||||||
| 18 | ); | ||||||||||||
| 19 | |||||||||||||
| 20 | 5 | return $self; | |||||||||||
| 21 | } | ||||||||||||
| 22 | |||||||||||||
| 23 | 0 | ▶ | sub default_filename { ".brackup-digest.db" }; | ||||||||||
|
Subroutine
default_filename: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 24 | |||||||||||||
| 25 | # proxy through to underlying dictionary | ||||||||||||
| 26 | 126 | ▶ | sub get { shift->{dict}->get(@_) } | ||||||||||
|
Subroutine
get: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 27 | 78 | ▶ | sub set { shift->{dict}->set(@_) } | ||||||||||
|
Subroutine
set: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 28 | 0 | ▶ | sub each { shift->{dict}->each(@_) } | ||||||||||
|
Subroutine
each: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 29 | 0 | ▶ | sub delete { shift->{dict}->delete(@_) } | ||||||||||
|
Subroutine
delete: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 30 | 0 | ▶ | sub count { shift->{dict}->count(@_) } | ||||||||||
|
Subroutine
count: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 31 | 5 | ▶ | sub backing_file { shift->{dict}->backing_file(@_) } | ||||||||||
|
Subroutine
backing_file: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 32 | |||||||||||||
| 33 | 13 | 1; | |||||||||||
| 34 | |||||||||||||
| 35 | __END__ | ||||||||||||