auto/share/dist/Zonemaster-Engine/json2yaml.pl untested

filter: Statementstmt 0.0% 0 / 23 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod n/a totaltotal 0.0% 0 / 31 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 #!/usr/bin/env perl
2  
3 use 5.014002;
4 use strict;
5 use warnings;
6  
7 use File::ShareDir qw[dist_file];
8 use File::Slurp;
9  
10 use Zonemaster::Engine::Profile;
11  
12 my $json_file = @ARGV ? $ARGV[0] : dist_file( 'Zonemaster-Engine', 'profile.json');
13 my $json = read_file( $json_file );
14 my $profile = Zonemaster::Engine::Profile->from_json( $json );
15 my $yaml = $profile->to_yaml();
16 say $yaml;
17  
18 =head1 NAME
19  
20 json2yaml - Convert a JSON profile into YAML
21  
22 =head1 SYNOPSIS
23  
24 ./json2yaml.pl
25 ./json2yaml.pl profile.json
26  
27 =head1 DESCRIPTION
28  
29 json2yaml converts a JSON profile into YAML. The JSON profile can be passed as
30 an argument. If no argument is provided, the script will look for the default
31 profile. The YAML profile is written to the standard output.
32  
33 =cut