iddleware::JSON::ForBrowsers;
{
$Plack::Middleware::JSON::ForBrowsers::VERSION = '0.002000';
}
use parent qw(Plack::Middleware);
# ABSTRACT: Plack middleware which turns application/json responses
into HTML
use strict;
use warnings;
use Carp;
use JSON;
use MRO::Compat;
use Plack::Util::Accessor qw(json html_head html_foot);
use List::MoreUtils qw(any);
use Encode;
use HTML::Entities qw(encode_
rg/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>JSON::ForBrowsers</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=ut
AGEGROUP::ConferenceRoom::Output::JSON;
use strict;
use warnings;
use utf8;
use JSON::XS;
sub convert {
my $class = shift;
my $lines = shift;
encode_json {
conference_room => joi
RGV::JSON;
use 5.008005;
use strict;
use warnings;
use JSON;
our $VERSION = '0.01';
our $JSON = JSON->new->utf8;
our @Data;
sub import {
local $/;
while (local $_ = <>) {
$JSON->in
($_);
while (my $datum = $JSON->incr_parse) {
push @Data, $datum;
}
}
tie *ARGV, 'ARGV::JSON::Handle';
}
package
ARGV::JSON::Handle;
use Tie::Handle;
use par
eturn splice @ARGV::JSON::Data;
} else {
return shift @ARGV::JSON::Data;
}
}
1;
__END__
=encoding utf-8
=head1 NAME
ARGV::JSON - Parses @ARGV for accessing JSON via C<< <> >>
=he
package Geo::JSON::Simple;
BEGIN {
$Geo::JSON::Simple::AUTHORITY = 'cpan:GETTY';
}
{
$Geo::JSON::Simple::VERSION = '0.001';
}
# ABSTRACT: Simplified functions for generating Geo::JSON objects
use
use Geo::JSON;
use Geo::JSON::Point;
use Geo::JSON::MultiPoint;
use Geo::JSON::LineString;
use Geo::JSON::MultiLineString;
use Geo::JSON::Polygon;
use Geo::JSON::MultiPolygon;
use Geo::JSON::Feature;
use Geo::JSON::FeatureCollection;
use Geo::JSON::GeometryCollection;
our @EXPORT = qw(
point
multipoint
linestring
multilinestring
polygon
multipolygon
feature
featurecollection
e MetaPOD::Format::JSON::v1_1;
BEGIN {
$MetaPOD::Format::JSON::v1_1::AUTHORITY = 'cpan:KENTNL';
}
{
$MetaPOD::Format::JSON::v1_1::VERSION = '0.3.0';
}
# ABSTRACT: MetaPOD::JSON v1 SPEC Implementa
:JSON::v1';
with 'MetaPOD::Format::JSON::interface::v1_1';
sub features {
return qw( does inherits namespace interface );
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
MetaPOD::Format::JSON:
JSON v1 SPEC Implementation
=head1 VERSION
version 0.3.0
=head1 METHODS
=head2 C<features>
The list of features this version supports.
does inherits namespace interface
=begin MetaPOD::JSON
kage MetaPOD::Format::JSON::v1;
BEGIN {
$MetaPOD::Format::JSON::v1::AUTHORITY = 'cpan:KENTNL';
}
{
$MetaPOD::Format::JSON::v1::VERSION = '0.3.0';
}
# ABSTRACT: MetaPOD::JSON v1 SPEC Implementatio
'MetaPOD::Format::JSON::Decoder::v1',
'MetaPOD::Format::JSON::PostCheck::v1',
'MetaPOD::Format::JSON::does::v1',
'MetaPOD::Format::JSON::inherits::v1',
'MetaPOD::Format::JSON::namespace::v1';
);
return $self;
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
MetaPOD::Format::JSON::v1 - MetaPOD::JSON v1 SPEC Implementation
=head1 VERSION
version 0.3.0
=head1 METHODS
=head2 C<feature
t::JSON::inherits::v1;
BEGIN {
$MetaPOD::Format::JSON::inherits::v1::AUTHORITY = 'cpan:KENTNL';
}
{
$MetaPOD::Format::JSON::inherits::v1::VERSION = '0.3.0';
}
# ABSTRACT: Implementation of JSON/i
inherits;
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
MetaPOD::Format::JSON::inherits::v1 - Implementation of JSON/inherits format component
=head1 VERSION
version 0.3.0
=head1 METHODS
=he
its} , $metapod_result );
=begin MetaPOD::JSON v1.1.0
{
"namespace":"MetaPOD::Format::JSON::inherits::v1",
"interface":"role"
}
=end MetaPOD::JSON
=head1 AUTHOR
Kent Fredric <kentfredric
:Format::JSON::does::v1;
BEGIN {
$MetaPOD::Format::JSON::does::v1::AUTHORITY = 'cpan:KENTNL';
}
{
$MetaPOD::Format::JSON::does::v1::VERSION = '0.3.0';
}
# ABSTRACT: Implementation of JSON/does fo
ref $does;
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
MetaPOD::Format::JSON::does::v1 - Implementation of JSON/does format component
=head1 VERSION
version 0.3.0
=head1 METHODS
=head2 C<
{does} , $metapod_result );
=begin MetaPOD::JSON v1.1.0
{
"namespace":"MetaPOD::Format::JSON::does::v1",
"interface":"role"
}
=end MetaPOD::JSON
=head1 AUTHOR
Kent Fredric <kentfredric@g
:JSON::namespace::v1;
BEGIN {
$MetaPOD::Format::JSON::namespace::v1::AUTHORITY = 'cpan:KENTNL';
}
{
$MetaPOD::Format::JSON::namespace::v1::VERSION = '0.3.0';
}
# ABSTRACT: Implementation of JSON/
espace);
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
MetaPOD::Format::JSON::namespace::v1 - Implementation of JSON/namespace format component
=head1 VERSION
version 0.3.0
=head1 METHODS
=h
ce} , $metapod_result );
=begin MetaPOD::JSON v1.1.0
{
"namespace":"MetaPOD::Format::JSON::namespace::v1",
"interface":"role"
}
=end MetaPOD::JSON
=head1 AUTHOR
Kent Fredric <kentfredric
:Json;
use base 'Iodef::Pb::Format';
use strict;
use warnings;
require JSON::XS;
sub write_out {
my $self = shift;
my $args = shift;
my $array = $self->to_keypair($args);
my @json_
stream;
push(@json_stream,JSON::XS::encode_json($_)) foreach(@$array);
my $text = join("\n",@json_stream);
return $text;
}
1;
OD::Format::JSON::Decoder::v1;
BEGIN {
$MetaPOD::Format::JSON::Decoder::v1::AUTHORITY = 'cpan:KENTNL';
}
{
$MetaPOD::Format::JSON::Decoder::v1::VERSION = '0.3.0';
}
# ABSTRACT: C<JSON> to Structu
::Tiny qw( try catch );
sub decode {
my ( $self, $data ) = @_;
require JSON;
my $return;
try {
$return = JSON->new->decode($data);
}
catch {
require MetaPOD::Exception::Decode::D
at::JSON::Decoder::v1 - C<JSON> to Structure translation layer
=head1 VERSION
version 0.3.0
=head1 METHODS
=head2 C<decode>
Spec V1 C<JSON> Decoder
my $hash = _SOME_CLASS_->decode( $json_str
warnings;
package MetaPOD::Format::JSON::interface::v1_1;
BEGIN {
$MetaPOD::Format::JSON::interface::v1_1::AUTHORITY = 'cpan:KENTNL';
}
{
$MetaPOD::Format::JSON::interface::v1_1::VERSION = '0.3.0
';
}
# ABSTRACT: Implementation of JSON/interface format component
use Moo::Role;
use Carp qw(croak);
sub supported_interfaces {
return qw( class role type_library exporter single_class functio
erface;
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
MetaPOD::Format::JSON::interface::v1_1 - Implementation of JSON/interface format component
=head1 VERSION
version 0.3.0
=head1 METHODS
=
e warnings;
package MetaPOD::Format::JSON::PostCheck::v1;
BEGIN {
$MetaPOD::Format::JSON::PostCheck::v1::AUTHORITY = 'cpan:KENTNL';
}
{
$MetaPOD::Format::JSON::PostCheck::v1::VERSION = '0.3.0';
}
# ABSTRACT: Handler for unrecognised tokens in C<JSON>
use Moo::Role;
use Carp qw( croak );
sub postcheck {
my ( $self, $data, $result ) = @_;
if ( keys %{$data} ) {
croak 'Keys found n
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
MetaPOD::Format::JSON::PostCheck::v1 - Handler for unrecognised tokens in C<JSON>
=head1 VERSION
version 0.3.0
=head1 METHODS
=head2 C<postcheck
MetaPOD::Format::JSON;
BEGIN {
$MetaPOD::Format::JSON::AUTHORITY = 'cpan:KENTNL';
}
{
$MetaPOD::Format::JSON::VERSION = '0.3.0';
}
# ABSTRACT: Reference implementation of a C<JSON> based MetaPOD
t';
use MetaPOD::Format::JSON::v1;
use MetaPOD::Format::JSON::v1_1;
my $dispatch_table = [
{
version => version->parse('v1.0.0'),
handler => 'MetaPOD::Format::JSON::v1'
},
{
versio
n => version->parse('v1.1.0'),
handler => 'MetaPOD::Format::JSON::v1_1'
}
];
sub supported_versions {
return qw( v1.0.0 v1.1.0 );
}
sub add_segment {
my ( $self, $segment, $result ) = @_
package Spica::Parser::JSON;
use strict;
use warnings;
use Mouse;
extends 'Spica::Parser';
has parser => (
is => 'ro',
isa => 'JSON',
lazy_build => 1,
);
override parse
=> sub {
my ($self, $body) = @_;
return $self->parser->decode($body);
};
no Mouse;
use JSON;
sub _build_parser {
my $self = shift;
return JSON->new->utf8;
}
1;
::JSON;
use strict;
use warnings;
use TBX::XCS;
use JSON;
use Carp;
#carp from calling package, not from here
our @CARP_NOT = qw(TBX::XCS::JSON);
use Exporter::Easy (
OK => [qw(xcs_from_json json_
in JSON
#default: read XCS file and dump JSON data to STDOUT
print json_from_xcs(TBX::XCS->new(file => $ARGV[0]))
unless caller;
sub json_from_xcs {
my ($xcs) = @_;
return to_json($xc
s->{data}, {utf8 => 1, pretty => 1});
}
sub xcs_from_json {
my ($json) = @_;
my $struct = decode_json $json;
_check_structure($struct);
my $xcs = {};
$xcs->{data} = $struct;
package JSON::RPC2::AnyEvent::Server::PSGI;
use 5.008005;
use strict;
use warnings;
our $VERSION = "0.01";
use AnyEvent;
use JSON;
use Plack::Request;
use Try::Tiny;
use JSON::RPC2::AnyEvent::Const
ants qw(ERR_PARSE_ERROR);
use JSON::RPC2::AnyEvent::Server;
sub JSON::RPC2::AnyEvent::Server::to_psgi_app {
my ($self) = @_;
sub{
my $req = Plack::Request->new(shift);
if ( $
: _dispatch_json($self, $req);
} else {
return [405, ['Content-type' => 'text/plain'], ['Method Not Allowed']]
}
}
}
my $json = JSON->new->utf8;
sub _disp
package MLDBM::Serializer::JSON;
use warnings;
use strict;
use vars qw($VERSION @ISA);
use JSON::Any;
=head1 NAME
MLDBM::Serializer::JSON - DBM serializer uses JSON for language interoperability
w(MLDBM::Serializer);
=head1 SYNOPSIS
# using MLDBM hash interface
use MLDBM qw(DB_File JSON); # use Storable for serializing
my %db;
my $dbm = tie %db, 'MLDBM' [ ... other MLDBM
= "JSON",
});
...
=head1 DESCRIPTION
MLDBM::Serializer::JSON provides an extension to MLDBM to enable storing the
additional columns as JSON instead of Data::Dumper or FreezeThaw.
JSON is
package WebService::Eventful::JSON;
use strict;
use warnings;
use Carp;
=head1 NAME
WebService::Eventful::JSON - Use the JSON flavor of the Eventful API
=head1 SYNOPSIS
my $evdb = WebServi
tful->new(app_key => $app_key, flavor => 'json');
my $results = $evdb->call('events/get', { id => 'E0-001-001336058-5' });
=head1 DESCRIPTION
Parses JSON from the Eventful API.
=head1 VERSION
'json' }
=head2 ctype
Return a checkstring for the expected return content type.
=cut
sub ctype { 'javascript' }
=head2 parse
Parse JSON data from the Eventful API using L<JSON::Syck> or L<JSON>
:Definition::JSON;
{
$EntityModel::Definition::JSON::VERSION = '0.102';
}
use EntityModel::Class {
_isa => [qw{EntityModel::Definition}],
};
=head1 NAME
EntityModel::Definition::JSON - definitio
SYNOPSIS
See L<EntityModel>.
=head1 DESCRIPTION
See L<EntityModel>.
=head1 METHODS
=cut
use JSON::XS;
=head2 load_file
=cut
sub load_file {
my $self = shift;
my $path = shift;
open my $fh
f = shift;
my %args = @_;
my $path = delete $args{path} or die "No path provided";
my $data = JSON::XS->new->encode($args{structure});
open my $fh, '>:encoding(utf-8)', $path or die "Failed to op