line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use Catmandu::Sane; |
3
|
2
|
|
|
2
|
|
975
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
11
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.2019'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use Moo; |
7
|
2
|
|
|
2
|
|
13
|
use Catmandu::Util qw(is_value); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
8
|
|
8
|
2
|
|
|
2
|
|
551
|
use namespace::clean; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
86
|
|
9
|
2
|
|
|
2
|
|
10
|
use Catmandu::Fix::Has; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
8
|
|
10
|
2
|
|
|
2
|
|
529
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
19
|
|
11
|
|
|
|
|
|
|
has path => (fix_arg => 1); |
12
|
|
|
|
|
|
|
has value => (fix_arg => 1); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
with 'Catmandu::Fix::Condition::Builder::Simple'; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my ($self) = @_; |
17
|
|
|
|
|
|
|
my $value = $self->value; |
18
|
4
|
|
|
4
|
|
36
|
sub { |
19
|
4
|
|
|
|
|
13
|
my $v = $_[0]; |
20
|
|
|
|
|
|
|
is_value($v) && $v eq $value; |
21
|
11
|
|
|
11
|
|
16
|
}; |
22
|
11
|
50
|
|
|
|
170
|
} |
23
|
4
|
|
|
|
|
18
|
|
24
|
|
|
|
|
|
|
1; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=pod |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 NAME |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Catmandu::Fix::Condition::all_equal - Execute fixes when all path values equal a string value |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 DESCRIPTION |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
This fix is meant as an simple alternative to L<Catmandu::Fix::Condition::all_match>. |
36
|
|
|
|
|
|
|
No regular expressions are involved. String are compared using the regular |
37
|
|
|
|
|
|
|
operator 'eq'. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 SYNOPSIS |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# all_equal(X,Y) is true when value of X == 'Y' |
42
|
|
|
|
|
|
|
if all_equal('year','2018') |
43
|
|
|
|
|
|
|
add_field('my.funny.title','true') |
44
|
|
|
|
|
|
|
end |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# all_equal(X,Y) is false when value of X == 'Ya' |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 SEE ALSO |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
L<Catmandu::Fix> , L<Catmandu::Fix::Condition::any_equal> |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=cut |