line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Fix::from_json; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
110615
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
8
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.2020'; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
8
|
use Cpanel::JSON::XS (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
17
|
|
8
|
1
|
|
|
1
|
|
5
|
use Moo; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
9
|
1
|
|
|
1
|
|
882
|
use Catmandu::Util::Path qw(as_path); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
56
|
|
10
|
1
|
|
|
1
|
|
8
|
use namespace::clean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3
|
|
11
|
1
|
|
|
1
|
|
726
|
use Catmandu::Fix::Has; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
with 'Catmandu::Fix::Builder'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has path => (fix_arg => 1); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub _build_fixer { |
18
|
2
|
|
|
2
|
|
26
|
my ($self) = @_; |
19
|
2
|
|
|
|
|
21
|
my $json = Cpanel::JSON::XS->new->utf8(0)->pretty(0)->allow_nonref(1); |
20
|
2
|
|
|
3
|
|
52
|
as_path($self->path)->updater(if_string => sub {$json->decode($_[0])}); |
|
3
|
|
|
|
|
72
|
|
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
__END__ |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=pod |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 NAME |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Catmandu::Fix::from_json - replace a json field with the parsed value |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 SYNOPSIS |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
from_json(my.field) |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 SEE ALSO |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
L<Catmandu::Fix> |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=cut |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|