line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use Catmandu::Sane; |
3
|
1
|
|
|
1
|
|
589
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.2018'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use Moo; |
7
|
1
|
|
|
1
|
|
6
|
use Catmandu::Util qw(is_value); |
|
1
|
|
|
|
|
11
|
|
|
1
|
|
|
|
|
5
|
|
8
|
1
|
|
|
1
|
|
325
|
use namespace::clean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
9
|
1
|
|
|
1
|
|
4
|
use Catmandu::Fix::Has; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
10
|
1
|
|
|
1
|
|
291
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
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 = int($self->value); |
18
|
2
|
|
|
2
|
|
16
|
sub { |
19
|
2
|
|
|
|
|
8
|
my $v = $_[0]; |
20
|
|
|
|
|
|
|
is_value($v) && $v > $value; |
21
|
4
|
|
|
4
|
|
7
|
}; |
22
|
4
|
50
|
|
|
|
132
|
} |
23
|
2
|
|
|
|
|
10
|
|
24
|
|
|
|
|
|
|
1; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=pod |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 NAME |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Catmandu::Fix::Condition::greater_than - Execute fixes when a field is greater than a value |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 SYNOPSIS |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
# greater_than(X,Y) is true when X > Y |
36
|
|
|
|
|
|
|
if greater_than('year','2018') |
37
|
|
|
|
|
|
|
add_field('my.funny.title','true') |
38
|
|
|
|
|
|
|
end |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
# greater_than on arrays checks if all values are X > Y |
41
|
|
|
|
|
|
|
if greater_than('years.*','2018') |
42
|
|
|
|
|
|
|
add_field('my.funny.title','true') |
43
|
|
|
|
|
|
|
end |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 SEE ALSO |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
L<Catmandu::Fix::Condition::less_than> |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=cut |