Group
Extension

Matches 6

App-Presto ( B/BP/BPHILLIPS/App-Presto-0.009.tar.gz, BPHILLIPS, 2012; MetaCPAN )
App-Presto/lib/App/Presto/Client/ContentHandlers/JSON.pm ( view source; MetaCPAN )
sto::Client::ContentHandlers::JSON;
BEGIN {
  $App::Presto::Client::ContentHandlers::JSON::AUTHORITY = 'cpan:BPHILLIPS';
}
{
  $App::Presto::Client::ContentHandlers::JSON::VERSION = '0.009';
}

# ABST
izing of JSON requests/responses

use Moo;
my $HAS_JSON;
BEGIN {
	eval 'use JSON; $HAS_JSON = 1;'
}
sub can_deserialize {
	my $self = shift;
	my $content_type = shift;
	return unless $HAS_JSON;
	retur
~ m{^application/json}i;
}

sub deserialize {
	my $self = shift;
	my $content = shift;
	my $ref;
	eval { $ref = JSON::decode_json($content) || 1 } or do {
		warn "Unable to parse JSON: $@";
	};
	retur
App-Presto ( B/BP/BPHILLIPS/App-Presto-0.009.tar.gz, BPHILLIPS, 2012; MetaCPAN )
App-Presto/lib/App/Presto/Command/headers.pm ( view source; MetaCPAN )
1,
                desc => 'Set content-type header',
                args => sub { ['application/json','application/x-www-form-urlencoded'] },
                proc    => sub { $client->set_header( 'C
App-Presto ( B/BP/BPHILLIPS/App-Presto-0.009.tar.gz, BPHILLIPS, 2012; MetaCPAN )
App-Presto/lib/App/Presto/Config.pm ( view source; MetaCPAN )
ON = '0.009';
}

# ABSTRACT: Manage configuration for a given endpoint

use Moo;
use JSON qw(decode_json encode_json);
use File::HomeDir;
use File::Path 2.08 qw(make_path);

has endpoint => (
    is =
'HASH'; },
);
sub _build_config {
    my $self = shift;
    my $config_file = $self->file('config.json');
    if (! -e $config_file ) {
        warn "creating new config file: $config_file\n";
       
ode_json({});
        close $fh;
    }

    my $config;
    eval {
        local $/;
        open( my $fh, '<', $config_file ) or die "Unable to open $config_file for reading: $!";
        my $json_te
App-Presto ( B/BP/BPHILLIPS/App-Presto-0.009.tar.gz, BPHILLIPS, 2012; MetaCPAN )
App-Presto/lib/App/Presto/Command/config.pm ( view source; MetaCPAN )
 data structures to STDOUT',
                        args => sub {
                            [ 'JSON', 'Data::Dumper', 'Data::Dump', 'YAML' ];
                        },
                        proc
App-Presto ( B/BP/BPHILLIPS/App-Presto-0.009.tar.gz, BPHILLIPS, 2012; MetaCPAN )
App-Presto/lib/App/Presto/Command/HTTP.pm ( view source; MetaCPAN )
able {
    my $message = shift;
    return $message->content_type =~ m{\b(?:xml|^text|application/json|application/x-www-form-urlencoded)\b} || do {
        my $content = substr($message->decoded_cont
App-Presto ( B/BP/BPHILLIPS/App-Presto-0.009.tar.gz, BPHILLIPS, 2012; MetaCPAN )
App-Presto/lib/App/Presto/PrettyPrinter.pm ( view source; MetaCPAN )
::Dumper::Sortkeys = 1;
        return Data::Dumper::Dumper(shift);
    },
    'JSON' => sub { require JSON; return JSON->new->pretty->encode(shift) },
    'YAML' => sub { require YAML; return YAML::D

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.