= cwd();
chdir '/tmp/cpan-fixes';
cpanm(@params);
chdir $cwd;
}
sub parse_meta_json {
$_[0] ||= 'META.json';
require CPAN::Meta;
return CPAN::Meta->load_file( $_[0] );
}
sub capture_stdo
ixes;
$caller_stash->{cpanm_fix} = *cpanm_fix;
$caller_stash->{parse_meta_json} = *parse_meta_json;
$caller_stash->{capture_stdout} = *capture_stdout;
$caller_stash->{deploy_st
ce );
use Plack::Response;
use Plack::Session;
use LWP::Protocol::https;
use LWP::UserAgent;
use JSON;
sub prepare_app {
my $self = shift;
$self->audience or croak 'audience is not set';
}
>method eq 'POST' ) {
my $uri = 'https://verifier.login.persona.org/verify';
my $json = {
assertion => $req->body_parameters->{'assertion'},
audience => $self
T', $uri );
$persona_req->header( 'Content-Type' => 'application/json' );
$persona_req->content( to_json( $json, { utf8 => 1 } ) );
my $ua = LWP::UserAgent->new( ssl_opts => {
',
isa => ParserClass,
coerce => 1,
lazy => 1,
default => 'Spica::Parser::JSON',
);
# -------------------------------------------------------------------------
# auto build ar
arser> expects the name of the class that inherits C<Spica::Parser>.
By default, C<Spica::Parser::JSON> is used.
=item C<is_suppress_object_creation>
Specifies the receiver object creation mode. By
e warnings;
use XML::Twig;
use feature 'say';
use JSON;
use Carp;
#carp from calling package, not from here
our @CARP_NOT = qw(TBX::XCS TBX::XCS::JSON);
use Data::Dumper;
our $VERSION = '0.05'; # VERS
package Geo::Coder::OSM;
use strict;
use warnings;
use Carp qw(croak);
use Encode ();
use JSON;
use LWP::UserAgent;
use URI;
our $VERSION = '0.03';
$VERSION = eval $VERSION;
our %SOURCES = (
o
ch');
$uri->query_form(
q => $location,
format => 'json',
addressdetails => 1,
'accept-language' => 'en',
%params,
);
lat => $lat,
lon => $lon,
format => 'json',
addressdetails => 1,
'accept-language' => 'en',
%params,
);
# ABSTRACT: Add TO_JSON to your packages without the boilerplate
package Package::JSONable;
{
$Package::JSONable::VERSION = '0.001';
}
use strict;
use warnings;
use Scalar::Util qw(reftype);
use Ca
qw(croak);
use List::MoreUtils qw(none);
use JSON ();
sub import {
my ( $class, %import_opts ) = @_;
my ( $target ) = caller;
my $to_json = sub {
my ( $self, %opts ) = @_;
if ( $value ) {
$hash{$method} = JSON::true;
}
else {
$hash{$method} = JSON::false;
}
}
}
ad1 VERSION
version 0.04
=head1 SYNOPSIS
my $client = Net::HTTP::Spore->new_from_spec('api.json');
# foo=bar and blah=baz will be passed on each request.
$client->enable('DefaultParam
sumer;
use 5.006;
use strict;
use warnings;
use base 'Amazon::SQS::ProducerConsumer::Base';
use JSON::XS;
use Encode qw( encode_utf8 is_utf8 );
use constant {
DEFAULT_N_MESSAGES => 10,
DEFAULT_WA
tf8( $body ) if is_utf8( $body );
$object = decode_json $body;
};
if ( $@ ) {
say "left bad message in queue; could not decode JSON from $message->{Body}: $@";
} else {
return $ob
ct;
use warnings;
our $VERSION = "0.02";
use parent qw(Exporter);
use JSON::XS;
our @EXPORT = qw(call_js);
my $JSON = JSON::XS->new()->ascii(1)->allow_nonref();
my %_ESCAPE = (
'+' => '\\u00
my $json = $JSON->encode($data);
$json =~ s!([&+<>])!$_ESCAPE{$1}!g;
join('',
q{<script class="call_js" type="text/javascript">},
$func,
'(',
$json,
if ( env_true('AUTHOR_TESTING') or env_true('RELEASE_TESTING') ) {
my $prereqs = parse_meta_json()->effective_prereqs;
my $reqs = $prereqs->requirements_for( 'develop', 'requires' );
my
is
# PODNAME: xcs2json.pl
our $VERSION = '0.05'; # VERSION
# ABSTRACT: Print a JSON representation of the input XCS file
use TBX::XCS;
use TBX::XCS::JSON qw(json_from_xcs);
print json_from_xcs(TBX::XC
S->new(file => $ARGV[0]));
__END__
=pod
=head1 NAME
xcs2json.pl - Print a JSON representation of the input XCS file
=head1 VERSION
version 0.05
=head1 AUTHOR
Nathan Glenn <garfieldnate@gmail.c
ts::File;
use warnings;
use strict;
use base 'Dezi::Stats';
use Carp;
use Log::Dispatchouli;
use JSON;
our $VERSION = '0.001006';
=head1 NAME
Dezi::Stats::File - store Dezi statistics via Log::Dis
ef> encoded as JSON to the dispatcher()->log method.
=cut
sub insert {
my $self = shift;
my $row = shift or croak "hashref required";
$self->{dispatcher}->log( encode_json($row) );
r
package Told::Client;
use 5.016002;
use strict;
use warnings;
use JSON;
use LWP;
require Exporter;
our @ISA = qw(Exporter);
our %EXPORT_TAGS = ( 'all' => [ qw(
tell
setDebug
setConnectio
'} =~ /^test/){
$result = encode_json(\%data);
} else {
$result = $browser->post($self->{'host'}."/log"
, encode_json \%data
);
}
} elsif($self
clone/update all your repositories from github.com
use LWP::UserAgent;
use Config::GitLike;
use JSON 2 ();
sub repo_uris {
my $config_file = "$ENV{HOME}/.gitconfig";
my $config = Config::GitLi
ig_file'\n";
my $json = _get_json("http://github.com/api/v1/json/$login?login=$login&token=$token");
my $data = eval { JSON->new->decode($json) };
die "BAD JSON\n$@\n$json\n" unless $data;
t@github.com:%s/%s.git',
$login,
$repo->{name};
}
return \%repo_uri;
}
sub _get_json {
my $url = shift;
my $ua = LWP::UserAgent->new;
$ua->env_proxy;
my $response = $ua->ge
se TBX::XCS;
use TBX::XCS::JSON qw(xcs_from_json);
use File::Slurp;
my $rng;
if($ARGV[0] eq '--json'){
my $json = read_file($ARGV[1]);
my $xcs = xcs_from_json($json);
$rng = generate_rng(
nst the XCS constraints and the core TBX structure.
Passing C<--json> as the first argument will cause the script to expect
an XCS JSON file instead of an XML file.
=head1 AUTHOR
Nathan Glenn <garf
package WWW::Tabela::FipeWrite;
use JSON::XS;
use File::Slurp;
use Moo;
sub write {
my ( $self, $veiculos ) = @_;
write_file( 'fipe.json', encode_json $veiculos );
}
1;
ent::Socket;
use Getopt::Long;
use JSON::PP;
our $VERSION = "0.03";
$| = 1;
$AnyEvent::Log::FILTER->level("info");
our %Config = (
config_file => "rhttp.json",
cert_file => "",
key_fil
r exit;
if ($Config{add}) {
my $json_config = config($Config{config_file});
my $add = delete($Config{add});
%Config = %{$json_config} if defined $json_config;
if ($add =~ m#^vhost:(
e}, JSON::PP->new->ascii->pretty->encode(\%Config));
exit;
}
if ($Config{del}) {
my $json_config = config($Config{config_file});
my $del = delete($Config{del});
%Config = %{$json_co
_perl_code {
my $PERL_NAME = '[A-Za-z_][A-Za-z0-9_]*';
# Class name
# Foo::Bar
# JSON::PP::
return 1 if $_[0] =~ /\A
[\+\$]?
(?: $PERL_NAME :: )+
$PERL_NAM
ef access
return 1 if $_[0] =~ /\A
\$ $PERL_NAME -> \{ $PERL_NAME \}
\z/x;
# JSON::XS-ish boolean value
return 1 if $_[0] eq '\1' || $_[0] eq '\1';
return 0;
}
1;
__END_
e JSON::XS qw(decode_json);
use Time::HiRes;
use Try::Tiny;
our $VERSION = '0.07';
my @file_types = ({
type => 'json',
re => qr{\.json$},
parser => sub {
my ($filename) = @_;
my $json;
$filename) =~ /(.*)/s; # untaint
try {
$json = decode_json(encode('UTF-8', $1));
} catch {
warning "couldn't parse json file ($filename): $_\n";
};
} catch {
warning "couldn't find file to parse ($filename): $_\n";
};
return $json;
},
});
my $dynamic_config;
register dynamic_config => sub {
my ($file_key) = @_;
initialize() unless $dynam
e JSON::XS qw(decode_json);
use Time::HiRes;
use Try::Tiny;
our $VERSION = '0.07';
my @file_types = ({
type => 'json',
re => qr{\.json$},
parser => sub {
my ($filename) = @_;
my $json;
$filename) =~ /(.*)/s; # untaint
try {
$json = decode_json(encode('UTF-8', $1));
} catch {
warning "couldn't parse json file ($filename): $_\n";
};
} catch {
warning "couldn't find file to parse ($filename): $_\n";
};
return $json;
},
});
my $dynamic_config;
register dynamic_config => sub {
my ($file_key) = @_;
initialize() unless $dynam