ta::Riak::MapReduce::Phase::Reduce;
use HTTP::Headers::ActionPack::LinkList;
use JSON::XS qw/decode_json encode_json/;
with 'Data::Riak::Role::HasRiak';
has name => (
is => 'ro',
isa => '
ets/%s/keys', $self->name),
query => { keys => 'true' }
})->first;
return decode_json( $result->value )->{'keys'};
}
sub count {
my $self = shift;
my $map_reduce = Data::Ria
ce->mapreduce;
my ( $result ) = $map_reduce_results->results->[0];
my ( $count ) = decode_json($result->value) || 0;
return $count->[0];
}
sub remove_all {
my $self = shift;
my $
elf->api_config->{siteid} ||= 'EBAY-US';
$self->api_config->{response_encoding} ||= 'XML'; # JSON, NV, SOAP
$self->api_config->{request_encoding} ||= 'XML';
$self->_load_yaml_defaults()
pReduce::Phase::Link;
{
$Data::Riak::MapReduce::Phase::Link::VERSION = '1.1';
}
use Moose;
use JSON::XS ();
# ABSTRACT: Link phase of a MapReduce
with ('Data::Riak::MapReduce::Phase');
has buck
sub pack {
my $self = shift;
my $href = {};
$href->{keep} = $self->keep ? JSON::XS::true() : JSON::XS::false() if $self->has_keep;
$href->{bucket} = $self->bucket if $self->has_buck
Riak::MapReduce::Phase::Map::VERSION = '1.1';
}
use Moose;
use Moose::Util::TypeConstraints;
use JSON::XS ();
# ABSTRACT: Map phase of a MapReduce
with ('Data::Riak::MapReduce::Phase');
has langu
'
);
sub pack {
my $self = shift;
my $href = {};
$href->{keep} = $self->keep ? JSON::XS::true() : JSON::XS::false() if $self->has_keep;
$href->{language} = $self->language;
$href->{name}
elf->api_config->{siteid} ||= 'EBAY-US';
$self->api_config->{response_encoding} ||= 'XML'; # JSON, NV, SOAP
$self->api_config->{request_encoding} ||= 'XML';
$self->_load_yaml_defaults()
;
$self->api_config->{siteid} ||= 0;
$self->api_config->{response_encoding} ||= 'XML'; # JSON, NV, SOAP
$self->api_config->{request_encoding} ||= 'XML';
$self->_load_yaml_defaul
ta::Riak::Async::Bucket;
{
$Data::Riak::Async::Bucket::VERSION = '2.0';
}
use Moose;
use JSON 'decode_json';
use namespace::autoclean;
with 'Data::Riak::Role::Bucket';
sub remove_all {
my ($s
esult::JSONValue;
{
$Data::Riak::Result::JSONValue::VERSION = '2.0';
}
# ABSTRACT: A result containing JSON data
use Moose::Role;
use JSON 'decode_json';
use namespace::autoclean;
sub json_value
{
my ($self) = @_;
decode_json $self->value;
}
1;
__END__
=pod
=head1 NAME
Data::Riak::Result::JSONValue - A result containing JSON data
=head1 VERSION
version 2.0
=head1 DESCRIPTION
Results for requests resulting in JSON data use this role to provide convenient
access to the decoded body payload.
=head1 METHODS
=head2 json_value
=head1 AUTHORS
=over 4
=item *
Andrew Nelson
as parameters => ( is => 'rw' );
has api => ( is => 'rw', isa => 'Net::Jenkins' );
# raw json
has raw_json => ( is => 'rw', isa => 'Str' );
sub BUILDARGS {
my ($self,%args) = @_;
my $buil
= shift;
my $uri = URI->new( $build_url );
# http://ci.jruby.org/job/jruby-git/4259/api/json
my ($job_name,$build_id) =
($build_url =~ m{/job/([^/]+)/([^/]+)});
my ($job_u
Jenkins::Job::Build;
use Jenkins::Notification;
use AnyEvent::Socket;
use Moose;
use methods;
use JSON::XS;
our @ISA = ( 'Moose::Object', 'Exporter' );
our @EXPORT = qw(parse_jenkins_notification);
;
sub parse_jenkins_notification {
my $json = shift;
my $args = decode_json $json;
return Jenkins::Notification->new( %$args , raw_json => $json );
}
method start ($prepare_cb) {
ret
) = @_;
my $json = '';
my $buf = '';
while( my $bytes = sysread $fh, $buf, 1024 ) {
$json .= $buf;
}
eval {
if( $json ) {
Net::Jenkins::Job::Build;
use Net::HTTP;
use LWP::UserAgent;
use Moose;
use methods;
use URI;
use JSON;
has scheme => ( is => 'rw', isa => 'Str', default => 'http' );
has host => (
is =
{
return $self->user_agent->get($uri);
}
method get_json ( $uri ) {
my $response = $self->user_agent->get($uri);
return decode_json $response->decoded_content if $response->is_success;
}
method summary {
my $uri = $self->get_base_url . '/api/json';
return $self->get_json( $uri );
}
method mode {
return $self->summary->{mode};
}
method jobs {
return map { Net::Jenkin
>.
=item tmpdir
Default: guessed via C<File::Spec::tmpdir()>.
Name of URI parameter to specify JSON callback function name. Defaults
to C<callback>. Only effective when C<allow_callback> is turned
package Reddit;
use 5.010001;
use strict;
use warnings;
use JSON;
use HTTP::Cookies;
use LWP::UserAgent;
use Moose;
=head1 NAME
Reddit - Perl extension for http://www.reddit.com
See github for t
t.
This module is still largely inprogress.
=head2 Requires
common::sense
LWP::UserAgent
JSON
HTTP::Cookies
For Testing:
Data::Dumper
=head2 EXPORT
None.
=cut
# for testing purpose
ub { $_[0]->api_url . 'vote' },
);
has 'api_type' => (
is => 'ro',
isa => 'Str',
default => 'json',
);
has 'ua' => (
is => 'rw',
isa => 'LWP::UserAgent',
default => sub { LWP::UserA
env perl
use Net::Jenkins;
use Jenkins::NotificationListener;
use Getopt::Long;
use AnyEvent;
use JSON::XS;
use YAML;
my $host = '127.0.0.1';
my $port = 8888;
my $debug;
my $result = GetOptions(
ayload = shift; # Jenkins::Notification;
if( $debug ) {
my $args = decode_json $payload->raw_json;
print "===== Payload Start =====\n";
print Dump $args;
}
pri
{
$Juno::Check::RawCommand::VERSION = '0.005';
}
# ABSTRACT: A raw command check for Juno
use JSON;
use Carp;
use Try::Tiny;
use AnyEvent::Util 'fork_call';
use System::Command;
use Any::Moose;
u
return encode_json $data;
} sub {
# deserialize
my $serialized = shift;
my $data = '';
try { $data = decode_json $serialized }
tyPrint - Pretty Printing DebugObj
=head1 SYNOPSIS
DBIC_TRACE_PROFILE=~/dbic.json perl -Ilib ./foo.pl
Where dbic.json contains:
{
"profile":"console",
"show_progress":1,
"squash_repeats
asename qw(dirname);
use Guard;
use Mason::Component::ClassMeta;
use Mason::Util qw(dump_one_line json_encode read_file taint_is_on trim);
use Mason::Moose;
# Passed attributes
has 'interp' => (
{blocks}->{flags} ) {
if (%$flags) {
( my $json = json_encode($flags) ) =~ s/\n//g;
return "# FLAGS: $json\n\n";
}
}
}
method _output_global_declaration ($
roformats;
use 5.010;
use autodie;
use strict;
use utf8;
use HTML::Microformats 0.100 qw();
use JSON 2.00 qw();
use RDF::Trine 0.135 qw();
use RDF::Query 2.900 qw();
use XML::Atom::OWL 0.100 qw();
t, $entry);
}
return $rv;
}
*entry_all_objects = \&all_objects;
sub TO_JSON
{
return $_[0]->all_objects;
}
sub json
{
my ($self, %opts) = @_;
$opts{'convert_blessed'} = 1
unless defined
ssed'};
$opts{'utf8'} = 1
unless defined $opts{'utf8'};
return JSON::to_json($self->all_objects, \%opts);
}
sub entry_json
{
my ($self, $entry, %opts) = @_;
$opts{'convert_blessed'} = 1
package Mojolicious::Plugin::Recaptcha;
use strict;
use Mojo::ByteStream;
use Mojo::JSON;
use base 'Mojolicious::Plugin';
our $VERSION = '0.61';
sub register {
my ($self,$app,$conf) = @_;
$conf
$options->{'ssl'};
my $scheme = ($conf->{'ssl'}) ? 'https' : 'http';
my $r_options = Mojo::JSON->new()->encode($options);
$app->renderer->add_helper(
recaptcha_html => sub {
my $self = sh