line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use Catmandu::Sane; |
3
|
32
|
|
|
32
|
|
14941
|
|
|
32
|
|
|
|
|
66
|
|
|
32
|
|
|
|
|
203
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.2019'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use Clone qw(clone); |
7
|
32
|
|
|
32
|
|
212
|
use Moo::Role; |
|
32
|
|
|
|
|
60
|
|
|
32
|
|
|
|
|
1345
|
|
8
|
32
|
|
|
32
|
|
181
|
use namespace::clean; |
|
32
|
|
|
|
|
57
|
|
|
32
|
|
|
|
|
176
|
|
9
|
32
|
|
|
32
|
|
10964
|
|
|
32
|
|
|
|
|
64
|
|
|
32
|
|
|
|
|
205
|
|
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
|
305
|
$self->_emit_branch( |
19
|
145
|
|
|
|
|
2459
|
$self->_emit_call($sub_var, $fixer->var), |
20
|
145
|
|
|
|
|
1980
|
$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
|
|
183
|
if (my $sym = $opts{as}) { |
29
|
18
|
|
|
|
|
258
|
my $sub = sub { |
30
|
|
|
|
|
|
|
my $data = shift; |
31
|
18
|
100
|
|
|
|
267
|
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
|
|
|
|
|
45
|
*{"${target}::$sym"} = $sub; |
38
|
1
|
|
|
|
|
5
|
} |
39
|
32
|
|
|
32
|
|
18011
|
} |
|
32
|
|
|
|
|
68
|
|
|
32
|
|
|
|
|
2734
|
|
40
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2066
|
|
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 |