line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use Catmandu::Sane; |
3
|
18
|
|
|
18
|
|
9468
|
|
|
18
|
|
|
|
|
42
|
|
|
18
|
|
|
|
|
117
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.2018'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use List::MoreUtils qw(all_u any); |
7
|
18
|
|
|
18
|
|
9228
|
use Catmandu::Util::Path qw(as_path); |
|
18
|
|
|
|
|
152214
|
|
|
18
|
|
|
|
|
167
|
|
8
|
18
|
|
|
18
|
|
19233
|
use Moo::Role; |
|
18
|
|
|
|
|
49
|
|
|
18
|
|
|
|
|
904
|
|
9
|
18
|
|
|
18
|
|
99
|
use namespace::clean; |
|
18
|
|
|
|
|
35
|
|
|
18
|
|
|
|
|
174
|
|
10
|
18
|
|
|
18
|
|
6594
|
|
|
18
|
|
|
|
|
37
|
|
|
18
|
|
|
|
|
125
|
|
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
|
|
306
|
my ($self) = @_; |
20
|
|
|
|
|
|
|
my $getter = as_path($self->path)->getter; |
21
|
|
|
|
|
|
|
my $mode = $self->mode; |
22
|
30
|
|
|
30
|
|
325
|
my $tester = $self->value_tester; |
23
|
30
|
|
|
|
|
202
|
if ($mode eq 'all') { |
24
|
30
|
|
|
|
|
668
|
sub { |
25
|
30
|
|
|
|
|
458
|
all_u {$tester->($_)} @{$getter->($_[0])}; |
26
|
30
|
100
|
|
|
|
135
|
}; |
|
|
50
|
|
|
|
|
|
27
|
|
|
|
|
|
|
} |
28
|
89
|
|
|
89
|
|
286
|
elsif ($mode eq 'any') { |
|
88
|
|
|
|
|
498
|
|
|
89
|
|
|
|
|
1356
|
|
29
|
25
|
|
|
|
|
299
|
sub { |
30
|
|
|
|
|
|
|
any {$tester->($_)} @{$getter->($_[0])}; |
31
|
|
|
|
|
|
|
}; |
32
|
|
|
|
|
|
|
} |
33
|
14
|
|
|
14
|
|
68
|
} |
|
15
|
|
|
|
|
50
|
|
|
14
|
|
|
|
|
230
|
|
34
|
5
|
|
|
|
|
54
|
|
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 |