"ro",
default => "yaml",
cmd_aliases => "f",
documentation => "dump format ('yaml', 'json', 'storable', etc)"
);
has serializer => (
traits => [qw(NoGetopt EarlyBuild)],
isa => "
it isn't provided.
=item format
=item formatter
C<format> is one of C<yaml>, C<storable> or C<json>, defaulting to C<yaml>.
C<formatter> is a code reference that is provided with a file handle an
roc::InvokeEditor>.
=item format
=item formatter
C<format> is one of C<yaml>, C<storable> or C<json>, defaulting to C<yaml>.
C<formatter> is a code reference which takes an entry as an argument. I
# 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
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
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);
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 $
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
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']
},
'
= '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": "
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']
},
'
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
pper
ImageCropper Control (widget)
=head2 imageloader
ImageLoader Utility (utility)
=head2 json
JSON Utility (utility)
=head2 layout
Layout Manager (widget)
=head2 logger
Logger Control (tool
, '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,
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
package App::Office::Contacts::Donations::View::Role::Report;
use JSON::XS;
use Moose::Role;
our $VERSION = '1.10';
# -----------------------------------------------
sub build_report_by_amount
{
\&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;
}
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 {
ose>, L<HTML::TreeBuilder>, L<WWW::Mechanize>, L<Params::Validate>
L<XML::FeedPP>, L<DateTime>, L<JSON>, L<URI::Escape>, L<MIME::Types>,
L<File::MMagic>
=head1 INCOMPATIBILITIES
None reported.
=hea
kage Net::Google::Code::Role::Predefined;
use Any::Moose 'Role';
use Params::Validate ':all';
use JSON;
with 'Net::Google::Code::Role::Fetchable';
has 'predefined_status' => (
isa => 'HashRef',
ut luck :(
$mech->update_html(<<"EOF");
<form action="${base_url}feeds/${last_name}OptionsJSON"
method="POST" >
<input type="text" name="token" value="$token" />
<input type="submit" value="su
er => 1 );
die "failed to post to OptionsJSON page" unless $mech->success;
my $js = $mech->content;
my $object = from_json $js;
return unless $object;
$se