output '$@'" if $@;
return 1;
}
sub _load_table($self, $file) {
my $json = $self->config_manager->load_json($file);
my $template = $self->_load_templates(
'Daje::Generate::Tem
$table = Daje::Plugin::SQL::Manager->new(
template => $template,
json => $json,
);
};
die "process_sql failed '$@" if $@;
return $table;
}
sub _loa
source_path => $self->config->{PATH}->{sql_source_dir},
filetype => '*.json'
);
$config_manager->load_changed_files();
$self->config_manager($config_
TP);
use HTTP::Tiny 0.034 ();
use JSON::MaybeXS 1.003003 ();
use URI 1.25 ();
use URI::Escape 3.26 ();
my %DEFAULT_HEADERS = (
'Content-Type' => 'application/json',
'X-Stream' => 'true',
);
# Use
e pod
my ($class, $driver) = @_;
my $config = $driver->{config};
my $self = bless {
json_coder => JSON::MaybeXS->new( utf8 => 1, allow_nonref => 0 ),
}, $class;
my $uri = $config->{uri};
i
$self->{uri_base};
}
# Return a JSON:XS-compatible coder object (for result parsers).
sub json_coder {
# uncoverable pod
my $self = shift;
return $self->{json_coder};
}
# Return the HTTP Dat
r::Type::V1::Node 1.02;
# ABSTRACT: Describes a node from a Neo4j graph, delivered via Jolt v1 or JSON
# For documentation, see Neo4j::Driver::Types.
use parent 'Neo4j::Driver::Type::Node';
sub
ons = "";
my $json_arr = $self->json;
my $length = scalar @{$json_arr};
for (my $i = 0; $i < $length; $i++) {
my $json = @{$json_arr}[$i];
if (exists($json->{version})) {
$sections .= $self->_version($json->{version});
}
}
$self->set_sql($self->create_file($sections));
return ;
}
sub _version($self, $version) {
my $sql = "";
my $
return $template;
}
sub create_sql($self, $json, $tablename) {
my $sql_stmt = Daje::Plugin::SQL::Script::Sql->new(
json => $json,
template => $self->template,
t
".jpm" => "video/jpm",
".js" => "text/javascript",
".json" => "application/json",
".jxl" => "image/jxl",
".karbon" => "application/vnd.kde.kar
package Plack::Middleware::JSONP;
use strict;
use parent qw(Plack::Middleware);
use Plack::Util;
use URI::Escape ();
use Plack::Util::Accessor qw/callback_key/;
sub prepare_app {
my $self = shif
my $callback_key = $self->callback_key;
if ($h->get('Content-Type') =~ m!/(?:json|javascript)! &&
$env->{QUERY_STRING} =~ /(?:^|&)$callback_key=([^&]+)/) {
= $_[0] });
my $jsonp = "/**/$cb($body)";
$res->[2] = [ $jsonp ];
$h->set('Content-Length', length $jsonp);
$h->set('Con
e Feed::Data::Parser;
use Feed::Data::Stream;
use Feed::Data::Object;
use HTML::TableContent;
use JSON;
use Compiled::Params::OO qw/cpo/;
use XML::RSS::LibXML;
use Text::CSV_XS qw/csv/;
use YAML::XS q
Any, Optional->of(Str)],
raw => [Any, Optional->of(Str)],
text => [Any, Optional->of(Str)],
json => [Any, Optional->of(Str)],
yaml => [Any, Optional->of(Str)],
csv => [Any, Optional->of(Str)
tion || "Feed::Data",
%{$self->rss_channel}
);
my @render = $self->_convert_feed('generate', 'json');
for (@render) {
$rss->add_item(
%{$_}
);
}
return $rss->as_string;
}
sub _raw {
my
g' if $self->stream =~ m{\<\?xml}xms;
return 'file' if $self->stream =~ m{(\.xml|\.html|\.txt|\.json|\.csv|\.yml)}xms;
}
);
sub open_stream {
my ($self) = $validate->open_stream->(@_);
my $type
rlyEnd => ts_to_iso_date(time()+8*24*3600)
);
if ($response->is_success) {
my $json = $response->decoded_content;
} else {
die $response->status_line;
}
=head1 DESC
the requested location.
Returns a string containing the JSON data, except in array context, in which case,
as a convenience, it will use L<JSON> to decode it directly to a Perl hash.
Requires L<LWP:
d2 C<jwt>
my $jwt = $wk->jwt(
iat => $iat?,
exp => $exp?
);
Returns the JSON Web Token string in case you need it. Will return a cached one
if it has more than 10 minutes unt
:Strip->new();
my $string = $hs->parse(shift->raw);
return encode_utf8($string);
},
);
has 'json' => (
is => 'rw',
lazy => 1,
isa => Str,
default => sub {
return shift->text;
},
);
1;
PI::Base> is a base class for simple Perl Weather API clients. Apart
from handling JSON and XML API responses (L<JSON> and L<XML::Simple> required respectivelly),
it offers utility functions for time
agent => "libwww-perl $package/$version",
error => 'return',
output => 'json',
scheme => 'https',
);
Parameters:
=over 4
=item * C<timeout> : Timeout for requ
tem. Default: C<https>.
=item * C<output> : Output format/mode. C<json/xml> are automatically supported for decoding. Default: C<json>.
=back
=head1 PRIVATE METHODS
These are to be used when subcl
ave an asset to disk. C<%attr> are usually the same as
L<Mojolicious::Plugin::AssetPack::Asset/TO_JSON> and used to document metadata
about the C<$asset> so it can be looked up using L</load>.
=head2
y $asset (@$assets) {
@import "<%= $asset->url_for($c) %>";
% }
@@ fallback.js.ep
% use Mojo::JSON 'to_json';
(function(w,d,a,b){
var c=function(){
var t=d.createElement("script");
t.src=b.shift();
if
(b.length) t.addEventListener("load",c);
a.parentNode.insertBefore(t,a);
};
c();
})(window,document,document.getElementsByTagName("script")[0],<%= to_json([map { $_->url_for($c) } @$assets]) %>);
elf->assetpack->process($related->name, $related);
my $path = $route->render($related->TO_JSON);
$path =~ s!^/!!;
my $up = join '', map {'../'} $path =~ m!\/!g;
$relate
ssetPack::Util qw(checksum diag dumper load_module DEBUG);
use Mojo::File;
use Mojo::JSON qw(decode_json encode_json);
use Mojo::Util;
my $FORMAT_RE = qr{^s[ac]ss$};
my $IMPORT_RE
index) = @_;
return if $asset->format !~ $FORMAT_RE;
my ($attrs, $content) = ($asset->TO_JSON, $asset->content);
local $self->{checksum_for_file} = {};
local $opts{include_paths}[0] =
elf->_checksum(\$content, $asset, $opts{include_paths});
return $asset->content($file)->FROM_JSON($attrs) if $file = $store->load($attrs);
return if $asset->isa('Mojolicious::Plugin::AssetPac
my $attrs = $asset->TO_JSON;
$attrs->{key} = 'riot';
$attrs->{format} = 'js';
return unless $asset->format eq 'tag';
return $asset->content($file)->FROM_JSON($attrs) if $file = $st
>_riotjs, \$asset->content, \my $js);
$asset->content($store->save(\$js, $attrs))->FROM_JSON($attrs);
});
}
sub _install_riot {
my $self = shift;
my $path = $self->app->home->rel_file
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_jpegoptim {
my $self = shift;
my $class = ref $self;
die "$
$asset->format ne 'less';
my $attrs = $asset->TO_JSON;
@$attrs{qw(format key)} = qw(css less);
return $asset->content($file)->FROM_JSON($attrs) if $file = $store->load($attrs);
diag 'P
;
$self->run(\@args, undef, \my $css);
$asset->content($store->save(\$css, $attrs))->FROM_JSON($attrs);
});
}
sub _install_lessc {
my $self = shift;
my $bin = $self->app->home->rel_fil
my $attrs = $asset->TO_JSON;
$attrs->{key} = 'ts';
$attrs->{format} = 'js';
return unless $asset->format eq 'ts';
return $asset->content($file)->FROM_JSON($attrs) if $file = $stor
f->_typescript, \$asset->content, \my $js);
$asset->content($store->save(\$js, $attrs))->FROM_JSON($attrs);
});
}
sub _install_typescript {
my $self = shift;
# TODO: This is a bit fragile,
sset->format ne 'coffee';
my $attrs = $asset->TO_JSON;
@$attrs{qw(format key)} = qw(js coffee);
return $asset->content($file)->FROM_JSON($attrs) if $file = $store->load($attrs);
diag '
pile --stdio)], \$asset->content, \my $js);
$asset->content($store->save(\$js, $attrs))->FROM_JSON($attrs);
});
}
sub _install_coffee {
my $self = shift;
my $path = $self->app->home->rel_fi
ck->minify;
return $assets->each(sub {
my ($asset, $index) = @_;
my $attrs = $asset->TO_JSON;
$attrs->{key} = 'css-min';
$attrs->{minified} = 1;
return if $asset->format ne