package DBIx::CouchLike;
use 5.8.1;
use strict;
use warnings;
use Carp;
use JSON 2.0 ();
use UNIVERSAL::require;
use base qw/ Class::Accessor::Fast /;
use DBIx::CouchLike::Iterator;
use DBIx::CouchLi
able utf8 _json trace versioning /);
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
$self->{utf8} = 1 unless defined $self->{utf8};
$self->{_json} = JSON->new;
$self->{_json}->utf8( $self->{utf8} );
_setup_downgrade() if !$self->{utf8} && !$RD;
}
$self->{utf8};
}
sub to_json {
my $self = shift;
my $json = $self->{_json}->encode(sh
Moose;
use JSON;
use Scalar::Util qw/blessed/;
use YUI::Loader::Entry;
use YUI::Loader::Item;
use YUI::Loader::Carp;
BEGIN {
my $json = JSON->new->relaxed(1);
my $catalog = $json->decode(ma
'type': 'js',
'path': 'charts/charts-min.js',
'requires': ['element', 'json', 'datasource']
},
'colorpicker': {
'type': 'js',
'path'
s',
'requires': ['event', 'dom']
},
'json': {
'type': 'js',
'path': 'json/json-min.js',
'requires': ['yahoo']
},
'
n = $self->binary_version;
my $json = $self->_service->_get_json(
"/mr/package/$package/$version/binfiles/$binpkg/$binversion?fileinfo=1"
);
my @files = @{ $json->{result} };
for (@files) {
$_->{file} = Debian::Snapshot::File->new(
hash => $_->{hash},
_fileinfo => $json->{fileinfo}->{ $_->{hash} },
_service => $self->_service,
);
}
return \@files;
}
sub _as_string {
my $
= '0.010';
use Moose;
use Text::CSV_XS;
use Set::Scalar;
use List::MoreUtils qw(each_array);
use JSON;
use File::Slurp;
use English;
#
# Store triples in nested hashrefs with a Set::Scalar instance
ose $fh or die "$!";
}
sub load_json {
my ( $self, $filename ) = @ARG;
my $text = read_file($filename) or die "Cannot read_file: $!";
my $data = from_json( $text, { utf8 => 1 } );
f
s a csv file in utf8 encoding.
$g->load("some/file.csv");
=head2 load_json
Loads a json file into a graph. The json file should be formated as follows:
{
"triples" : [
{ "s": "
pper
ImageCropper Control (widget)
=head2 imageloader
ImageLoader Utility (utility)
=head2 json
JSON Utility (utility)
=head2 layout
Layout Manager (widget)
=head2 logger
Logger Control (tool
y $self = shift;
$self->{collection} = {};
}
1;
__END__
BEGIN {
my $json = JSON->new;
my $catalog = $json->decode(map { local $_ = $_; s/'/"/g; $_ } (<<_END_));
{
'animation':
s',
'path': 'charts/charts-experimental-min.js',
'requires': ['element', 'json', 'datasource']
},
'colorpicker': {
'type': 'js',
'path'
s',
'requires': ['event', 'dom']
},
'json': {
'type': 'js',
'path': 'json/json-min.js',
'requires': ['yahoo']
},
'
e;
}
sub _fileinfo_builder {
my $self = shift;
my $hash = $self->hash;
$self->_service->_get_json("/mr/file/$hash/info")->{result};
}
no Any::Moose;
1;
=pod
=head1 NAME
Debian::Snapshot::Fi
ts, 'public' => $public if defined $public and $public;
my $uri = "https://github.com/api/v2/json/repos/create";
my $response = $agent->post( $uri,
[ login => $login, token => $token,
_string;
eval {
no warnings;
require JSON;
my $data = JSON->new->decode( $response->decoded_content );
$_ and $owner = $_ f
# ABSTRACT: interface to snapshot.debian.org
use Any::Moose;
use Debian::Snapshot::Package;
use JSON ();
use LWP::UserAgent;
has 'user_agent' => (
is => 'rw',
isa => 'LWP::UserAgent',
l
t;
}
sub _get_json {
my $self = shift;
my $json = $self->_get(@_);
return JSON::decode_json($json);
}
sub binaries {
my ($self, $name, $version) = @_;
my $json = $self->_get_json("/mr/binary/$
on})
->binary($_->{name}, $_->{binary_version}),
@{ $json->{result} };
if (defined $version) {
$version = qr/^\Q$version\E$/ unless ref($version) eq 'R
package YAML::Tiny::LikeJSON;
BEGIN {
$YAML::Tiny::LikeJSON::VERSION = '0.0011';
}
# ABSTRACT: Use YAML::Tiny like JSON
use strict;
use warnings;
use YAML::Tiny;
use Carp;
sub new { return bless
ad1 NAME
YAML::Tiny::LikeJSON - Use YAML::Tiny like JSON
=head1 VERSION
version 0.0011
=head1 SYNOPSIS
use YAML::Tiny::LikeJSON;
my $yaml = YAML::Tiny::LikeJSON->new;
my $data = $ya
# - 3
_END_
=head1 DESCRIPTION
YAML::Tiny::LikeJSON provides a way to encode/decode YAML (Tiny) in a way similar to how JSON.pm works.
It will only deal with one YAML document at a tim
on;
my $json = $self->_service->_get_json("/mr/package/$package/$version/srcfiles?fileinfo=1");
my @files = map Debian::Snapshot::File->new(
hash => $_->{hash},
_fileinfo => $json->{filein
ice,
), @{ $json->{result} };
return \@files;
}
sub binaries {
my $self = shift;
my $package = $self->package;
my $version = $self->version;
my $json = $self->_service->_get_json("/mr/package
ackage/$version/binpackages");
my @binaries = map $self->binary($_->{name}, $_->{version}), @{ $json->{result} };
return \@binaries;
}
sub binary {
my ($self, $name, $binary_version) = @_;
retur
ny::Moose 'X::Getopt';
use Any::Moose 'X::Types::'.any_moose() => [qw/Int Str Bool HashRef/];
use JSON;
use Hailo;
use Net::Twitter::Lite;
use Scalar::Util qw(blessed);
use namespace::clean -except =>
tatuses/sample.json -u${username}:${password}";
open my $twitter, "$cmd |";
my $data = {};
while (my $line = <$twitter>) {
chomp $line;
my $twat = from_json($line);
package App::Office::Contacts::Donations::View::Role::Report;
use JSON::XS;
use Moose::Role;
our $VERSION = '1.10';
# -----------------------------------------------
sub build_report_by_amount
{
se warnings;
use HTML::TreeBuilder::XPath;
use LWP::Simple;
use Storable qw(retrieve nstore);
use JSON;
use Encode;
use Carp;
use base qw(HTML::Feature::Base);
__PACKAGE__->mk_accessors($_) for qw(_L
else {
my $json =
get('http://wedata.net/databases/LDRFullFeed/items.json');
my $data = from_json($json);
nstore( $data, $pa
VectorClocks;
use warnings;
use strict;
use Carp;
use version; our $VERSION = qv('0.1.2');
use JSON::Any;
use List::MoreUtils qw(uniq);
use List::Util qw(max);
use Perl6::Export::Attrs;
use Sys::Ho
GE__->mk_accessors(qw(clocks));
__PACKAGE__->mk_classdata($_) for qw(id json);
__PACKAGE__->id(hostname);
__PACKAGE__->json(JSON::Any->new);
sub new {
my $class = shift;
my($arg) = @_;
m
{ clocks => $class->json->jsonToObj($arg || '{}') };
bless $self, $class;
}
sub serialize {
my $self = shift;
$self->json->objToJson($self->clocks);
}
sub increment {
\&to_xml;
sub to_jsonml {
my ($self) = @_;
return $self->_to_jsonml;
}
sub _to_jsonml {
my ($self) = @_;
if ($self->is_text) {
return $self->_quote_json_str($self->text);
>kids;
my $json = '[' . $self->_quote_json_str($name);
if ($attrs and %$attrs) {
my @keys = sort keys %$attrs;
my @pairs =
map { $self->_quote_json_str($_) . ':' .
$json .= ',' . $attr_str;
}
if ($kids and @$kids) {
foreach my $kid (@$kids) {
$json .= ',' . $kid->_to_jsonml;
}
}
$json .= ']';
return $json;
}
, 'values[homepage]' => $homepage if defined $homepage;
my $uri = "https://github.com/api/v2/json/repos/show/$login/$repository";
my $response = $agent->post( $uri,
[ login => $login,
troy {
my ($self) = @_;
$self->hide;
$self->emit ("destroy");
%$self = ();
}
sub TO_JSON {
{ "\fw" => $_[0]{s_id} }
}
sub show {
my ($self) = @_;
return if $self->{parent};
o", "$mappath.meta"
or die "$mappath.meta: $!\n";
print $fh DC::encode_json $meta;
close $fh;
open my $fh, ">:raw:perlio:utf8", $mappath
mand => "*";
$self->{json_coder}
->convert_blessed
->filter_json_single_key_object ("\fw" => sub {
$self->{widget}{$_[0]}
})
->filter_json_single_key_object ("\fc"
_face_handler ($exp_table, sub {
my ($face) = @_;
$self->{exp_table} = $self->{json_coder}->decode (delete $face->{data});
$_->() for values %{ $self->{on_exp_update} || {}
my ($face) = @_;
undef $handler;
$done_cb->();
$parse_list->($self->{json_coder}->decode ($face->{data}));
});
} else {
$done_cb->(0);
}
}
# widgetset a