as 'template_index' => is => 'lazy', isa => NonEmptySimpleStr,
default => 'index.json';
has 'test_env_vars' => is => 'lazy', isa => ArrayRef,
documentation => 'Set these
=item C<template_index>
Name of the file containing the index of templates. Defaults to F<index.json>
=item C<test_env_vars>
Array reference. Set these environment vars to true when testing. Defau
2,
Name => "on-failure"
},
LogConfig => {
Config => {},
Type => "json-file"
},
SecurityOpt => undef,
VolumesFrom => undef,
Ulimits => [],
CgroupPar
r beanstalk queues
=head1 SYNOPSIS
use AnyEvent::Beanstalk::Worker;
use Data::Dumper;
use JSON;
my $w = AnyEvent::Beanstalk::Worker->new(
concurrency => 10,
initial_state
ved',
beanstalk_watch => 'jobs',
beanstalk_decoder => sub {
eval { decode_json(shift) };
}
);
$w->on(reserved => sub {
my $self = shift;
my ($qjob, $qres
a} = Mojo::UserAgent->new }
1;
Now we can use our B<WebWorker> class:
use WebWorker;
use JSON;
my $w = WebWorker->new(
concurrency => 50,
initial_state => 'reserved',
a;
use strict;
use warnings;
our $VERSION = '0.05';
use List::Util qw(sum);
use HTTP::Tiny;
use JSON ();
use Devel::Cover::DB;
our $API_ENDPOINT =
($ENV{KRITIKA_HOST} || 'https://kritika.io') . '
;
}
sub _post {
my $class = shift;
my ( $token, $coverage ) = @_;
$coverage = JSON::encode_json($coverage);
my $ua = $class->_build_ua;
my $response;
for my $i ( 1 .. 3 ) {
se Digest::SHA qw< sha1_hex sha256_hex >;
use Digest::MD5 qw< md5_hex >;
use Term::ANSIColor;
use JSON::PP;
use File::Path;
use File::Find;
use File::Copy;
use warnings;
use strict;
=head1 NAME
Ap
;
sub read_json {
open(my $fh,"<", "$base_path/packages.json") || die "cant open: $base_path/packages.json: $!";
my $json = <$fh>;
my $p = decode_json $json;
}
sub write_json {
my @p
et_packages(shift)};
my $json = encode_json \@p;
open(my $fh,">", "$base_path/packages.json") || die "cant open: $base_path/packages.json: $!";
print $fh $json;
}
sub printer {
my @p
$node->addChild($c_node);
}
}
}
return $node;
}
sub TO_JSON {
my $self = shift;
my $this = { };
my @ancestors = $self->get_class_ancestors();
or 'blessed' ManagedObjectReferences while letting
# other types fall through to the JSON::XS processor.
if ( $type eq 'ManagedObjectReference' ) {
if (blessed
bers = $class->SUPER::get_class_members();
return (@super_members, @class_members);
}
sub TO_JSON {
my $self = shift;
my $this = { };
my @ancestors = $self->get_class_ancestors();
::Docker::Events;
use strict;
use warnings;
use Eixo::Base::Clase qw(Eixo::Rest::Product);
use JSON;
my $DEFAULT_TIMEOUT = 30;
has(
Events=>[]
);
sub initialize {
my ($self, @args) =
= JSON->new->encode($args{filters});
}
$self->api->getEvents(
get_params=>[qw(filters since until)],
args=>\%args,
__callback => sub {
my ($events, $request) = @_;
my $j = JSON->
.com/json/$ip";
my $response = $self->dispatch(url => $url ,method => 'GET');
my $status = $response->status_line;
my $json_response = $response->decoded_content;
return $json_res
treamer> - brilliant. beautiful. insane. extensive. excessive. try it.
L<JSON::XS> - no, really. If it's just plain data, JSON is a great option.
=head1 AUTHOR
mst - Matt S. Trout <mst@shadowcat.co
ue = encode_utf8($self->{'val'});
$node->appendText($value);
return $node;
}
sub TO_JSON {
my $self = shift;
my $class = ref($self);
$class =~ s/VMOMI:://;
return {_clas
l dev libraries installed in system.
In ubuntu/debian:
apt-get install libssl-dev
=item *
JSON >= 2.50,
=item *
Net::HTTP >= 6.06,
=item *
HTTP::Server::Simple::CGI (for testing purpose)
le
Digest::MD5
Compress::Zlib
Encode
Carp
URI::Escape
URI::Escape::XS
JSON::XS
);
my $cmd = {
map{
$_.(' 'x(25-length($_))) => sub { my $x=shift; sub{ system("
package Eixo::Docker;
use 5.008;
use strict;
use warnings;
use Eixo::Base::Clase;
use JSON;
use Net::HTTP;
use Eixo::Rest::Client;
# Items to export into callers namespace by default. Note: do not
e warnings;
{
use URI;
use Carp;
use Readonly;
use LWP::UserAgent;
use JSON qw( from_json );
use Storable qw( store retrieve );
use HTTP::Status qw( HTTP_BAD_REQUEST );
if !$self{key};
croak "data_format must either be Perl or JSON"
if $self{data_format} !~ m{\A (?: perl|json ) \z}xmsi;
$self{ua} = LWP::UserAgent->new();
$self{ua}->agen
\%form );
$response = $self->{ua}->get($uri);
}
my $json = $response->content() || "";
my ($message) = $json =~ m{ "message" \s* : \s* "( [^"]+ )" }xms;
$message ||= $respo
caping single and double quotes and C<\n \r \t \0>. Utf-8 symbols are pretty valid for javascript/json.
=item * C<fix_ampersands> filter is not implemented, because it's marked as depricated and will
ints
Returns the hashref of API endpoints, loading them on first call from the C<share/endpoints.json> file.
=head2 endpoint
Processes the given endpoint as a template, using the named parameters
p
ravis token.
=head2 mime_type
MIME type to use for requests. Hardcoded default to C<travis-ci.2+json>.
=head2 base_uri
Base URI for Travis requests.
Hardcoded to the B<private> Travis CI server,
$self->{level}--;
return;
}
sub is_literal_number {
my $self = shift;
# Stolen from JSON::Tiny
return B::svref_2object(\$_[0])->FLAGS & (B::SVp_IOK | B::SVp_NOK)
&& 0 + $
t yet documented.
=cut
no indirect;
use Future;
use Dir::Self;
use URI;
use URI::Template;
use JSON::MaybeXS;
use Syntax::Keyword::Try;
use File::ShareDir ();
use Log::Any qw($log);
use Path::Tiny
:Async::TravisCI::Config;
use Net::Async::TravisCI::Job;
use Net::Async::TravisCI::Build;
my $json = JSON::MaybeXS->new;
=head2 configure
Applies configuration, which at the moment would involve ze
<share/endpoints.json> file.
=cut
sub endpoints {
my ($self) = @_;
$self->{endpoints} ||= do {
my $path = Path::Tiny::path(__DIR__)->parent(3)->child('share/endpoints.json');
$path
=item data_format
This is either 'json' or 'perl'. If you indicate 'json' then you'll get the
raw JSON as given by the remote API. Otherwise, the JSON::from_json function
is used to transform the r