Group
Extension

Matches 35359

HTML-Untemplate ( S/SY/SYP/HTML-Untemplate-0.019.tar.gz, SYP, 2014; MetaCPAN )
HTML-Untemplate/lib/HTML/Linear/Path.pm ( view source; MetaCPAN )
qw(all);

use JSON;
use Moo;
use MooX::Types::MooseLike::Base qw(:all);

use HTML::Linear::Path::Colors;

## no critic (ProhibitPackageVars)

our $VERSION = '0.019'; # VERSION


has json        => (
 
   is          => 'ro',
    isa         => InstanceOf['JSON'],
    default     => sub { JSON->new->ascii->canonical },
    lazy        => 1,
);


has address     => (is => 'rw', isa => Str, required =

    $ref->{attr} = $self->attributes if keys %{$self->attributes};

    return $self->key($self->json->encode($ref));
}


sub as_xpath {
    my ($self, $strict) = @_;

    my $xpath = _wrap(separator
WebApp-Helpers-JsonEncoder ( F/FE/FELLIOTT/WebApp-Helpers-JsonEncoder-0.01.tar.gz, FELLIOTT, 2014; MetaCPAN )
WebApp-Helpers-JsonEncoder/lib/WebApp/Helpers/JsonEncoder.pm ( view source; MetaCPAN )
pers::JsonEncoder;

use strict;
use warnings;

use JSON::MaybeXS qw(JSON);

use Moo::Role;

our $VERSION = "0.01";


has _json_encoder => (
   is => 'ro',
   lazy => 1,
   builder => '_build_json_enco
handles => {
      encode_json => 'encode',
      decode_json => 'decode',
   },
);
sub _build_json_encoder { JSON->new->utf8(1); }


sub json_bool { $_[1] ? JSON->true : JSON->false }


1;
__END__

=
ead1 NAME

WebApp::Helpers::JsonEncoder - Simple role for en/decoding JSON

=head1 SYNOPSIS

    package MyTunes::Resource::CD;

    use Moo;
    with 'WebApp::Helpers::JsonEncoder';

    has title   
Bundle-SYP ( S/SY/SYP/Bundle-SYP-1.5.tar.gz, SYP, 2014; MetaCPAN )
Bundle-SYP/lib/Bundle/SYP.pm ( view source; MetaCPAN )
Class::Schema::Loader

DB_File

Daemon::Generic

Data::DPath

Data::Float

Data::Printer::Filter::JSON

Data::Printer::Filter::URI

DateTime::Format::ISO8601

DateTime::Format::Strptime

Devel::NYTPro
Finance-LocalBitcoins-API ( P/PE/PEASWORTH/FinanceLocalBitcoinsAPI/Finance-LocalBitcoins-API-0.02.tar.gz, PEASWORTH, 2014; MetaCPAN )
Finance-LocalBitcoins-API/lib/Finance/LocalBitcoins/API.pm ( view source; MetaCPAN )
but then you are responsible for SSL cert verification code...
use LWP::UserAgent 6;
use URI;
use JSON;
use Data::Dumper;

## PUBLIC requests..
use Finance::LocalBitcoins::API::Request::Ticker;
use Fi
->uri . '?' . $uri->query);
            }
   
            $request->header(Accept => 'application/json');

            # create a new user_agent each time...
            $self->user_agent(LWP::UserAge
 warn Data::Dumper->Dump([$self->http_response],['Response']) if DEBUG;
        $content = $self->json->decode($self->http_response->content);
        if (ref $content eq 'ARRAY') {
            $self-
Data-Random-Structure ( M/MA/MALLEN/Data-Random-Structure-0.01.tar.gz, MALLEN, 2014; MetaCPAN )
Data-Random-Structure/lib/Data/Random/Structure.pm ( view source; MetaCPAN )
ture;
  use JSON::PP;

  my $g = Data::Random::Structure->new(
        max_depth => 2,
        max_elements => 5,
  );

  my $ref = $g->generate();

  diag explain $ref; 

  my $json = JSON::PP->new;
Finance-LocalBitcoins-API ( P/PE/PEASWORTH/FinanceLocalBitcoinsAPI/Finance-LocalBitcoins-API-0.02.tar.gz, PEASWORTH, 2014; MetaCPAN )
Finance-LocalBitcoins-API/lib/Finance/LocalBitcoins/API/Request/OrderBook.pm ( view source; MetaCPAN )
;
use strict;

use constant URL          => 'https://localbitcoins.com/bitcoincharts/%s/orderbook.json';
use constant ATTRIBUTES   => qw(currency);
use constant REQUEST_TYPE => 'GET';
use constant IS_
MooseX-Role-REST-Consumer ( S/SS/SSTK/MooseX-Role-REST-Consumer-0.003.tar.gz, SSTK, 2014; MetaCPAN )
MooseX-Role-REST-Consumer/README.pod ( view source; MetaCPAN )

);

parameter content_type => (
  isa      => 'Str',
  required => 1,
  default  => 'application/json',
);

parameter header_exclude => (
  isa     => 'HashRef',
  default => sub {{}},
);

parameter 
     => 10,
  };

