line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use Catmandu::Sane; |
3
|
18
|
|
|
18
|
|
8286
|
|
|
18
|
|
|
|
|
39
|
|
|
18
|
|
|
|
|
102
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.2019'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use List::MoreUtils qw(all_u any); |
7
|
18
|
|
|
18
|
|
9350
|
use Catmandu::Util::Path qw(as_path); |
|
18
|
|
|
|
|
149225
|
|
|
18
|
|
|
|
|
160
|
|
8
|
18
|
|
|
18
|
|
18569
|
use Moo::Role; |
|
18
|
|
|
|
|
41
|
|
|
18
|
|
|
|
|
844
|
|
9
|
18
|
|
|
18
|
|
90
|
use namespace::clean; |
|
18
|
|
|
|
|
35
|
|
|
18
|
|
|
|
|
128
|
|
10
|
18
|
|
|
18
|
|
6181
|
|
|
18
|
|
|
|
|
43
|
|
|
18
|
|
|
|
|
109
|
|
11
|
|
|
|
|
|
|
with 'Catmandu::Fix::Condition::Builder'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
requires 'path'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has mode => (is => 'lazy'); |
16
|
|
|
|
|
|
|
has value_tester => (is => 'lazy'); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
25
|
|
|
25
|
|
276
|
my ($self) = @_; |
20
|
|
|
|
|
|
|
my $getter = as_path($self->path)->getter; |
21
|
|
|
|
|
|
|
my $mode = $self->mode; |
22
|
30
|
|
|
30
|
|
304
|
my $tester = $self->value_tester; |
23
|
30
|
|
|
|
|
172
|
if ($mode eq 'all') { |
24
|
30
|
|
|
|
|
677
|
sub { |
25
|
30
|
|
|
|
|
452
|
all_u {$tester->($_)} @{$getter->($_[0])}; |
26
|
30
|
100
|
|
|
|
115
|
}; |
|
|
50
|
|
|
|
|
|
27
|
|
|
|
|
|
|
} |
28
|
89
|
|
|
89
|
|
276
|
elsif ($mode eq 'any') { |
|
88
|
|
|
|
|
494
|
|
|
89
|
|
|
|
|
1356
|
|
29
|
25
|
|
|
|
|
177
|
sub { |
30
|
|
|
|
|
|
|
any {$tester->($_)} @{$getter->($_[0])}; |
31
|
|
|
|
|
|
|
}; |
32
|
|
|
|
|
|
|
} |
33
|
14
|
|
|
14
|
|
50
|
} |
|
15
|
|
|
|
|
43
|
|
|
14
|
|
|
|
|
230
|
|
34
|
5
|
|
|
|
|
46
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=pod |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 NAME |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Catmandu::Fix::Condition::Builder::Simple - Helper role to easily write fix conditions that test a value |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=cut |