e File::Temp qw(tempdir);
use File::Path;
use File::Copy;
use Archive::Any;
use Data::Dumper;
use JSON;
use Encode;
use Moose;
use List::Util qw(any);
with qw(MooseX::Getopt);
use MooseX::Types::Path
th::Class::Dir',coerce=>1,default=>'returnvalues');
has 'json_encoder' => (is=>'ro',lazy_build=>1);
sub _build_json_encoder {
return JSON->new->pretty;
}
sub run {
my $self = shift;
i
json/;
$old_files{$file->basename}=1;
}
# analyse cpan
foreach my $dist (sort {$a->dist cmp $b->dist} $p->latest_distributions) {
delete $old_files{$dist->distvname.'.json
v5.24;
use Mojo::Base -strict, -signatures;
use JSON::Validator;
use JSON::Validator::Formats;
use List::Util qw(uniq);
use Mojo::JSON qw(decode_json);
use Mojo::Loader qw(data_section);
use Mojo::U
a;
my $api_spec = data_section(__PACKAGE__, 'openapi.json');
$api_spec =~ s{/components/schemas}{}g;
my $data = decode_json( $api_spec );
my $schemas = $data->{components}->{sc
uired};
($content_type) = sort keys $body->%*;
if ( $content_type eq 'application/json' ) {
my $schema = $body->{$content_type}->{schema};
my $prop = $schema->{
{ 'JSON' => \&JSON::XS::encode_json, };
}
);
has 'deserializable_types' => (
is => 'ro',
default => sub {
use_module('JSON::XS');
{ 'JSON' => \&JSON::XS::decode_json,
{
type=>'JSON',
timeout=>1000, # milisecs
},
\%payload
)
# $msg = ['something','JSON;1000','{"foo":42}'] # payload converted to JSON
my ($command,
x::RPC::Message->pack(
'cmd',
{
type=>'JSON'
},
@payloads
)
# $msg4 = ['cmd','JSON;1000','{"foo":42}','["bar",8]']
my $curry = ZMQx::RPC::Messa
my $payload = join('',@file_contents);
my $tlsrpt = eval{ Mail::TLSRPT::Report->new_from_json($payload) };
my $error = $@;
if ( $tlsrpt ) {
push @all_output, $tlsrpt->as_csv(
contents);
$tlsrpt = eval{ Mail::TLSRPT::Report->new_from_json($payload) };
$tlsrpt //= eval{ Mail::TLSRPT::Report->new_from_json_gz($payload) };
if ( $tlsrpt ) {
$tlsrpt->process
;
}
sub new_from_json($class,$json) {
if ( $json =~ /^\037\213/ ) {
return $class->new_from_json_gz($json);
}
my $j = JSON->new;
my $data = $j->decode($json);
return $cla
ata($data);
}
sub new_from_json_gz($class,$compressed_json) {
my $json;
IO::Uncompress::Gunzip::gunzip(\$compressed_json,\$json);
return $class->new_from_json($json);
}
sub new_from_data($cl
->{'report-id'},
policies => \@policies,
);
return $self;
}
sub as_json($self) {
my $j = JSON->new;
$j->canonical;
return $j->encode( $self->as_struct );
}
sub as_struc
dzil
Makefile.PL # generated by dzil
MANIFEST # generated by dzil or other tools
META.json # generated by dzil or other tools
META.yml # generated by dzil or other tools
README
spec version 2|CPAN::Meta::Spec> was conceived,
it was implemented using a new file called F<META.json> that can coexist with
the legacy format. In either format, this metadata describes aspects of th
these files as well via the
L<[MetaYAML]|Dist::Zilla::Plugin::MetaYAML> and
L<[MetaJSON]|Dist::Zilla::Plugin::MetaJSON> plugins.
=head2 Other Files
The meat of the CPAN distribution, the code, tests
uest_opts;
$params->{body} //= {};
if ( $params->{body}->%* ) {
%request_opts = ( json => $params->{body} );
}
$params->{query} //= {};
my $query = '';
if ( $params->{
( $tx->error ) {
carp $tx->error->{message};
return;
}
return $response->json;
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
DNS::Hetzner::APIBase - Base class for all e
5.20.0;
use strict;
use warnings;
require feature;
use Import::Into;
use Carp;
use English;
use JSON;
use Types::Standard;
use Type::Utils;
use open ':std', ':encoding(UTF-8)';
sub import {
str
:Utils->import::into(scalar caller, qw{ class_type } );
English->import::into(scalar caller);
JSON->import::into(scalar caller);
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
Mail::TLSRPT::P
ins in one of these formats.
my %revisions = (
1 => [
'GatherDir',
'MetaYAML',
'MetaJSON',
'License',
'ReadmeAnyFromPod',
'PodSyntaxTests',
'Test::ReportPrereqs',
['T
:Package',
'ShareDir',
'ExecDir',
],
2 => [
'GatherDir',
'MetaYAML',
'MetaJSON',
'License',
'Pod2Readme',
'PodSyntaxTests',
'Test::ReportPrereqs',
['Test::C
luginset_execdir },
],
3 => [
sub { $_[0]->pluginset_gatherer },
'MetaYAML',
'MetaJSON',
'License',
'Pod2Readme',
'PodSyntaxTests',
'Test::ReportPrereqs',
['Test::C
my $time = $args->{_time} // $self->time; # Ability to override time for testing!
my $extended_json = ''; # Reserved for future use, should be empty.
my $packet = join( "\n",
$self->feed_nam
used_auth ? '' : $self->used_auth ? 'Y' : 'N',
$self->mail_from_domain // '',
$extended_json,
);
$packet = join( "\n",
$packet,
$self->_checksum($packet),
);
return $packet
7'; # VERSION
use parent qw(Net::Async::Trello::Generated::Board);
use JSON::MaybeXS;
use Log::Any qw($log);
my $json = JSON::MaybeXS->new;
=head2 subscribe
=cut
sub subscribe {
my ($self, %arg
->websocket->then(sub {
my $req_id = $trello->next_request_id;
my $txt = $json->encode({
type => "subscribe",
modelType => "B
y_repeat);
use URI;
use URI::QueryParam;
use URI::Template;
use URI::wss;
use HTTP::Request;
use JSON::MaybeUTF8 qw(:v1);
use Syntax::Keyword::Try;
use File::ShareDir ();
use Log::Any qw($log);
use
//= URI->new('https://api.trello.com/1/') }
sub mime_type { shift->{mime_type} //= 'application/json' }
sub oauth {
my ($self) = @_;
$self->{oauth} //= Net::Async::OAuth::Client->new(
)->child('share/endpoints.json');
$path = Path::Tiny::path(
File::ShareDir::dist_file(
'Net-Async-Trello',
'endpoints.json'
)
)
(IO::Async::Notifier);
use Syntax::Keyword::Try;
use JSON::MaybeXS;
use Net::Async::WebSocket::Client;
use Log::Any qw($log);
my $json = JSON::MaybeXS->new;
sub configure {
my ($self, %args) = @
my ($conn) = @_;
$log->tracef("Connected");
# $conn->send_frame($json->encode({"type"=> "ping","reqid"=>0}));
Future->done($conn);
});
};
}
my
->{update_channel}{$id} //= $self->ryu->source;
$conn->send_frame(
buffer => $json->encode({
idModel => $id,
invitationTokens => [],
ead1 DEPENDENCIES
The C<Forks::Queue> module and all its current implementations require
the L<JSON|JSON> module.
=head1 SEE ALSO
L<Thread::Queue|Thread::Queue>, L<File::Queue|File::Queue>,
L<Queue
package Forks::Queue::SQLite;
use strict;
use warnings;
use Carp;
use JSON;
use DBI;
use DBD::SQLite;
use Time::HiRes 'time';
use base 'Forks::Queue';
use 5.010; # implementation contains // //=
UG;
*XDEBUG = \$Forks::Queue::XDEBUG;
$SIG{IO} = sub { } if $Forks::Queue::NOTIFY_OK;
our $jsonizer = JSON->new->allow_nonref(1)->ascii(1);
sub new {
my $class = shift;
my %opts = (%Forks::
call begin_work/commit from the caller
my ($self,$item,$timestamp,$id) = @_;
my $jitem = $jsonizer->encode($item);
my $dbh = $self->_dbh;
my $sth = $dbh->prepare("INSERT INTO the_queue
:AttributeShortcuts;
use Types::Standard qw/Str Bool Num/;
use Types::URI qw/Uri/;
use JSON::MaybeXS 'decode_json';
use Path::Tiny;
use DateTime;
use DateTime::Format::RFC3339;
with 'Badge::Depot';
#
ory.json/);
if(!$log_file->exists) {
$self->log('! Could not find cover history file (.coverhistory.json), no coverage to add');
return -1;
}
my $history = decode_json($l
->slurp);
if(!scalar @$history) {
$self->log('! No coverage history in .coverhistory.json, nothing to add');
return -1;
}
my $summary = $history->[-1];
my $created_at
e;
return $assets->each(
sub {
my ($asset, $index) = @_;
my $attrs = $asset->TO_JSON;
$attrs->{key} = 'js-min';
$attrs->{minified} = 1;
return if $asset
$store = $self->assetpack->store;
return
unless $self->enabled || $format ~~ ['html', 'json'];
DEBUG && diag "Process topic [%s]", $topic;
#~ return unless $self->enabled;!!! below
');
push @$collect, $asset
and next
if grep $asset->format eq $_, qw(css js json html);
push @other, $asset;
}
# preserve assets such as images and font fi
$collect->[0]->format;
#~ return
#~ unless $self->enabled || $format ~~ ['html', 'json'];
$content = $collect->map('content')->map(sub { /\n$/ ? $_ : "$_\n" })->join;
#~