line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use Catmandu::Sane; |
3
|
2
|
|
|
2
|
|
1170
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
13
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.2018'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use Moo; |
7
|
2
|
|
|
2
|
|
17
|
use Catmandu::Util qw(is_value); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
11
|
|
8
|
2
|
|
|
2
|
|
609
|
use namespace::clean; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
123
|
|
9
|
2
|
|
|
2
|
|
13
|
use Catmandu::Fix::Has; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
13
|
|
10
|
2
|
|
|
2
|
|
600
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
16
|
|
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
|
|
42
|
sub { |
19
|
4
|
|
|
|
|
19
|
my $v = $_[0]; |
20
|
|
|
|
|
|
|
is_value($v) && $v eq $value; |
21
|
11
|
|
|
11
|
|
22
|
}; |
22
|
11
|
50
|
|
|
|
177
|
} |
23
|
4
|
|
|
|
|
21
|
|
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 |