b TO_JSON {
my ($self) = @_;
my $json = {};
foreach my $key ( sort { $a cmp $b } keys %{$self} ) {
if ( $key =~ /^(?:$longitude_code|$latitude_code)$/smx ) {
$json->{lo
elsif ( $key =~ /^(?:accuracy|altitude)$/smx ) {
$json->{$key} = $self->{$key};
}
}
return $json;
}
sub latitude {
my ($self) = @_;
return $self->{$latitude
e_time_zones#List>. This value may not be defined.
=head2 TO_JSON
required to allow L<JSON serialisation|https://metacpan.org/pod/JSON#OBJECT-SERIALISATION> to work correctly. This method should n
s::Zlib();
use Config::INI::Reader();
use Crypt::URandom();
use Archive::Zip();
use Symbol();
use JSON();
use IO::Handle();
use IPC::Open3();
use Socket();
use English qw( -no_match_vars );
use POSIX(
) : () } );
if ( defined $directory ) {
return File::Spec->catfile( $directory, 'bcd.json' );
}
else { return }
}
my $proxy_name_regex = qr/perl_ff_m_\w+/smx;
my $tmp_name_regex
$self->geo( $self->json($geo) );
}
else {
$self->geo($geo);
}
}
elsif ( $geo =~ /^(?:data|http)/smx ) {
$self->geo( $self->json($geo) );
}
sub TO_JSON {
my ($self) = @_;
my $json = {};
if ( $self->{_old_protocols_key} ) {
$json->{ $self->{_old_protocols_key} } = $self->uuid();
}
else {
$json->{ $self
->IDENTIFIER() } = $self->uuid();
}
return $json;
}
sub browser {
my ($self) = @_;
return $self->{browser};
}
sub uuid {
my ($self) = @_;
return $self->{ $self->IDENTIFIER()
ith this object.
=head2 new
returns a new object.
=head2 TO_JSON
required to allow L<JSON serialisation|https://metacpan.org/pod/JSON#OBJECT-SERIALISATION> to work correctly. This method should n
pace::clean;
use AnyEvent::HTTP::MultiGet;
use AnyEvent::WebSocket::Client;
use MIME::Base64;
use JSON;
use AnyEvent::HTTP::Spark;
BEGIN {
no namespace::clean;
with 'HTTP::MultiGet::Role', 'AnyE
$obj->agent->run_next;
AnyEvent::Loop::run;
sub cb {
my ($sb,$result,$eventType,$verb,$json)=@_;
return unless $eventType eq 'conversation.activity' and $verb eq 'post';
# Data::Re
,
);
has lastConn=>(
isa=>Str,
is=>'ro',
required=>1,
default=>'/tmp/sparkBotLastConnect.json',
);
has connection=>(
is=>'rw',
isa=>Object,
required=>0,
);
has on_message=>(
is=>'ro
=>'Bearer ' .$self->token);
$h->header('Content-Type', 'application/json; charset=UTF-8');
$h->header(Accept=>'application/json');
return $h;
}
=back
=head1 AUTHOR
Michael Shipper <AKALINUX@C
version bump to be skipped by appending, `# No BumpVersion`.
This will update C<Changes>, C<META.json> and bump C<$VERSION> in your main module. These changes made by Minilla will be automatically co
figurations
Edit .gitignore and add the following lines:
/Dist-Name-*
/.build
!META.json
You're almost done, and your directory will look like:
cpanfile
lib/Dist/Name.pm
t/
so, new C<Build.PL>, C<META.json> and C<README.md> are added in your
working directory for git-friendliness. C<git add> them and commit it.
> git add Build.PL META.json README.md && git commit -m
Modern::Perl;
use Moo;
use MooX::Types::MooseLike::Base qw(:all);
use Data::Dumper;
use JSON qw(to_json from_json);
use HTTP::Request::Common qw(POST);
use Ref::Util qw(is_plain_arrayref is_plain_hash
e("${method}Id is a requried argument")) unless defined($targetId);
return $self->que_put_json($cb,"$path/$targetId",$data);
};
} elsif($method eq 'get') {
$code=sub {
eq 'create') {
$code=sub {
my ($self,$cb,$data)=@_;
return $self->que_post_json($cb,"$path",$data);
};
} else {
die "Er um.. $method isn't supported yet";
}
$self;
}
sub TO_JSON {
my ($self) = @_;
my $json = {};
foreach my $key ( sort { $a cmp $b } keys %{$self} ) {
$json->{$key} = $self->{$key};
}
return $json;
}
sub _conver
ed in a form or used to begin an HTTP auth session.
=head2 TO_JSON
required to allow L<JSON serialisation|https://metacpan.org/pod/JSON#OBJECT-SERIALISATION> to work correctly. This method should n
uid} ? $bookmark->{parent_guid} : MENU();
}
return $bookmark;
}
sub TO_JSON {
my ($self) = @_;
my $json = {};
foreach my $key ( sort { $a cmp $b } keys %{$self} ) {
if ( (
l' ) || ( $key eq 'icon' ) )
{
$json->{ $mapping{$key} } = $self->{$key}->as_string();
}
else {
$json->{ $mapping{$key} } = $self->{$key};
}
'date_added' ) || ( $key eq 'last_modified' ) ) {
$json->{ $mapping{$key} } =~ s/000$//smx;
}
}
return $json;
}
sub url {
my ($self) = @_;
return $self->{url};
}
5.016;
our $VERSION = '0.04';
use strict;
use warnings;
use File::Basename;
use File::Spec;
use JSON::PP;
# TODO: '?' sigil for '#' and '$' restricted targets
# TODO: Set '$_' in Perl and shell sub
dir, $_) } @files;
}
sub _read_json {
my ($self, $file) = @_;
open my $fh, '<', $file
or die "Failed to open $file for reading: $!\n";
my $json = do { local $/ = undef; <$fh> }
;
close $fh;
my $ref = decode_json($json);
unless (ref $ref eq 'HASH') {
die "Invalid .stubb.json\n";
}
if ($self->{ Defaults } and ref $ref->{ defaults } eq 'HASH') {
date informations after that.
=head2 RegenerateFiles
In this step, minilla will regenerate META.json, README.md and (Makefile.PL|Build.PL).
=head2 RunHooks
This step runs commands listed on `relea
s variable.
=item no_index
[no_index]
directory=['t', 'xt', 'tools']
Minilla sets META.json's no_index as C<< directory => ['t', 'xt', 'inc', 'share', 'eg', 'examples', 'author', 'builder']
> constructor.
=item Metadata
[Metadata]
x_deprecated = 1
Add arbitrary keys to C<META.json>/C<META.yml>.
=item static_install
static_install = "auto"
If C<static_install = "auto"> (
URI;
use URI::QueryParam;
use Date::Parse;
use Image::Magick;
use LWP::UserAgent;
use Cpanel::JSON::XS;
use Scalar::Util qw( openhandle );
use MIME::Base64 qw( encode_base64 );
use Unicode::Lin
# is idiotic.
agent => q{},
)
},
);
has _json_parser => (
default => sub { Cpanel::JSON::XS->new }
);
has convert_long_sms_to_mms => (
is => 'ro',
d
],
),
$method
);
}
=head2 _parse_result
Does error handling, decodes JSON.
=cut
sub _parse_result {
my ( $self, $res, $method ) = @_;
if ( !$res->is_success ) {
oleans :chars);
use Data::Dumper;
use Digest::MD5 qw(md5_hex);
use English qw(no_match_vars);
use JSON;
use Storable qw(dclone);
use Role::Tiny;
#####################################################
my ( $self, $waf_config ) = @_;
my @rule_list;
my $priority = 1;
my $rule_stub = decode_json($WAF_RULE_STUB);
if ( !$waf_config->{managed_rules} ) {
$waf_config->{managed_rules} = [qw
waf => $waf, waf_config => $waf_config );
# check to see if someone has mucked with web-acl.json
my $needs_update = $self->check_web_acl_state(
name => $name,
id =>
ass = shift();
my($rs, $offset, $json) = @_;
return bless {
rs => $rs, # back-reference
offset => $offset, # zero-based position within rs
json => $json,
holdingsStructure => undef,
proc
= $this->{json}->{id};
return $id;
}
sub rs {
my $this = shift();
return $this->{rs};
}
sub jsonStructure {
my $this = shift();
return $this->{json};
}
sub prettyJSON {
my
$this = shift();
return _formatJSON($this->{json});
}
sub prettyXML {
my $this = shift();
return _formatXML($this->{json});
}
sub holdings {
my $this = shift();
my($marc) = @_;
RIS::Stations;
# vim:readonly
# This module has been automatically generated from share/stations.json
# by lib/Travel/Status/DE/IRIS/Stations.pm.PL.
# Do not edit, changes will be lost.
use strict;
packages become available
our $VERSION = '2.00';
# Automatically generated, see share/stations.json
my @stations = (
['SEGH','Trier Hafenstraße',8005904,6.682725,49.792015],
['KA','Aachen Hbf',800
],
['SUG','Ürzig(DB)',8005945,7.004806,49.995933],
);
# Automatically generated, see share/meta.json
my $meta = {
8010256 => [8017020,8070777],
373013 => [721084,723594],
8098147 => [8000147],
80891
sub translate_msg {
my ( $self, $msg ) = @_;
return $translation{$msg} // "?($msg)";
}
sub TO_JSON {
my ($self) = @_;
my %copy = %{$self};
delete $copy{realtime_xml};
delete $copy{strptime_ob
glob(sprintf("%s-*", $project->dist_name)),
'blib',
'Build',
'MYMETA.json',
'MYMETA.yml',
'_build_params',
'_build', # M::B
'Makefile
Net::Z3950::FOLIO::Session;
use strict;
use warnings;
use DateTime;
use Cpanel::JSON::XS qw(decode_json encode_json);
use Net::Z3950::FOLIO::Config;
use Net::Z3950::FOLIO::ResultSet;
sub _throw {
) = @_;
my $json = decode_json($res->content());
my $refreshTokenEpoch = _isoStringToEpoch($json->{refreshTokenExpiration});
my $accessTokenEpoch = _isoStringToEpoch($json->{accessTokenEx
);
$req->content(encode_json(\%body));
my $res = $this->{ua}->request($req);
_throw(3, $res->content()) if !$res->is_success();
my $obj = decode_json($res->content());
# warn "
#!/usr/bin/perl
use strict;
use warnings;
use Getopt::Long;
use JSON::XS qw/decode_json/;
use Pod::Usage;
use Schedule::Easing;
use Schedule::Easing::Stream;
# todo: replay mode, historical checkin
loadjson {
my ($fn)=@_;
my $t=load($fn);
my @res=@{ decode_json($t) };
foreach my $E (@res) { $$E{match}//=''; $$E{match}=qr/$$E{match}/ }
return @res;
}
my %opt=(
schedule =>undef,
json
',
help =>0,
time =>undef,
);
GetOptions(
'schedule=s'=>\$opt{schedule},
'json=s' =>\$opt{json},
'timestamps'=>\$opt{timestamps},
'expiration'=>\$opt{expiration},
'check' =>\$
cript like following shell script.
# Generate META.json from Module::Build or EU::MM
perl Build.PL
# Create cpanfile from META.json
mymeta-cpanfile > cpanfile
# MANIFEST, MANIFE
EST MANIFEST.SKIP
# generate META.json
minil build
git add -f META.json
# remove META.json from ignored file list
perl -i -pe 's!^META.json\n$!!' .gitignore
echo '.build/' >>