line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use Catmandu::Sane; |
3
|
32
|
|
|
32
|
|
16128
|
|
|
32
|
|
|
|
|
69
|
|
|
32
|
|
|
|
|
216
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.2018'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use Clone qw(clone); |
7
|
32
|
|
|
32
|
|
223
|
use Moo::Role; |
|
32
|
|
|
|
|
63
|
|
|
32
|
|
|
|
|
1318
|
|
8
|
32
|
|
|
32
|
|
172
|
use namespace::clean; |
|
32
|
|
|
|
|
65
|
|
|
32
|
|
|
|
|
193
|
|
9
|
32
|
|
|
32
|
|
11402
|
|
|
32
|
|
|
|
|
71
|
|
|
32
|
|
|
|
|
241
|
|
10
|
|
|
|
|
|
|
with 'Catmandu::Fix::Base'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has pass_fixes => (is => 'rw', default => sub {[]}); |
13
|
|
|
|
|
|
|
has fail_fixes => (is => 'rw', default => sub {[]}); |
14
|
|
|
|
|
|
|
has tester => (is => 'lazy'); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my ($self, $fixer) = @_; |
17
|
|
|
|
|
|
|
my $sub_var = $fixer->capture($self->tester); |
18
|
145
|
|
|
145
|
0
|
345
|
$self->_emit_branch( |
19
|
145
|
|
|
|
|
2527
|
$self->_emit_call($sub_var, $fixer->var), |
20
|
145
|
|
|
|
|
1995
|
$fixer->emit_fixes($self->pass_fixes), |
21
|
|
|
|
|
|
|
$fixer->emit_fixes($self->fail_fixes), |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
my $target = caller; |
26
|
|
|
|
|
|
|
my ($fix, %opts) = @_; |
27
|
|
|
|
|
|
|
|
28
|
18
|
|
|
18
|
|
184
|
if (my $sym = $opts{as}) { |
29
|
18
|
|
|
|
|
269
|
my $sub = sub { |
30
|
|
|
|
|
|
|
my $data = shift; |
31
|
18
|
100
|
|
|
|
277
|
if ($opts{clone}) { |
32
|
|
|
|
|
|
|
$data = clone($data); |
33
|
2
|
|
|
2
|
|
5
|
} |
34
|
2
|
50
|
|
|
|
7
|
$fix->new(@_)->tester->($data); |
35
|
0
|
|
|
|
|
0
|
}; |
36
|
|
|
|
|
|
|
no strict 'refs'; |
37
|
2
|
|
|
|
|
42
|
*{"${target}::$sym"} = $sub; |
38
|
1
|
|
|
|
|
5
|
} |
39
|
32
|
|
|
32
|
|
18404
|
} |
|
32
|
|
|
|
|
72
|
|
|
32
|
|
|
|
|
2999
|
|
40
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2067
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=pod |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 NAME |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Catmandu::Fix::Condition::Builder - Helper role to easily write fix conditions |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=cut |