view release on metacpan or search on metacpan
scripts/dex view on Meta::CPAN
DumpFile($filenhandle @documents);
Some utility scripts, mostly useful for debugging:
# Load YAML into a data structure and dump with Data::Dumper
yamlpp-load < file.yaml
# Load and Dump
yamlpp-load-dump < file.yaml
scripts/dex view on Meta::CPAN
=item Complex Keys
Mapping Keys in YAML can be more than just scalars. Of course, you can't load
that into a native perl structure. The Constructor will stringify those keys
with L<Data::Dumper> instead of just returning something like
C<HASH(0x55dc1b5d0178)>.
Example:
use YAML::PP;
scripts/dex view on Meta::CPAN
my ($self, $data) = @_;
return $data if (
ref $data eq 'YAML::PP::Preserve::Scalar'
and ($self->preserve_scalar_style or $self->preserve_alias)
);
require Data::Dumper;
local $Data::Dumper::Quotekeys = 0;
local $Data::Dumper::Terse = 1;
local $Data::Dumper::Indent = 0;
local $Data::Dumper::Useqq = 0;
local $Data::Dumper::Sortkeys = 1;
my $string = Data::Dumper->Dump([$data], ['data']);
$string =~ s/^\$data = //;
return $string;
}
1;
scripts/dex view on Meta::CPAN
=item stringify_complex
When constructing a hash and getting a non-scalar key, this method is
used to stringify the key.
It uses a terse Data::Dumper output. Other modules, like L<YAML::XS>, use
the default stringification, C<ARRAY(0x55617c0c7398)> for example.
=back
=cut
scripts/dex view on Meta::CPAN
use strict;
use warnings;
package YAML::PP::Emitter;
our $VERSION = '0.027'; # VERSION
use Data::Dumper;
use YAML::PP::Common qw/
YAML_PLAIN_SCALAR_STYLE YAML_SINGLE_QUOTED_SCALAR_STYLE
YAML_DOUBLE_QUOTED_SCALAR_STYLE
YAML_LITERAL_SCALAR_STYLE YAML_FOLDED_SCALAR_STYLE
scripts/dex view on Meta::CPAN
$tag = $self->emit_tag('scalar', $tag);
}
$props = join ' ', grep defined, ($anchor, $tag);
my $style = $info->{style};
DEBUG and local $Data::Dumper::Useqq = 1;
$value = '' unless defined $value;
my $first = substr($value, 0, 1);
if ($value eq '') {
if ($flow and $last->{type} ne 'MAPVALUE' and $last->{type} ne 'MAP') {
scripts/dex view on Meta::CPAN
$value = join "\n", @lines;
$value =~ s/'/''/g;
$value = "'" . $value . "'";
}
elsif ($style == YAML_LITERAL_SCALAR_STYLE) {
DEBUG and warn __PACKAGE__.':'.__LINE__.$".Data::Dumper->Dump([\$value], ['value']);
my $indicators = '';
if ($value =~ m/\A\n* +/) {
$indicators .= $self->indent;
}
my $indent = $indent . ' ' x $self->indent;
scripts/dex view on Meta::CPAN
}
$value =~ s/^(?=.)/$indent/gm;
$value = "|$indicators\n$value";
}
elsif ($style == YAML_FOLDED_SCALAR_STYLE) {
DEBUG and warn __PACKAGE__.':'.__LINE__.$".Data::Dumper->Dump([\$value], ['value']);
my @lines = split /\n/, $value, -1;
DEBUG and warn __PACKAGE__.':'.__LINE__.$".Data::Dumper->Dump([\@lines], ['lines']);
my $eol = 0;
my $indicators = '';
if ($value =~ m/\A\n* +/) {
$indicators .= $self->indent;
}
scripts/dex view on Meta::CPAN
my $remaining_yaml = $self->{yaml};
$remaining_yaml = '' unless defined $remaining_yaml;
$yaml .= $remaining_yaml;
{
local $@; # avoid bug in old Data::Dumper
require Data::Dumper;
local $Data::Dumper::Useqq = 1;
local $Data::Dumper::Terse = 1;
$yaml = Data::Dumper->Dump([$yaml], ['yaml']);
chomp $yaml;
}
my $lines = 5;
my @fields;
scripts/dex view on Meta::CPAN
#
# my $event_types = $self->events;
# my $properties;
# my @send_events;
# for my $event (@$event_stack) {
# TRACE and warn __PACKAGE__.':'.__LINE__.$".Data::Dumper->Dump([\$event], ['event']);
# my ($type, $info) = @$event;
# if ($type eq 'properties') {
# $properties = $info;
# }
# elsif ($type eq 'scalar') {
scripts/dex view on Meta::CPAN
TRACE and $self->debug_tokens($next_tokens);
unless (@$next_tokens) {
$self->exception("No more tokens");
}
TRACE and warn __PACKAGE__.':'.__LINE__.$".Data::Dumper->Dump([\$next_tokens->[0]], ['next_token']);
my $got = $next_tokens->[0]->{name};
if ($got eq 'CONTEXT') {
my $context = shift @$next_tokens;
my $indent = $offsets->[-1];
$indent++ unless $self->lexer->flowcontext;
scripts/dex view on Meta::CPAN
warn Term::ANSIColor::colored(["magenta"], "============ $str"), "\n";
}
sub debug_rules {
my ($self, $rules) = @_;
local $Data::Dumper::Maxdepth = 2;
$self->note("RULES:");
for my $rule ($rules) {
if (ref $rule eq 'ARRAY') {
my $first = $rule->[0];
if (ref $first eq 'SCALAR') {
scripts/dex view on Meta::CPAN
for my $token (@$tokens) {
my $type = Term::ANSIColor::colored(["green"],
sprintf "%-22s L %2d C %2d ",
$token->{name}, $token->{line}, $token->{column} + 1
);
local $Data::Dumper::Useqq = 1;
local $Data::Dumper::Terse = 1;
require Data::Dumper;
my $str = Data::Dumper->Dump([$token->{value}], ['str']);
chomp $str;
$str =~ s/(^.|.$)/Term::ANSIColor::colored(['blue'], $1)/ge;
warn "$type$str\n";
}
scripts/dex view on Meta::CPAN
for my $i (0 .. $#$lines) {
$string .= $lines->[ $i ];
$string .= "\n" if ($i != $#$lines or not $trim);
}
}
TRACE and warn __PACKAGE__.':'.__LINE__.$".Data::Dumper->Dump([\$string], ['string']);
return $string;
}
sub render_multi_val {
my ($self, $multi) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
bin/app_dispatch view on Meta::CPAN
exit 1;
}
sub debug {
my $self = shift;
require Data::Dumper;
print Data::Dumper::Dumper($self);
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/DistSync.pm view on Meta::CPAN
# Создаем ÑпиÑок иÑклÑÑений на базе пÑоÑиÑанного Ñанее SKIP + ÑиÑÑемнÑе ÑайлÑ
my @skip_keys = @{(SKIPFILES)};
push @skip_keys, keys %{($self->{maniskip})} if ref($self->{maniskip}) eq 'HASH';
my %skips; for (@skip_keys) {$skips{$_} = _qrreconstruct($_)}
#debug(Data::Dumper::Dumper(\%skips)) && return 0;
# УдÑлÑем ÑÐ°Ð¹Ð»Ñ Ð¿ÐµÑеÑиÑленнÑе в .DEL
debug("Deleting of declared files");
my $dellist = $self->{manidel};
my $expire = _expire(0);
lib/App/DistSync.pm view on Meta::CPAN
foreach (values %$dellist) {
my $dt = _expire($_->[0] || 0);
$_ = [$dt];
$expire = $dt if $dt > $expire;
}
#debug(Data::Dumper::Dumper($dellist));
}
$expire = _expire(EXPIRE) unless $expire > 0;
debug(sprintf("Expires at %s", scalar(localtime(time + $expire))));
my $delfile = $self->{file_manidel};
my $deltime = $self->{mtime_manidel};
lib/App/DistSync.pm view on Meta::CPAN
} else {
debug("> [SKIPPED] Remote resource is in a state of updating. Please wait");
}
next;
}
#debug(Data::Dumper::Dumper($fetch_data));
# ÐолÑÑение Ñдаленного META и анализ его на status = 1. ÐнаÑе, пÑопÑÑк данного ÑеÑÑÑÑа
debug(sprintf("Fetching %s file", METAFILE));
my $fetch_meta = fetch($url, METAFILE, $self->{file_manitemp});
if ($fetch_meta->{status}) {
lib/App/DistSync.pm view on Meta::CPAN
if ($remote_meta && ((ref($remote_meta) eq 'ARRAY') || ref($remote_meta) eq 'YAML::Tiny')) {
$remote_meta = $remote_meta->[0] || {};
} elsif ($remote_meta && ref($remote_meta) eq 'HASH') {
# OK
} else {
#debug(Data::Dumper::Dumper(ref($remote_meta),$remote_meta));
debug("> [SKIPPED] Remote resource is unreadable. Please contact the administrator of this resource");
next;
}
#debug(Data::Dumper::Dumper($remote_meta));
if ($remote_meta && $remote_meta->{status}) {
my $remote_uri = $remote_meta->{uri} || 'localhost';
my $remote_date = $fetch_meta->{mtime} || 0;
my $remote_ok = (time - $remote_date) > _expire(FREEZE) ? 0 : 1;
debug(sprintf("REMOTE RESOURCE:"
lib/App/DistSync.pm view on Meta::CPAN
my $mt_r = $remote_manifest->{$k}[0] || 0;
$mtmp{$k}++ if $mt_l && $mt_r && $mt_l == $mt_r;
} else {
$mtmp{$k} = 1
}
#debug(Data::Dumper::Dumper($mt_l,$mt_r));
}
# ÐолÑаем ÑазниÑÑмоиÑ
и ÑдаленнÑÑ
Ñайлов
# [<] ÐÑÑÑ ÑÑÑока в левом Ñайле
# [>] еÑÑÑ ÑÑÑока в пÑавом Ñайле
lib/App/DistSync.pm view on Meta::CPAN
} else {
debug(sprintf("> [MISSING] File %s not fetched. Status code: %s",
MANIFEST,
$fetch_mani->{code} || 'UNDEFINED',
));
#debug(Data::Dumper::Dumper($fetch_mani));
next;
}
# ÐÑобегаемÑÑ Ð¿Ð¾ MIRRORS ÑдаленнÑм Ñайлам и добавлÑем его к обÑÐµÐ¼Ñ ÑпиÑÐºÑ Ð½Ð° обновление
debug(sprintf("Fetching %s file", MIRRORS));
lib/App/DistSync.pm view on Meta::CPAN
$status = 1; # Ð¤Ð°ÐºÑ Ð½ÐµÐ²Ð¾Ð·Ð¼Ð¾Ð¶Ð½Ð¾ÑÑи полÑÑиÑÑ Ð·ÐµÑкала не ÑвлÑеÑÑÑ Ð¿Ñизнаком Ñого ÑÑо ÑеÑÑÑÑ
# оÑÑабоÑал Ñ Ð¾Ñибками
}
# УдалÑем пÑинÑдиÑелÑно ÑÐ°Ð¹Ð»Ñ Ð¿Ð¾Ð»ÑÑенного ÑпиÑка
#debug(Data::Dumper::Dumper(\%delete_list));
debug("Deleting files");
foreach my $k (keys %delete_list) {
my $f = File::Spec->canonpath(File::Spec->catfile($self->{dir}, $k));
if (-e $f) {
fdelete($f);
lib/App/DistSync.pm view on Meta::CPAN
}
}
# ÐÑоÑ
одим по sync_list и ÑкаÑиваем ÑайлÑ, но коÑоÑÑÑ
ÐÐТ в ÑпиÑке на Ñдаление
debug("Downloading files");
#debug(Data::Dumper::Dumper(\%sync_list));
my $total = 0;
my $cnt = 0;
my $all = scalar(keys %sync_list);
foreach my $k (sort {lc $a cmp lc $b} keys %sync_list) {$cnt++;
debug(sprintf("%03d/%03d %s", $cnt, $all, $k));
lib/App/DistSync.pm view on Meta::CPAN
next unless $e && ref($e) eq 'HASH';
while (my ($_k, $_v) = each %$e) {
carp(sprintf("%s: %s", $_k, $_v));
}
}
#debug(Data::Dumper::Dumper($mkerr));
}
#debug(sprintf("--> %s >>> %s", $src, $dst));
#debug(sprintf("--> %s >>> %s", $dst, $dir));
# ÐеÑеноÑим ÑÐ°Ð¹Ð»Ñ Ð¿Ð¾ назнаÑениÑ
lib/App/DistSync.pm view on Meta::CPAN
foreach my $k (keys %$new_manifest) {
my $nskip = _skipcheck(\%skips, $k);
delete $new_manifest->{$k} if $nskip;
debug(sprintf("> [%s] %s", $nskip ? "SKIPPED" : " ADDED ", $k));
}
#debug(Data::Dumper::Dumper($new_manifest));
# ÐиÑем Ñам Ñайл
debug("Saving manifest to file ".MANIFEST);
return 0 unless maniwrite($self->{file_manifest}, $new_manifest);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Dochazka/CLI.pm view on Meta::CPAN
use 5.012;
use strict;
use warnings;
use App::CELL qw( $CELL );
use Data::Dumper;
use Exporter 'import';
use Test::More;
view all matches for this distribution
view release on metacpan or search on metacpan
t/model/model.t view on Meta::CPAN
use 5.012;
use strict;
use warnings;
use Data::Dumper;
use Test::Fatal;
use Test::More;
use App::Dochazka::Common::Model;
view all matches for this distribution
view release on metacpan or search on metacpan
config/Component_Config.pm view on Meta::CPAN
{
path => 'sample/site_param.mc',
source => <<'EOS',
<%class>
has 'param' => (isa => 'Str', required => 1);
use Data::Dumper;
</%class>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
config/Component_Config.pm view on Meta::CPAN
<title>Dochazka Site Param</title>
</head>
<body>
<pre>
$site_param_name = '<% $.param %>';
<% Data::Dumper->Dump( [ $site->get($.param) ], [ 'site_param_value' ] ) %>
</pre>
</body>
</html>
EOS
acl => 'admin',
config/Component_Config.pm view on Meta::CPAN
path => 'suse-cz-monthly.mc',
source => <<'EOS',
<%class>
has 'employee' => (isa => 'HashRef', required => 1);
has 'tsrange' => (isa => 'Str', required => 1);
use Data::Dumper;
</%class>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Dochazka Monthly Report</title>
</head>
<body>
<pre>
<% Data::Dumper->Dump( [ $.employee ], [ 'employee' ] ) %>
$tsrange = '<% $.tsrange %>';
</pre>
</body>
</html>
EOS
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Dochazka/WWW/Dispatch.pm view on Meta::CPAN
use strict;
use warnings;
use App::CELL qw( $CELL $log $meta $site );
use Data::Dumper;
use JSON;
use Params::Validate qw(:all);
use Try::Tiny;
# methods/attributes not defined in this module will be inherited from:
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Donburi/Server.pm view on Meta::CPAN
disconnect => sub {
$logger->info("Disconnected");
},
error => sub {
my ($irc, $code, $message, $ircmsg) = @_;
use Data::Dumper; warn Dumper($ircmsg);
$logger->crit("$code $message");
}
);
$irc->connect(
view all matches for this distribution
view release on metacpan or search on metacpan
t/02_split.t view on Meta::CPAN
use Test::More tests => 4;
use App::DoubleUp;
use Data::Dumper;
my $app = App::DoubleUp->new();
my @stmts = $app->split_sql_file('test.sql');
is(@stmts, 3);
view all matches for this distribution
view release on metacpan or search on metacpan
config/dumpDB.pl view on Meta::CPAN
#!/usr/bin/env perl
use strict;
use warnings;
use Getopt::Long;
use Data::Dumper;
use DBM::Deep;
use File::Path ();
use File::Spec;
use Digest::MD5 'md5_base64';
view all matches for this distribution
view release on metacpan or search on metacpan
bin/dual-lived view on Meta::CPAN
'Compress::Zlib',
'Config::Extensions',
'Config::Perl::V',
'Cwd',
'DB_File',
'Data::Dumper',
'Devel::PPPort',
'Digest',
'Digest::MD5',
'Digest::SHA',
'Digest::base',
view all matches for this distribution
view release on metacpan or search on metacpan
bin/dubious_http.pl view on Meta::CPAN
use warnings;
use Getopt::Long qw(:config posix_default bundling);
use App::DubiousHTTP::Tests;
use App::DubiousHTTP::Tests::Common;
use App::DubiousHTTP::TestServer;
use Data::Dumper;
sub usage {
print STDERR "ERROR: @_\n" if @_;
print STDERR <<USAGE;
bin/dubious_http.pl view on Meta::CPAN
$tmp =~s{^/+}{};
$spec = $tmp;
}
0 and do {
use Data::Dumper;
warn Dumper({
auto => $auto,
src => $src,
manifest => $manifest,
testnum => $testnum,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/DuckPAN/Perl.pm view on Meta::CPAN
use Config::INI;
use Dist::Zilla::Util;
use Path::Tiny;
use Config::INI::Reader;
use Config::INI::Writer;
use Data::Dumper;
use LWP::UserAgent;
use List::MoreUtils qw/ uniq /;
use List::Util qw/ first /;
use File::Temp qw/ :POSIX /;
use version;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/EPAN.pm view on Meta::CPAN
Modcount: 0
Written-By: PAUSE version 1.005
Date: Sun, 28 Jul 2013 07:41:15 GMT
package CPAN::Modulelist;
# Usage: print Data::Dumper->new([CPAN::Modulelist->data])->Dump or similar
# cannot 'use strict', because we normally run under Safe
# use strict;
sub data {
my $result = {};
my $primary = "modid";
view all matches for this distribution
view release on metacpan or search on metacpan
eumm-migrate.pl view on Meta::CPAN
use Exporter;
our @ISA=qw/Exporter/;
our @EXPORT=qw/prompt WriteMakefile/;
#our @EXPORT_OK=qw/prompt WriteMakefile/;
use Data::Dumper;
use File::Slurp;
use Perl::Meta;
my @prompts;
sub prompt ($;$) { ## no critic
eumm-migrate.pl view on Meta::CPAN
$prompts_str.="Module::Build->prompt(q{$mess},q{$def});\n";
}
$prompts_str.="\n";
}
my $str;
{ local $Data::Dumper::Indent=1;local $Data::Dumper::Terse=1;
$str=Data::Dumper->Dump([\%result], []);
$str=~s/^\{[\x0A\x0D]+//s;
$str=~s/\}[\x0A\x0D]+\s*$//s;
}
print $out <<'EOT';
use strict;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Easer/V1.pm view on Meta::CPAN
$self->{factory}->($commit, 'commit')->($self, $spec, $args);
}
sub d (@stuff) {
no warnings;
require Data::Dumper;
local $Data::Dumper::Indent = 1;
warn Data::Dumper::Dumper(@stuff % 2 ? \@stuff : {@stuff});
} ## end sub d (@stuff)
sub default_getopt_config ($self, $spec) {
my @r = qw< gnu_getopt >;
push @r, qw< require_order pass_through >
view all matches for this distribution
view release on metacpan or search on metacpan
"warnings" : "0"
}
},
"test" : {
"requires" : {
"Data::Dumper" : "0",
"File::Spec" : "0",
"File::Temp" : "0",
"IO::Handle" : "0",
"IPC::Open3" : "0",
"Test::More" : "0",
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/CPANfile.pm view on Meta::CPAN
CPAN::Meta->new($struct)->save($file, { version => $version });
}
sub _dump {
my $str = shift;
require Data::Dumper;
chomp(my $value = Data::Dumper->new([$str])->Terse(1)->Dump);
$value;
}
sub to_string {
my($self, $include_empty) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
example/example.pl view on Meta::CPAN
use lib 'lib';
$ENV{APPCONF_DIRS} = 'example';
use App::Environ;
use App::Environ::ClickHouse;
use Data::Dumper;
App::Environ->send_event('initialize');
my $CH = App::Environ::ClickHouse->instance;
view all matches for this distribution
view release on metacpan or search on metacpan
examples/example.pl view on Meta::CPAN
use lib './examples/lib';
use FindBin;
use App::Environ;
use Data::Dumper;
BEGIN {
$ENV{APPCONF_DIRS} = "$FindBin::Bin/etc";
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/EvalServerAdvanced/ConstantCalc.pm view on Meta::CPAN
# ABSTRACT: turns strings and constants into values
use v5.24;
use Moo;
use Function::Parameters;
use Data::Dumper;
has constants => (is => 'ro', default => sub {+{}});
has _parser => (is => 'ro', default => sub {App::EvalServerAdvanced::ConstantCalc::Parser->new(consts => $_[0])});
method get_value($key) {
view all matches for this distribution
view release on metacpan or search on metacpan
"blib" : "1.01"
}
},
"runtime" : {
"requires" : {
"Data::Dumper" : "0",
"Encode" : "0",
"Exporter" : "0",
"FindBin" : "0",
"Function::Parameters" : "0",
"Google::ProtocolBuffers::Dynamic" : "0",
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/EvalServerAdvanced/REPL.pm view on Meta::CPAN
package App::EvalServerAdvanced::REPL;
use strict;
use warnings;
use Data::Dumper;
use Term::ReadLine;
use IO::Async::Loop;
use IO::Async::Stream;
use Encode;
use utf8;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/EvalServerAdvanced.pm view on Meta::CPAN
use Function::Parameters;
use App::EvalServerAdvanced::Protocol;
use App::EvalServerAdvanced::Log;
use Syntax::Keyword::Try;
use Data::Dumper;
use POSIX qw/_exit/;
use Moo;
use IPC::Run qw/harness/;
view all matches for this distribution
view release on metacpan or search on metacpan
bin/station-mgr.pl view on Meta::CPAN
use POSIX;
use File::Path qw(make_path);
use File::Basename;
use experimental 'switch';
use Getopt::Long;
use Data::Dumper;
# PODNAME: station-mgr
# ABSTRACT: station-mgr - Core Station Manager script
bin/station-mgr.pl view on Meta::CPAN
headers => \%headers,
);
$response = $http->post("$localconfig->{controller}/api/station", \%post_data);
$logger->debug({filter => \&Data::Dumper::Dumper,
value => $response}) if ($logger->is_debug());
}
if ($response->{status} == 200 ) {
my $content = from_json($response->{content});
$self->{controller}{running} = 1;
$logger->debug({filter => \&Data::Dumper::Dumper,
value => $content}) if ($logger->is_debug());
if (defined $content && $content ne 'true') {
$self->{config} = $content->{settings};
write_config();
bin/station-mgr.pl view on Meta::CPAN
} elsif ($response->{status} == 204){
$self->{controller}{running} = 1;
$self->{config}{manager}{pid} = $$;
$logger->warn("Connected but not registered");
$logger->info("Falling back to local config");
$logger->debug({filter => \&Data::Dumper::Dumper,
value => $response}) if ($logger->is_debug());
# Run all connected devices - need to get devices to return an array
if ($self->{config}{devices} eq 'all') {
$self->{config}{devices} = $self->{devices}{array};
bin/station-mgr.pl view on Meta::CPAN
chomp $response->{content};
$self->{controller}{running} = 0;
$self->{config}{manager}{pid} = $$;
$logger->warn("Failed to connect: $response->{content}");
$logger->info("Falling back to local config");
$logger->debug({filter => \&Data::Dumper::Dumper,
value => $response}) if ($logger->is_debug());
# Run all connected devices - need to get devices to return an array
if ($self->{config}{devices} eq 'all') {
$self->{config}{devices} = $self->{devices}{array};
}
post_config();
}
# Debug logging of data
$logger->debug({filter => \&Data::Dumper::Dumper,
value => $self}) if ($logger->is_debug());
# Log when started
if ($self->{config}{run}) {
$logger->info("Manager started, starting devices");
bin/station-mgr.pl view on Meta::CPAN
'content-length' => length($json),
);
my $post = $http->post("http://127.0.0.1:3000/internal/settings", \%post_data);
$logger->info("Config Posted to API");
$logger->debug({filter => \&Data::Dumper::Dumper,
value => $post}) if ($logger->is_debug());
# Status information
my $status;
$status->{status} = $self->{status};
bin/station-mgr.pl view on Meta::CPAN
my %headers = (
'station-mgr' => 1,
'Content-Type' => 'application/json',
);
$logger->debug({filter => \&Data::Dumper::Dumper,
value => $status}) if ($logger->is_debug());
# Status Post Data
$json = to_json($status);
%post_data = (
bin/station-mgr.pl view on Meta::CPAN
);
# Post Status to Mixer
$post = $http->post("http://$self->{config}{mixer}{host}:3000/status/$self->{config}{macaddress}", \%post_data);
$logger->info("Status Posted to Mixer API -> http://$self->{config}{mixer}{host}:3000/status/$self->{config}{macaddress}");
$logger->debug({filter => \&Data::Dumper::Dumper,
value => $post}) if ($logger->is_debug());
# Post Status + devices to Controller
if ($self->{controller}{running}) {
# Build post object
bin/station-mgr.pl view on Meta::CPAN
%post_data = (
content => $json,
headers => \%headers,
);
$logger->debug({filter => \&Data::Dumper::Dumper,
value => $json}) if ($logger->is_debug());
$post = $http->post("$localconfig->{controller}/api/stations/$self->{config}{macaddress}/partial", \%post_data);
$logger->info("Status Posted to Controller API - $localconfig->{controller}/api/stations/$self->{config}{macaddress}/partial");
$logger->debug({filter => \&Data::Dumper::Dumper,
value => $post}) if ($logger->is_debug());
}
return;
}
sub get_config {
my $get = $http->get("http://127.0.0.1:3000/internal/settings");
my $content = from_json($get->{content});
$self->{config} = $content->{config};
$logger->debug({filter => \&Data::Dumper::Dumper,
value => $get}) if ($logger->is_debug());
$logger->debug({filter => \&Data::Dumper::Dumper,
value => $self}) if ($logger->is_debug());
$logger->info("Config recieved from API");
write_config();
return;
}
bin/station-mgr.pl view on Meta::CPAN
# give the process some time to settle
sleep 1;
# Set the running state + pid
$state = $utils->get_pid_command($device->{id},$self->{device_commands}{$device->{id}}{command},$device->{type});
$logger->debug({filter => \&Data::Dumper::Dumper,
value => $state}) if ($logger->is_debug());
# Increase runcount
$self->{device_control}{$device->{id}}{runcount}++;
my $age = $time - $self->{device_control}{$device->{id}}{timestamp};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/FastishCGI.pm view on Meta::CPAN
use AnyEvent;
use AnyEvent::Handle;
use AnyEvent::FCGI;
use Data::Dumper;
use File::Basename;
use IPC::Open3 qw//;
use IO::Handle;
use Sys::Syslog;
use Carp;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Fetchware.pm view on Meta::CPAN
use warnings;
# CPAN modules making Fetchwarefile better.
use File::Spec::Functions qw(catfile splitpath splitdir file_name_is_absolute);
use Path::Class;
use Data::Dumper;
use File::Copy 'cp';
use HTML::TreeBuilder;
use Scalar::Util qw(blessed looks_like_number);
use Digest::SHA;
use Digest::MD5;
lib/App/Fetchware.pm view on Meta::CPAN
:DEFAULT
);
use App::Fetchware::Util ':UTIL';
use HTML::TreeBuilder;
use URI::Split qw(uri_split uri_join);
use Data::Dumper;
use HTTP::Tiny;
program 'php';
lookup_url 'http://us1.php.net/downloads.php';
view all matches for this distribution
view release on metacpan or search on metacpan
# Plug in command-line options.
@{$options}{keys %$clo} = values %$clo;
if ( $options->{debug} ) {
use Data::Dumper;
warn Dumper $options;
}
$options;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/FileTools/BulkRename/UserCommands.pm view on Meta::CPAN
# ::LIST { split("\n",$out) }
# ::HASHREF { {} }
# );
# }
use Data::Dumper;
sub _USER::rd
{ my @dirs = @_;
push @dirs,$_ if !@dirs && defined($_);
view all matches for this distribution
view release on metacpan or search on metacpan
t/unit/App/Filite/Client.t view on Meta::CPAN
=cut
use Test2::V0 -target => 'App::Filite::Client';
use Test2::Tools::Spec;
use Data::Dumper;
use JSON::PP qw( decode_json );
use FindBin qw( $Bin );
my $SHARE = "$Bin/../../../share";
view all matches for this distribution