n undef;
}
sub size { $_[0]->_asset->size }
sub url_for { $_[1]->url_for(assetpack => $_[0]->TO_JSON); }
sub _default_tag_for {
my ($asset, $c, $args, @attrs) = @_;
my $url = $asset->url_f
rl"), @attrs);
}
sub FROM_JSON {
my ($self, $attrs) = @_;
$self->$_($attrs->{$_}) for grep { defined $attrs->{$_} } qw(checksum format minified);
$self;
}
sub TO_JSON {
return {map { ($_ =>
OM_JSON
$self = $self->FROM_JSON($hash_ref);
The opposite of L</TO_JSON>. Will set the read/write L</ATTRIBUTES> from the
values in C<$hash_ref>.
=head2 TO_JSON
$hash_ref = $self->FROM_JSON;
:Base 'Mojolicious::Plugin::AssetPack::Pipe';
use Mojo::File qw(path tempfile);
use Mojo::JSON qw(encode_json false true);
use Mojo::Loader;
use Mojolicious::Plugin::AssetPack::Util qw(diag $CWD DEBU
f '%s(%s)', $func, defined $args ? encode_json $args : '';
}
$bin =~ s!__EXTERNAL__!{encode_json $self->external}!e;
$bin =~ s!__GLOBALS__!{encode_json $self->globals}!e;
$bin =~ s!__SOURCEMA
s _rollupjs_src);
$assets->each(sub {
my ($asset, $index) = @_;
my $attrs = $asset->TO_JSON;
return unless $asset->format eq 'js';
return unless $asset->path and -r $asset->path;
;
use File::Temp ();
use IPC::Run3 ();
use List::Util 'first';
use Mojo::File 'path';
use Mojo::JSON;
use Mojolicious::Plugin::AssetPack::Asset;
use Mojolicious::Plugin::AssetPack::Util qw(diag has_
ind_app([qw(nodejs node)]), $REQUIRE_JS, @modules], \undef, \my $status);
$status = Mojo::JSON::decode_json($status);
for my $plugin (@modules) {
next unless $status->{$plugin};
$self->ap
# Change $attr if this pipe will modify $asset attributes
my $attr = $asset->TO_JSON;
my $content = $asset->content;
# Private name to load/save meta data under
ck->minify;
return $assets->each(sub {
my ($asset, $index) = @_;
my $attrs = $asset->TO_JSON;
$attrs->{key} = 'js-min';
$attrs->{minified} = 1;
return if $asset->format ne '
::Pipe::Favicon;
use Mojo::Base 'Mojolicious::Plugin::AssetPack::Pipe';
use Mojo::DOM;
use Mojo::JSON qw(false true);
use Mojo::Template;
use Mojo::Util;
use Mojolicious::Plugin::AssetPack::Util 'che
sign => sub { shift->_build_design };
has settings => sub { +{error_on_image_too_small => Mojo::JSON->true} };
sub process {
my ($self, $assets) = @_;
return unless $self->topic =~ m!^favicon(\
my $asset = $assets->first;
my $attrs = $asset->TO_JSON;
my ($urls, $markup, %sub_assets);
$attrs->{key} = checksum(Mojo::JSON::encode_json($self->design))
or die '[AssetPack] Invalid pipe
my $file;
return $assets->each(sub {
my ($asset, $index) = @_;
my $attrs = $asset->TO_JSON;
$attrs->{key} = sprintf '%s-min', $self->app;
$attrs->{minified} = 1;
return if
rs->{checksum} if DEBUG;
$asset->content($store->save($self->_run_app($asset), $attrs))->FROM_JSON($attrs);
});
}
sub _install_optipng {
my $self = shift;
my $class = ref $self;
my $app
ROBJ
const bson_json_opts_t * T_PTROBJ
uint32_t * T_PTROBJ
uint8_t * T_PTROBJ
bson_t ** T_PTROBJ
bson_writer_t * T_PTROBJ
bson_json_opts_t * T_PTROBJ
bson_json_opts_t T_PTROBJ
bson_json_mode_t T_PTROB
* T_PTROBJ
const bson_visitor_t * T_PTROBJ
bson_type_t T_PTROBJ
bson_json_reader_t * T_PTROBJ
bson_json_reader_cb T_PTROBJ
bson_json_destroy_cb T_PTROBJ
bson_oid_t * T_PTROBJ
bson_value_t * T_PTROBJ
b
d_json(bson, length)
SV *bson;
SV *length;
CODE:
size_t len = 0;
const bson_t *bson_ptr = (const bson_t*)SvPV_nolen(bson);
RETVAL = bson_as_canonical_extended_json(
char *json_str = bson_as_json(bson, NULL);
if (json_str) {
SV *json_sv = newSVpv(json_str, 0);
bson_free(json_str);
av_clear(bson_ref);
av_push(bson_ref, json_sv);
}
}
}
OUTPUT:
RETVAL
void
cursor_set_batch_size(cursor, batch_size)
mong
use strict;
use warnings;
use Pongo::Client;
use Pongo::BSON;
use JSON;
sub print_aggregate_counts {
my ($documents, $field) = @_;
my %counts;
foreach my $doc (@$documents) {
if
while (Pongo::Client::cursor_next($cursor, \@bson_data)) {
my $json_str = $bson_data[0];
my $decoded_doc = decode_json($json_str);
push @documents, $decoded_doc;
@bson_data = ();
}
m
o>, L<json_arrappend|Net::Async::Redis::Commands/json_arrappend>, L<json_arrindex|Net::Async::Redis::Commands/json_arrindex>, L<json_arrinsert|Net::Async::Redis::Commands/json_arrinsert>, L<json_arrle
mands/json_arrlen>, L<json_arrpop|Net::Async::Redis::Commands/json_arrpop>, L<json_arrtrim|Net::Async::Redis::Commands/json_arrtrim>, L<json_clear|Net::Async::Redis::Commands/json_clear>, L<json_debug
is::Commands/json_debug>, L<json_del|Net::Async::Redis::Commands/json_del>, L<json_forget|Net::Async::Redis::Commands/json_forget>, L<json_get|Net::Async::Redis::Commands/json_get>, L<json_merge|Net::
l::Base::Common;
use Mojo::Base -base, -signatures;
our $VERSION = '0.01';
has 'template';
has 'json';
1;
#################### pod generated by Pod::Autopod - keep this line to make pod updates pos
se Carp qw();
use File::Find::Rule;
use File::ShareDir qw();
use IO::Zlib;
use IPC::Cmd qw();
use JSON qw();
use List::Util qw();
use List::MoreUtils qw();
use MCE;
use Number::Format qw();
use Path::
use warnings;
use Test::More;
use Test::Deep;
use Path::Tiny;
use experimental qw(for_list);
use JSON::MaybeUTF8 qw(:v2);
use Future::AsyncAwait;
use Net::Async::Redis;
use IO::Async::Loop;
use Log::
ath('share/commands.yaml')->spew_utf8(YAML::XS::Dump($def));
# $log->infof('Commands: %s', format_json_text($def));
for my ($cmd, $keys) (
[qw(set somekey someval)] => [qw(somekey)],
[qw(get s
t>, L<json_arrappend|Net::Async::Redis::Commands/json_arrappend>, L<json_arrindex|Net::Async::Redis::Commands/json_arrindex>, L<json_arrinsert|Net::Async::Redis::Commands/json_arrinsert>, L<json_arrle
mands/json_arrlen>, L<json_arrpop|Net::Async::Redis::Commands/json_arrpop>, L<json_arrtrim|Net::Async::Redis::Commands/json_arrtrim>, L<json_clear|Net::Async::Redis::Commands/json_clear>, L<json_debug
is::Commands/json_debug>, L<json_del|Net::Async::Redis::Commands/json_del>, L<json_forget|Net::Async::Redis::Commands/json_forget>, L<json_get|Net::Async::Redis::Commands/json_get>, L<json_merge|Net::
use strict;
use warnings;
use Pongo::Client;
use Pongo::BSON;
use JSON;
sub print_distinct_values {
my ($documents, $field) = @_;
my %distinct_values;
foreach my $doc (@$documents) {
while (Pongo::Client::cursor_next($cursor, \@bson_data)) {
my $json_str = $bson_data[0];
my $decoded_doc = decode_json($json_str);
push @documents, $decoded_doc;
@bson_data = ();
}
m
eters>
$reference
Contract reference
$params
Hash of parameters
B<Return value>
JSON response as a string
=cut
sub suspend_contract {
my $self = shift;
my $reference = shif
eters>
$reference
Contract reference
$params
Hash of parameters
B<Return value>
JSON response as a string
=cut
sub restart_contract {
my $self = shift;
my $reference = shif
eters>
$reference
Contract reference
$params
Hash of parameters
B<Return value>
JSON response as a string
=cut
sub end_contract {
my $self = shift;
my $reference = shift;
nit_router($class, $api, ENTRY_POINT);
}
=item get_all
Get user roles
B<Return value>
JSON response as a string
=cut
sub get_all {
my $self = shift;
die "The legacy API was depr
ser
Get by specific user
B<Parameters>
$user_ref
User reference
B<Return value>
JSON response as a string
=cut
sub get_by_specific_user {
my $self = shift;
my $user_ref = s
an owned Account
B<Parameters>
$freelancer_ref
Freelancer reference
B<Return value>
JSON response as a string
=cut
sub get_owned {
my $self = shift;
my $freelancer_ref = shift;
ts for a Specific Account
B<Parameters>
$entity_ref
Entity reference
B<Return value>
JSON response as a string
=cut
sub get_specific {
my $self = shift;
my $entity_ref = shift;
:Share ':all';
use Moo;
use namespace::clean;
has json => (is => 'ro', default => sub { return dist_file('Map-Tube-Nuremberg', 'nuremberg-map.json') });
with 'Map::Tube';
1;
__END__
=pod
=enco
n
the two given stations. The map contains currently only (U-Bahn) subway stations.
Hint:
ID in JSON-File is VGN-Kennung as used in https://opendata.vag.de/dataset/haltestellen-id-geodaten.
If Stat
ecific Freelancer
B<Parameters>
$freelancer_ref
Freelancer reference
B<Return value>
JSON response as a string
=cut
sub get_by_freelancer {
my $self = shift;
my $freelancer_ref
Team
B<Parameters>
$freelancer_team_ref
Freelancer's team reference
B<Return value>
JSON response as a string
=cut
sub get_by_freelancers_team {
my $self = shift;
my $freelance
B<Parameters>
$freelancer_company_ref
Freelancer's company reference
B<Return value>
JSON response as a string
=cut
sub get_by_freelancers_company {
my $self = shift;
my $freela