:JSON;
use strict;
use warnings;
use Carp qw/croak/;
our $VERSION = '1.000161';
BEGIN {
local $@ = undef;
my $ok = eval {
require JSON::MaybeXS;
JSON::MaybeXS->import('JSON'
1;
if (JSON() eq 'JSON::PP') {
*JSON_IS_PP = sub() { 1 };
*JSON_IS_XS = sub() { 0 };
*JSON_IS_CPANEL = sub() { 0 };
*JSON_IS_CPANEL_OR_XS =
}
elsif (JSON() eq 'JSON::XS') {
*JSON_IS_PP = sub() { 0 };
*JSON_IS_XS = sub() { 1 };
*JSON_IS_CPANEL = sub() { 0 };
*JSON_IS_CPANEL_OR_XS =
ness::Util::File::JSON;
use strict;
use warnings;
our $VERSION = '1.000161';
use Carp qw/croak confess/;
use Test2::Harness::Util::JSON qw/encode_json decode_json encode_pretty_json/;
use parent 'T
y/;
sub decode { shift; decode_json(@_) }
sub encode { shift->pretty ? encode_pretty_json(@_) : encode_json(@_) }
sub reset { croak "line reading is disabled for json files" }
sub read_line { croak
t2::Harness::Util::File::JSON - Utility class for a JSON file.
=head1 DESCRIPTION
Subclass of L<Test2::Harness::Util::File> which automatically handles
encoding/decoding JSON data.
=head1 SYNOPSIS
ness::Util::File::JSON;
use strict;
use warnings;
our $VERSION = '2.000004';
use Carp qw/croak confess/;
use Test2::Harness::Util::JSON qw/encode_json decode_json encode_pretty_json/;
use parent 'T
y/;
sub decode { shift; decode_json(@_) }
sub encode { shift->pretty ? encode_pretty_json(@_) : encode_json(@_) }
sub reset { croak "line reading is disabled for json files" }
sub read_line { croak
t2::Harness::Util::File::JSON - Utility class for a JSON file.
=head1 DESCRIPTION
Subclass of L<Test2::Harness::Util::File> which automatically handles
encoding/decoding JSON data.
=head1 SYNOPSIS
package Test2::Harness::Util::JSON;
use strict;
use warnings;
use Carp qw/confess longmess croak/;
use Cpanel::JSON::XS();
use Importer Importer => 'import';
use File::Temp qw/ tempfile /;
our $VERS
ode_json
encode_json
encode_pretty_json
stream_json_l
stream_json_l_url
stream_json_l_file
json_true
json_false
encode_json_file
decode_json_file
};
my $json =
Cpanel::JSON::XS->new->utf8(1)->convert_blessed(1)->allow_nonref(1);
my $ascii = Cpanel::JSON::XS->new->ascii(1)->convert_blessed(1)->allow_nonref(1);
my $pretty = Cpanel::JSON::XS->new->ascii(1)->p
onents(
"InflateColumn::DateTime",
"InflateColumn::Serializer",
"InflateColumn::Serializer::JSON",
);
__PACKAGE__->table("reporting");
__PACKAGE__->add_columns(
"reporting_id",
{ data_type =
onents(
"InflateColumn::DateTime",
"InflateColumn::Serializer",
"InflateColumn::Serializer::JSON",
);
__PACKAGE__->table("email_verification_codes");
__PACKAGE__->add_columns(
"evcode",
{ da
onents(
"InflateColumn::DateTime",
"InflateColumn::Serializer",
"InflateColumn::Serializer::JSON",
);
__PACKAGE__->table("api_keys");
__PACKAGE__->add_columns(
"value",
{ data_type => "uuid"
onents(
"InflateColumn::DateTime",
"InflateColumn::Serializer",
"InflateColumn::Serializer::JSON",
);
__PACKAGE__->table("source_subs");
__PACKAGE__->add_columns(
"source_sub_id",
{ data_typ
onents(
"InflateColumn::DateTime",
"InflateColumn::Serializer",
"InflateColumn::Serializer::JSON",
);
__PACKAGE__->table("runs");
__PACKAGE__->add_columns(
"run_uuid",
{ data_type => "uuid",
onents(
"InflateColumn::DateTime",
"InflateColumn::Serializer",
"InflateColumn::Serializer::JSON",
);
__PACKAGE__->table("run_fields");
__PACKAGE__->add_columns(
"event_uuid",
{ data_type =>
onents(
"InflateColumn::DateTime",
"InflateColumn::Serializer",
"InflateColumn::Serializer::JSON",
);
__PACKAGE__->table("sessions");
__PACKAGE__->add_columns(
"session_uuid",
{ data_type =>
onents(
"InflateColumn::DateTime",
"InflateColumn::Serializer",
"InflateColumn::Serializer::JSON",
);
__PACKAGE__->table("users");
__PACKAGE__->add_columns(
"user_id",
{ data_type => "bigint
onents(
"InflateColumn::DateTime",
"InflateColumn::Serializer",
"InflateColumn::Serializer::JSON",
);
__PACKAGE__->table("coverage_manager");
__PACKAGE__->add_columns(
"coverage_manager_id",
onents(
"InflateColumn::DateTime",
"InflateColumn::Serializer",
"InflateColumn::Serializer::JSON",
);
__PACKAGE__->table("projects");
__PACKAGE__->add_columns(
"project_id",
{ data_type => "
onents(
"InflateColumn::DateTime",
"InflateColumn::Serializer",
"InflateColumn::Serializer::JSON",
);
__PACKAGE__->table("coverage");
__PACKAGE__->add_columns(
"event_uuid",
{ data_type => "
onents(
"InflateColumn::DateTime",
"InflateColumn::Serializer",
"InflateColumn::Serializer::JSON",
);
__PACKAGE__->table("config");
__PACKAGE__->add_columns(
"config_id",
{ data_type => "int
onents(
"InflateColumn::DateTime",
"InflateColumn::Serializer",
"InflateColumn::Serializer::JSON",
);
__PACKAGE__->table("jobs");
__PACKAGE__->add_columns(
"job_uuid",
{ data_type => "uuid",
onents(
"InflateColumn::DateTime",
"InflateColumn::Serializer",
"InflateColumn::Serializer::JSON",
);
__PACKAGE__->table("job_tries");
__PACKAGE__->add_columns(
"job_try_uuid",
{ data_type =
onents(
"InflateColumn::DateTime",
"InflateColumn::Serializer",
"InflateColumn::Serializer::JSON",
);
__PACKAGE__->table("events");
__PACKAGE__->add_columns(
"event_uuid",
{ data_type => "uu
onents(
"InflateColumn::DateTime",
"InflateColumn::Serializer",
"InflateColumn::Serializer::JSON",
);
__PACKAGE__->table("session_hosts");
__PACKAGE__->add_columns(
"session_host_id",
{ data