( such as serializers )
# be configurable as well and they can't really be defined as-is in JSON
{
type => 'driver',
name => 'myproject.roflmayo',
config => {
t.roflmayo');
# Do stuff with $cache and get default behaviour
# User creates ~/.chi/config.json
[
{
'type' : 'driver',
'name' : 'myproject.roflmayo',
'config': {
onfig_paths => ['./foo'] )
Would automatically attempt to load any files called
foo.yml
foo.json
foo.ini
And load them with the relevant helpers.
See L<< C<Config::Any>|Config::Any >> for de
= '0.001';
our $AUTHORITY = 'cpan:APOCAL';
# ABSTRACT: Add a Bitbucket repo's info to META.{yml,json}
use Moose;
extends 'Dist::Zilla::Plugin::Bitbucket';
with 'Dist::Zilla::Role::MetaProvider';
ata
=head1 NAME
Dist::Zilla::Plugin::Bitbucket::Meta - Add a Bitbucket repo's info to META.{yml,json}
=head1 VERSION
This document describes v0.001 of Dist::Zilla::Plugin::Bitbucket::Meta - rele
illa> plugin adds some information about the distribution's Bitbucket
repository to the META.{yml,json} files, using the official L<CPAN::Meta>
specification.
This module currently sets the following
B2::Base
);
use Data::Dumper;
use JSON::XS;
use ArangoDB2::Graph::EdgeDefinition;
use ArangoDB2::Graph::VertexCollection;
use ArangoDB2::Traversal;
my $JSON = JSON::XS->new->utf8;
# create
#
# P
my $res = $self->arango->http->post(
$self->api_path('gharial'),
undef,
$JSON->encode($args),
) or return;
# copy param data from res to self
$self->_build_self($r
package ArangoDB2::Base;
use strict;
use warnings;
use Carp qw(croak);
use Data::Dumper;
use JSON::XS;
use Scalar::Util qw(blessed weaken);
# new
#
# Arango organizes data hierarchically: Databas
value or set JSON bool value.
# setting value returns self.
sub _get_set_bool
{
my($self, $param, $value, $validate) = @_;
if (defined $value) {
# accept "true" as JSON bool false
eq "true") {
$value = JSON::XS::true;
}
# accept "false" as JSON bool false
elsif ($value eq "false") {
$value = JSON::XS::false;
}
# u
use warnings;
use base qw(
ArangoDB2::Base
);
use Data::Dumper;
use JSON::XS;
use ArangoDB2::Cursor;
my $JSON = JSON::XS->new->utf8;
# new
#
# create new instance
sub new
{
my($class,
my $res = $self->arango->http->post(
$self->api_path('cursor'),
undef,
$JSON->encode($args),
) or return;
return ArangoDB2::Cursor->new($self->arango, $self->databas
return $self->arango->http->post(
$self->api_path('explain'),
undef,
$JSON->encode({query => $self->query}),
);
}
# parse
#
# POST /_api/query
sub parse
{
my($self
already, and will have the following format
=over
=item id
identifier of the user
=item data
json data, in the following form:
{
_id: "njfranck",
login: "njfranck",
name: "Nicolas F
use JSON ();
ZMQ::register_read_type(json => \&JSON::decode_json);
ZMQ::register_write_type(json => \&JSON::encode_json);
my $sock = $ctx->socket( ... );
$sock->sendmsg_as( json =>
$payload );
my $payload = $sock->recvmsg_as( 'json' );
=head1 DESCRIPTION
You can add a simple serialization/deserialization mechanism to ZMQ by enabling this module.
To enable serialization, y
le, for JSON we do
the following (this is already done for you in ZMQ.pm if you have
JSON.pm installed):
use JSON ();
ZMQ::Serializer::register_write_type('json' => \&JSON::encode_json);
end
my $json = $mailjet->send('apikey');
All "post" methos are called on send_post
my $data = ( 'name' =>'Name' , 'DateType'=> "str", 'NameSpace' : 'static' );
my $json = $mailjet-
actmetadata' , %data);
All "put" methos are called on send_put
my $data = ( 'title' => 'Update title of the Newsletter' );
my $json = $mailjet->send_put('newsletter/123' , %data);
=cut
Number')->prop(shift)->apply(
$self,$$self[1]->upgrade(@_)
);
}
sub value {
shift->[0]
}
*TO_JSON=*value;
sub exists { !1 }
sub typeof { 'number' }
sub class { 'Number' }
sub id {
bugtracker rt cpants kwalitee diff irc mailto
metadata placeholders metacpan RJBS FLORA dist ini json username yml
=for Pod::Coverage metadata munge_files
=head1 NAME
Dist::Zilla::Plugin::Authorit
larations in your perl files:
our $AUTHORITY = 'cpan:APOCAL';
Your metadata ( META.yml or META.json ) will have an entry looking like this:
x_authority => 'cpan:APOCAL'
=head1 ATTRIBUTES
=head2
ur $VERSION = '0.07';
use Config;
use URI::Escape qw(uri_escape);
use LWP::UserAgent;
use JSON qw(decode_json);
use CPAN::DistnameInfo;
use List::Util qw(sum);
our $SERVER = "http://grep.cpan.me";
o
ngth($content) . " bytes");
my $result = eval { decode_json($content) };
if ($@ or not $result) {
warn "Error decoding JSON response: $@\n";
debug($content);
return;
check for metadata dependencies
use Test::More;
use File::Slurp 9999.13;
use YAML::Any 0.72;
use JSON::Any 1.25;
use File::Find::Rule 0.32;
use Perl::PrereqScanner 1.000;
use Test::Deep 0.108;
use CP
a
my $runtime_req;
my $test_req;
my $provides;
if ( -e 'META.json' ) {
my $file = read_file( 'META.json' );
my $metadata = JSON::Any->new->Load( $file );
$runtime_req = $metadata->{'prereqs'
$provides = $metadata->{'provides'} if exists $metadata->{'provides'};
} else {
die 'No META.(json|yml) found!';
}
# Okay, scan the files
my $found_runtime = CPAN::Meta::Requirements->new;
my
x' => 1,
}
],
qw(
License
ModuleBuildTiny
MakeMaker::Fallback
),
qw(
MetaYAML
MetaJSON
InstallGuide
DOAP
Covenant
CPANFile
),
);
# ; -- special stuff for README files
# we
] ; create Makefile.PL file for older Perls
[MetaYAML] ; create META.yml file
[MetaJSON] ; create META.json file
[ReadmeAnyFromPod] ; create README file
[ReadmeAnyFromPod / PodRoot] ; create
'SIGNATURE' ) {
push( @files, 'SIGNATURE' );
}
# check META.json if it's there
if ( -e 'META.json' ) {
push( @files, 'META.json' );
}
plan tests => ( ( scalar @files ) * 4 ) + ( ( scalar @p
have overloaded operators)
=item -
The JavaScript datatypes provide C<TO_JSON> methods for compatibility with
L<JSON.pm|JSON>.
=back
JE's greatest weakness is that it's slow (well, what did you ex
(@_)
);
}
sub value {
defined $_[0][1] ? $_[0][1] : ($_[0][1] = desurrogify($_[0][0]));
}
*TO_JSON=*value;
sub value16 {
defined $_[0][0] ? $_[0][0] : ($_[0][0] = surrogify($_[0][1]));
}
sub t
$self,$$self[1]->upgrade(@_)
);
}
sub value { warn caller if !ref $_[0];shift->[0] }
sub TO_JSON { \(0+shift->[0]) }
sub exists { !1 }
sub typeof { 'boolean' }
sub class { 'Boolean' }
s
ugh which you can modify the
object, use C<@$a>.
=cut
sub value { [@{$${+shift}{array}}] };
*TO_JSON=*value;
sub exists {
my ($self, $name) = (shift, @_);
my $guts = $$self;
if ($name eq 'len
oken from its JSON representation (e.g. as returned
# from instance metadata of an instance that is assigned an IAM role
my $token = VM::EC2::Security::Credentials->new_from_json($json);
# open a
ew_from_json {
my $class = shift;
my ($data,$endpoint) = @_;
eval "require JSON; 1" or die "no JSON module installed: $@"
unless JSON->can('decode');
my $hash = JSON::from_json($data)
JSON string that can be passed to
VM::EC2->get_federation_token(), or other AWS libraries.
=head1 STRING OVERLOADING
When used in a string context, this object will interpolate into the
policy JSON
text. In addition,
please see DISCLAIMER.txt for disclaimers of warranty.
=cut
use strict;
use JSON;
use VM::EC2;
use Carp 'croak';
use overload
'""' => 'as_string',
fallback => 1;
su
cal $self->{statements};
$self->deny('*');
return $self->as_string;
}
my $json = JSON->new();
$json->canonical(1);
return $json->encode({Statement => \@list});
}
1;