=over

=item content_type

  By default the content type is set to "application/json"

=item header_exclude 

  Acts as a filter, will exclude any header information.

  header_exclu
 perform a POST request with REST::Consumer::post.
 The data will the Content-Type of application/json by default.

=item Other supported HTTP methods

  DELETE and PUT: delete(%params) and put(%param
MooseX-Role-REST-Consumer ( S/SS/SSTK/MooseX-Role-REST-Consumer-0.003.tar.gz, SSTK, 2014; MetaCPAN )
MooseX-Role-REST-Consumer/lib/MooseX/Role/REST/Consumer.pm ( view source; MetaCPAN )

);

parameter content_type => (
  isa      => 'Str',
  required => 1,
  default  => 'application/json',
);

parameter header_exclude => (
  isa     => 'HashRef',
  default => sub {{}},
);

parameter 
     => 10,
  };

=over

=item content_type

  By default the content type is set to "application/json"

=item header_exclude 

  Acts as a filter, will exclude any header information.

  header_exclu
 perform a POST request with REST::Consumer::post.
 The data will the Content-Type of application/json by default.

=item Other supported HTTP methods

  DELETE and PUT: delete(%params) and put(%param
Gerrit-Client ( R/RO/ROHANPM/Gerrit-Client-20140611.tar.gz, ROHANPM, 2014; MetaCPAN )
Gerrit-Client/lib/Gerrit/Client.pm ( view source; MetaCPAN )
(-no_match_vars);
use File::Path;
use File::Spec::Functions;
use File::Temp;
use File::chdir;
use JSON;
use Params::Validate qw(:all);
use Scalar::Util qw(weaken);
use URI;
use URI::Escape;

use base 
us $status" );
      }
    );

    my %read_req;
    %read_req = (

      # read one json item at a time
      json => sub {
        my ( $h, $data ) = @_;

        # every successful read resets slee
w, must specify a valid git revision";
  }

  my $data = $options->{reviewInput};

  my $jsondata = encode_json($data);

  my $url = join('/',
    $options->{http_url},
    'a',
    'changes',
    uri
ShardedKV ( A/AV/AVAR/ShardedKV-0.20.tar.gz, AVAR, 2014; MetaCPAN )
ShardedKV/lib/ShardedKV/Continuum/StaticMapping.pm ( view source; MetaCPAN )
RACT: A continuum strategy based on a simple "significant bits" static mapping
use JSON::XS qw(encode_json decode_json);
use Array::IntSpan;
use POSIX ();

with 'ShardedKV::Continuum';

has 'num_signi
ncode_json( {
    num_significant_bits => $_[0]->num_significant_bits,
    from => $_[0]->_original_range_mapping
  } )
}

sub deserialize {
  my $class = shift;
  return $class->new(decode_json( $_[1
catmandu ( N/NI/NICS/catmandu-0.92.tar.gz, NICS, 2014; MetaCPAN )
catmandu/lib/Catmandu/Env.pm ( view source; MetaCPAN )
 Catmandu::Env;

use Catmandu::Sane;
use Catmandu::Util qw(require_package use_lib read_yaml read_json :is :check);
use Catmandu::Fix;
use Config::Onion;
use File::Spec;
use Moo;
require Catmandu;
use
f
            grep { -f File::Spec->catfile($path, $_) }
            grep /^catmandu.+(?:yaml|yml|json|pl)$/,
            readdir $dh;
    }
    Catmandu->default_load_path;
}

has load_paths => (
   
as default_importer_package => (is => 'ro', default => sub { 'JSON' });
has default_exporter_package => (is => 'ro', default => sub { 'JSON' });

has store_namespace => (is => 'ro', default => sub { '
Mojolicious-Plugin-SessionCompress ( S/SO/SOHASHI/Mojolicious-Plugin-SessionCompress-0.03.tar.gz, SOHASHI, 2014; MetaCPAN )
Mojolicious-Plugin-SessionCompress/lib/Mojolicious/Plugin/SessionCompress.pm ( view source; MetaCPAN )
ious::Plugin::SessionCompress;
use Mojo::Base 'Mojolicious::Plugin';
use Mojo::Util ();
use Mojo::JSON ();
use Compress::Zlib ();

our $VERSION = '0.03';

sub register {
  my ($self, $app, $conf) = @_
rialize = delete $conf->{deserialize};
  } else {
    $serialize = \&Mojo::JSON::encode_json;
    $deserialize = \&Mojo::JSON::j;
  }

  $app->sessions->serialize(sub {
    my $hashref = shift;

    m
 $inflated;
    }

=head2 C<serialize>

    serialize => \&Mojo::JSON::encode_json

=head2 C<deserialze>

    deserialize > \&Mojo::JSON::j

=head2 C<min_size>

    min_size minimum size that's allowe
catmandu ( N/NI/NICS/catmandu-0.92.tar.gz, NICS, 2014; MetaCPAN )
catmandu/lib/Catmandu/Cmd/config.pm ( view source; MetaCPAN )
andu::Util qw(data_at);
use Catmandu;

sub description {
    <<EOS;
examples:

# export config to JSON
catmandu config
# or any other Catmandu::Exporter
catmandu config to YAML --fix 'delete_field(pas
Catmandu->exporter($into_args->[0], $into_opts);
    } else {
        $into = Catmandu->exporter('JSON', pretty => 1);
    }

    $into->add(defined $path ?
            data_at($path, Catmandu->config
catmandu ( N/NI/NICS/catmandu-0.92.tar.gz, NICS, 2014; MetaCPAN )
catmandu/lib/Catmandu/Plugin/Versioning.pm ( view source; MetaCPAN )
store
 $ echo '{"_id":"001",hello":"world"}' | catmandu import JSON to test
 $ echo '{"_id":"001",hello":"world2"}' | catmandu import JSON to test

 # In the store we see only the latest version 
 $ c
catmandu ( N/NI/NICS/catmandu-0.92.tar.gz, NICS, 2014; MetaCPAN )
catmandu/lib/Catmandu/Cmd/convert.pm ( view source; MetaCPAN )
     [ "verbose|v", "" ],
    );
}

sub description {
    <<EOS;
examples:

cat books.json | catmandu convert JSON to CSV --fields id,title

options:
EOS
}

sub command {
    my ($self, $opts, $args) 
catmandu ( N/NI/NICS/catmandu-0.92.tar.gz, NICS, 2014; MetaCPAN )
catmandu/lib/Catmandu/Util.pm ( view source; MetaCPAN )
Handle::Util ();
use File::Spec;
use YAML::XS ();
use JSON ();

our %EXPORT_TAGS = (
    io     => [qw(io read_file write_file read_yaml read_json join_path
        normalize_path segmented_path)],
  
 # dies on error
    YAML::XS::LoadFile($_[0]);
}

sub read_json {
    my $text = read_file($_[0]);
    # dies on error
    JSON::decode_json(read_file($_[0]));
}

sub join_path {
    my $path = File:
ng the YAML.

=item read_json($path);

Reads the JSON file at C<$path> into a Perl hash.

    my $cfg = read_json($path);

Dies on failure reading the file or parsing the JSON.

=item join_path(@path)
catmandu ( N/NI/NICS/catmandu-0.92.tar.gz, NICS, 2014; MetaCPAN )
catmandu/lib/Catmandu/Plugin/Datestamps.pm ( view source; MetaCPAN )
 data:
          plugins:
            - Datestamps

 $ echo '{"hello":"world"}' | catmandu import JSON to test
 $ catmandu export test to YAML
 ---
 _id: ADA305D8-697D-11E3-B0C3-97AD572FA7E3
 date_cre
catmandu ( N/NI/NICS/catmandu-0.92.tar.gz, NICS, 2014; MetaCPAN )
catmandu/lib/Catmandu/Exporter.pm ( view source; MetaCPAN )
orter('Foo', file => "/tmp/output.txt");
    
    # Or on the command line
    $ catmandu convert JSON to Foo < /tmp/something.txt >/tmp/output.txt

=head1 DESCRIPTION

A Catmandu::Exporter is a Perl 
atmandu::Exporter.

=head2 log

Returns the current logger.

=head1 SEE ALSO

L<Catmandu::Addable>, L<Catmandu::Fix>,L<Catmandu::JSON>,
L<Catmandu::YAML>, L<Catmandu::CSV>, L<Catmandu::RIS>

=cut

1;
catmandu ( N/NI/NICS/catmandu-0.92.tar.gz, NICS, 2014; MetaCPAN )
catmandu/lib/Catmandu.pm ( view source; MetaCPAN )
 the root directory of
your programming project. The file can be YAML, JSON or Perl and is called
C<catmandu.yml>, C<catmandu.json> or C<catmandu.pl>. In this file you can set
the default Catmandu sto
catmandu ( N/NI/NICS/catmandu-0.92.tar.gz, NICS, 2014; MetaCPAN )
catmandu/lib/Catmandu/Logger.pm ( view source; MetaCPAN )
gging methods for the
defined log levels, such as C<debug> or C<error>.

    package MyApp::View::JSON;

    extends 'MyApp::View';
    with 'Catmandu::Logger';

    sub bar {
        $self->log->info
 }

Your package automatically has a logging category of MyApp::View::JSON. Use lines like:

    log4perl.logger.MyApp::View::JSON=DEBUG,STDOUT

or

    log4perl.logger.MyApp::View=DEBUG,STDOUT

or

 

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