common::sense;
use SDL;
use SDL::Surface;
use SDL::Video;
use SDL::TTF;
use OpenGL qw(:all);
use JSON;
use Games::Construder::Vector;
use Games::Construder;
use File::ShareDir::PAR;
use Games::Constr
ntries} = [];
if ($gui_desc && $gui_desc->{layout}) {
$self->{layout} = decode_json (encode_json ($gui_desc->{layout}));
}
my $layout = $self->{layout};
$self->{active_elements
with this program. If not, see <http://www.gnu.org/licenses/>.
#
package Games::Construder;
use JSON;
use common::sense;
use Time::HiRes qw/time/;
use Games::Construder::Logging;
require Exporter;
# show_region_sectors
my %sectors;
my $wg = JSON->new->relaxed->decode (_get_file ("res/world_gen.json"));
for my $type (keys %{$wg->{sector_types}}) {
ion_sector <sector type>
my ($type) = @arg;
my $wg = JSON->new->relaxed->decode (_get_file ("res/world_gen.json"));
my $s = $wg->{sector_types}->{$type};
my $r = $s
construder"
: File::Spec->tmpdir . "/construder";
our $CLCONFIG = "construder_client.json";
sub new {
my $this = shift;
my $class = ref ($this) || $this;
my $self = { @_ };
sub load_config {
my ($self) = @_;
if (-e "$VARDIR/$CLCONFIG") {
$self->{config} = JSON->new->pretty->utf8->decode (_get_file ("$VARDIR/$CLCONFIG"));
} else {
$self->{config}
ambient_light => 0.2,
};
}
}
sub save_config {
my ($self) = @_;
my $cfg = JSON->new->pretty->utf8->encode ($self->{config} ||= {});
my $file = $VARDIR . "/" . $CLCONFIG;
/$self->{name}.json";
return unless -e "$file";
if (open my $plf, "<", $file) {
binmode $plf, ":raw";
my $cont = do { local $/; <$plf> };
my $data = eval { JSON->new->relaxed-
elf) = @_;
my $cont = JSON->new->pretty->utf8->encode ($self->{data});
my $pld = $Games::Construder::Server::Resources::PLAYERDIR;
my $file = "$pld/$self->{name}.json";
if (open my $plf,
::RES->get_assignment_for_score ($self->{data}->{score});
#print "ASSIGNMENT BASE VALUES: " . JSON->new->pretty->encode ([
# $desc, $size, $material_map, $distance, $time, $score
#]) . "\n
Role::FileGatherer';
with 'Dist::Zilla::Role::FileMunger';
use Dist::Zilla::File::FromCode;
use JSON 2;
use Path::Class;
use Capture::Tiny qw/capture/;
has 'npm_root' => (
isa => 'Str',
most {} brackets
$components =~ m/(\{.*\})/s;
$components = $1;
my $deploys = decode_json $components;
foreach my $deploy (keys(%$deploys)) {
$self->concatenate_for_task($dep
a simple JavaScript assignment (to allow inclusion via <script> tag) of the JSON structure.
First level entries of the JSON structure defines a bundles. Each bundle is an array of entries.
Entry, s
Request Object.
Once the object has been made, an HTTP call to the CloudFlare API
is made. The JSON returned is used to construct a Response object
loaded from Response:: with the same name as the
e App::locket;
BEGIN {
$App::locket::VERSION = '0.0022';
}
# ABSTRACT: Copy secrets from a YAML/JSON cipherstore into the clipboard (pbcopy, xsel, xclip)
use strict;
use warnings;
BEGIN {
# Sa
n';
}
use Term::ReadKey;
END {
ReadMode 0;
}
use File::HomeDir;
use Path::Class;
use JSON; my $JSON = JSON->new->pretty;
use YAML::XS();
use File::Temp;
use Term::EditorEdit;
use Try::Tiny;
use S
;
return join '', <$pipe>;
}
1;
=pod
=head1 NAME
App::locket - Copy secrets from a YAML/JSON cipherstore into the clipboard (pbcopy, xsel, xclip)
=head1 VERSION
version 0.0022
=head1 SYNO
s, $entity, $type, $dt) = @_;
$entity->{rest_time} -= $dt;
#d# warn "ENTITIY MAT DONE: " . JSON->new->pretty->encode ($entity) . "\n";
return unless $entity->{rest_time} <= 0;
my $handl
pattern (@$POS, 0);
if ($a) {
ctr_log (devel => "construction pad pattern at @$POS: %s", JSON->new->encode ($a));
my $obj = $Games::Construder::Server::RES->get_object_by_pattern ($a);
tity->{fail_chance}) {
ctr_log (debug => "Jumper (failed) values: %s",
JSON->new->encode ($entity));
$pl->msg (1, "Jumper malfunction. Please retry.");
/licenses/>.
#
package Games::Construder::Server::Resources;
use common::sense;
use AnyEvent;
use JSON;
use Digest::MD5 qw/md5_base64/;
use Games::Construder::Server::Objects;
use File::ShareDir::PAR;
} =
JSON->new->relaxed->utf8->decode (my $f = _get_shared_file ("content.json"));
my $stypes = $self->{content}->{sector_types}
or die "No sector types defined in content.json!\n";
f
ry {
my ($self) = @_;
my $shpdb = $self->{txt_db}->{ship};
#d#print "TEXT TREE FROM: " . JSON->new->pretty->encode ($shpdb) . "\n";
my %nodes;
for (keys %$shpdb) {
my $con = del
r;
use Time::HiRes qw/time/;
use Carp qw/confess/;
use Compress::LZF qw/decompress compress/;
use JSON;
use Storable qw/dclone/;
use Games::Construder::Logging;
require Exporter;
our @ISA = qw/Export
n bytes, but only got ".length ($data)."!");
return -1;
}
my $meta = eval { JSON->new->relaxed->utf8->decode ($metadata) };
if ($@) {
ctr_log (error => "map sector
->{tmp} = {}; # don't store entity temporary data (might contain objects)
}
my $meta_data = JSON->new->utf8->pretty->encode ($meta || {});
my $data = join "", @chunks;
my $filedata = comp
RACT: Generate the `package.json` file, suitable for `npm` package manager
use Moose;
with 'Dist::Zilla::Role::FileGatherer';
use Dist::Zilla::File::FromCode;
use JSON 2;
use Path::Class;
use Fi
$self->add_file(Dist::Zilla::File::FromCode->new({
name => file('package.json') . '',
code => sub {
my $package = {};
ackage->{ bin } = $self->bin if $self->bin;
return JSON->new->utf8(1)->pretty(1)->encode($package)
}
}));
# backward compat with np
scape) to escape data for HTML script sections (Japanese)
L<RFC4627> - The application/json Media Type for JSON
=head1 LICENSE
This library is free software; you can redistribute it and/or modify
i
shRef[Str]|Undef', required => 0 );
# JSON boolean values, coerced into 1|0 (Not Required)
has [qw/ zone_exists zone_hosted /]
=> ( is => 'ro', isa => 'json_bool', required => 0, coerce => 1 );
package WebService::CloudFlare::Host::Role::Response;
use Moose::Role;
use JSON;
use Data::Dumper;
use Moose::Util::TypeConstraints;
requires 'res_map';
sub BUILDARGS {
my ( $class, $http ) = @_
00."
unless $http->code == 200;
my $json = decode_json( $http->content );
my %map = $class->res_map;
my $args = { __JSON__ => $json };
%map = __PACKAGE__->add_map_defaults( %
tmp_json = $json;
for my $elem ( @elems ) {
next OUTER unless exists $tmp_json->{$elem};
$tmp_json = $tmp_json->{$elem};
}
$args->{$key} = $tmp_json;
has [qw/ zones /]
=> ( is => 'rw', isa => 'ArrayRef[Str]|Undef', required => 0 );
has [qw/ user_exists user_authed /]
=> ( is => 'rw', isa => 'json_bool', required => 1, coerce => 1 );
1;
om qw/ makerandom_octet /;
use Digest::SHA qw/ sha256 sha256_hex /;
use MIME::Base64;
use JSON; my $JSON = JSON->new->pretty;
use File::HomeDir;
use Path::Class;
use Term::ReadKey;
use YAML::XS();
use
phrase ) {
my $ciphercfg = $self->pickle( $self->generate_keylet, $passphrase, $plaincfg, json => 1 );
$cfg_file->openw->print( $ciphercfg );
}
else {
$cfg_file->openw-
ore;
my $store;
try {
if ( $plainstore =~ m/^\s*\{/ )
{ $store = $JSON->decode( $plainstore ) }
else { $store = YAML::XS::Load( $plainstore ) }
};
di
libraries
to load configuration data from multiple different file formats. It supports XML, YAML,
JSON, Apache-style configuration, Windows INI files, and even Perl code.
The rationale for this modul
he following:
L<Config::General|Config::General>
L<Config::Tiny|Config::Tiny>
L<JSON|JSON>
L<YAML|YAML>
L<JSON::Syck|JSON::Syck>
L<YAML::Syck|YAML::Syck>
L<XML::Simple|XML::Simple>
=head1 INCOMPATIBI
=============================================================
; `npm` configuration - package.json generation
[JSAN::NPM]
main = lib/Task/Sample/Dist/Core
with the documentation after each release
L<Dist::Zilla::Plugin::JSAN::NPM> - generate `package.json` file for your distribution
L<Dist::Zilla::Plugin::JSAN::NPM::Publish> - publish your distributi
us API
package WWW::Delicious::Simple;
use strict;
use warnings;
use JSON;
my $API_BASE = 'http://feeds.delicious.com/v2/json/urlinfo/data?url=';
sub get_url_info {
my ( $class, $args ) = @_
= $ua->get( $API_BASE . $args->{url} );
if ( $response->is_success ) {
return decode_json $response->content;
}
else {
die $response->status_line;
}
}
1;
__END__
=p
portion, of the Delicious (V2) API.
Patches welcome to support more of the API.
Returns decoded json returned from the API.
Possibly very unstable; may have future backwards incompatible releases,
Any setting, including multiple settings, may be set this way.
Setting values must be valid JSON.
Settings are not the same as local configuration variables. For
more information on local confi