rofile;
my $json_file = @ARGV ? $ARGV[0] : dist_file( 'Zonemaster-Engine', 'profile.json');
my $json = read_file( $json_file );
my $profile = Zonemaster::Engine::Profile->from_json( $json );
my $yaml
NAME
json2yaml - Convert a JSON profile into YAML
=head1 SYNOPSIS
./json2yaml.pl
./json2yaml.pl profile.json
=head1 DESCRIPTION
json2yaml converts a JSON profile into YAML. The JSON profi
our $VERSION = version->declare("v1.1.8");
use Carp qw( confess );
use Time::HiRes qw[time];
use JSON::PP;
use Class::Accessor;
use Zonemaster::Engine::Profile;
use base qw(Class::Accessor);
use o
2,
WARNING => 3,
ERROR => 4,
CRITICAL => 5,
);
our $start_time = time();
my $json = JSON::PP->new->allow_blessed->convert_blessed->canonical;
my $test_levels_config;
__PACKAGE__->mk
able_args;
$argstr = join( q{; },
map { $_ . q{=} . ( ref( $p_args->{$_} ) ? $json->encode( $p_args->{$_} ) : $p_args->{$_} ) }
sort keys %{$p_args} );
}
retur
:Constants qw( :ip :misc );
use Zonemaster::LDNS;
use Net::IP::XS;
use Time::HiRes qw[time];
use JSON::PP;
use MIME::Base64;
use Module::Find qw[useall];
use Carp qw( confess croak );
use List::Util
;
my $old = POSIX::setlocale( POSIX::LC_ALL, 'C' );
my $json = JSON::PP->new->allow_blessed->convert_blessed;
$json = $json->canonical( 1 );
open my $fh, '>', $filename or die "Cache
foreach my $addr ( sort keys %{ $object_cache{$name} } ) {
say $fh "$name $addr " . $json->encode( $object_cache{$name}{$addr}->cache->data );
}
}
close $fh or die $!;
$VERSION = version->declare( "v1.2.22" );
use File::ShareDir qw[dist_file];
use JSON::PP qw( encode_json decode_json );
use Scalar::Util qw(reftype looks_like_number);
use File::Slurp;
use Clone qw(
Data::Dumper;
use Net::IP::XS;
use Log::Any qw( $log );
use YAML::XS qw();
$YAML::XS::Boolean = "JSON::PP";
use Zonemaster::Engine::Constants qw( $DURATION_5_MINUTES_IN_SECONDS $DURATION_1_HOUR_IN_S
le = dist_file( 'Zonemaster-Engine', 'profile.json');
my $json = read_file( $default_file );
my $default_values = decode_json( $json );
foreach my $property_name ( keys %profil
els = ( $label, @{ $self->labels } );
return $self->new( { labels => \@labels } );
}
sub TO_JSON {
my ( $self ) = @_;
return $self->string;
}
1;
=head1 NAME
Zonemaster::Engine::DNSNa
=item prepend($label)
Returns a new L<Zonemaster::Engine::DNSName> object, representing the called one with the given label prepended.
=item TO_JSON
Helper method for JSON encoding.
=back
=cut
Class::Accessor "antlers";
use File::ShareDir qw[dist_file];
use File::Slurp qw( read_file );
use JSON::PP;
use Net::IP::XS;
use List::MoreUtils qw[uniq];
use Zonemaster::Engine;
use Zonemaster::Engi
se List::MoreUtils qw[uniq none];
use Locale::TextDomain qw[Zonemaster-Engine];
use Readonly;
use JSON::PP;
use Net::IP::XS;
use Zonemaster::Engine::Profile;
use Zonemaster::Engine::Constants qw[:ip]
my $json = JSON::PP->new->canonical->pretty;
if ( $p1 and scalar $p1->answer ) {
my @answer1 = map { lc $_->string } sort $p1->answer;
$answer1_string = $json->enco
my @answer2 = map { lc $_->string } sort $p2->answer;
$answer2_string = $json->encode( \@answer2 );
}
if ( $answer1_string eq $answer2_string ) {
iq none];
use List::Util qw[max];
use Locale::TextDomain qw[Zonemaster-Engine];
use Readonly;
use JSON::PP;
use Mail::SPF::v1::Record;
use Try::Tiny;
use Zonemaster::Engine::Profile;
use Zonemaster::
in( q{;}, sort keys %mx_set ) } );
}
if ( scalar %mx_set ){
my $data_json;
my $json = JSON::PP->new->canonical->pretty;
my $first = 1;
foreach my $ns ( keys %
a_json = $json->encode( \@data );
$first = 0;
}
else{
my @next_data = map { lc $_->string } sort @{ $mx_set{$ns} };
if ( $json->
declare("v1.0.8");
use Class::Accessor "antlers";
use Carp qw( confess );
use Data::Dumper;
use JSON::PP;
use List::MoreUtils qw[none any];
use Scalar::Util qw[blessed];
use Zonemaster::Engine::Prof
->numeric_level > $level;
}
return $levels{$level};
}
sub json {
my ( $self, $min_level ) = @_;
my $json = JSON::PP->new->allow_blessed->convert_blessed->canonical;
my %numeri
{args} = $m->args if $m->args;
push @out, \%r;
}
return $json->encode( \@out );
} ## end sub json
1;
=head1 NAME
Zonemaster::Engine::Logger - class that holds L<Zonemaster::E
s );
}
my $from = $self->packet->answerfrom // '<unknown>';
return $from;
}
sub TO_JSON {
my ( $self ) = @_;
return { 'Zonemaster::Engine::Packet' => $self->packet };
}
1;
=h
thod, that replaces undefined values with the string C<E<lt>unknownE<gt>>.
=item TO_JSON
Support method for L<JSON> to be able to serialize these objects.
=back
=head1 METHODS PASSED THROUGH
Thes