view release on metacpan or search on metacpan
t/00-basic.t view on Meta::CPAN
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.pl'
######################### We start with some black magic to print on failure.
# Change 1..1 below to 1..last_test_to_print .
# (It may become useful if the test is moved to ./t subdirectory.)
BEGIN { $| = 1; print "1..1\n"; }
view all matches for this distribution
view release on metacpan or search on metacpan
$app->plugins->namespaces(['Mojolicious::Plugin', "${CLASS}::Plugin",]);
unshift @{$app->commands->namespaces}, "${CLASS}::Command";
return $app;
}
# This method will run once at server start
sub startup {
shift->_initialise()->load_config()->load_plugins()->load_routes()->define_mime_types();
return;
}
#load ado.conf
Ado - a rapid active commotion (framework for web-projects on Mojolicious)
=head1 SYNOPSIS
require Mojolicious::Commands;
Mojolicious::Commands->start_app('Ado');
=head1 DESCRIPTION
L<Ado> is a framework for web-projects based on L<Mojolicious>, written in the
L<Perl programming language|http://www.perl.org/>. This is the base
application class. Ado C<ISA> L<Mojolicious>. For a more detailed description
on what Ado is and how to get started with Ado see B<L<Ado::Manual>>.
=head1 ATTRIBUTES
Ado inherits all attributes from Mojolicious and implements the following new
ones.
=over
=item 1. If C<$ENV{MOJO_HOME}> is defined, it is honored.
=item 2. The upper directory of the directory in which the starting executable
C<$app-E<gt>moniker> is found, e.g. C<bin/..>. This may happen to be the same
as L</ado_home>.
=item 3. Fallback to L<Mojo/home>. This is the usual behavior of any L<Mojo>
application.
Ado inherits all methods from Mojolicious and implements
the following new ones.
=head2 startup
Sets various default paths like C<templates>, C<site_templates>, C<public>.
Defines L<Mojolicious/secrets> as sha1_sum of C<$moniker.$mode. $home>. Sets
L<Mojolicious/controller_class> and L<Mojolicious::Routes/namespaces> to
L<${CLASS}::Control>. Sets L<Mojolicious::Plugins/namespaces> to
view all matches for this distribution
view release on metacpan or search on metacpan
}
# ----------------------------------------------------------------------------
# Helper functions that won't appear in the POD.
# They will all start with "_" in their name.
# But they are still considered members of the object.
# These functions can appear throughout this file.
# ----------------------------------------------------------------------------
# Using Cwd's abs_path() bombs on Windows if the file doesn't exist!
This method reads the current I<$filename> into memory and converts it into an
object so that you may reference its contents. The I<$filename> must be defined
either here or in the call to B<new()>.
Each time you call this method, it wipes the contents of the object and starts
you from a clean slate again. Making it safe to call multiple times if needed.
The I<%override_read_opts> options apply just to the current call to
I<load_config> and will be forgotten afterwards. If you want these options
to persist between calls, set the option via the call to B<new()>. This
This method takes the passed I<$string> and treats it's value as the contents of
a config file. Modifying the I<$string> afterwards will not affect things. You
can use this as an alternative to F<load_config>.
Each time you call this method, it wipes the contents of the object and starts
you from a clean slate again. Making it safe to call multiple times if needed.
The I<%override_read_opts> options apply just to the current call to
I<load_string> and will be forgotten afterwards. If you want these options
to persist between calls, set the option via the call to B<new()>. This
# something else - passed by value. (array)
sub _get_opt_args
{
my $self = shift; # Reference to the current section.
my $opt_ref = $_[0]; # May be undef, a hash ref, or start of a hash ...
# Convert the parameter array into a regular old hash reference ...
my %opts;
unless ( defined $opt_ref ) {
$opt_ref = \%opts;
# Find all tags begining with the pattern ...
foreach ( $self->find_tags ("^${pattern}") ) {
$res{$_} = 1;
}
# Find all environment variables starting with the given pattern ...
foreach ( keys %ENV ) {
# Never include these 2 special tags in any list ...
next if ( defined $secret_tag && $secret_tag eq $_ );
next if ( defined $fish_tag && $fish_tag eq $_ );
Finally for rule B<7> it provides some special date variables. See
B<F<Advanced::Config::Options::set_special_date_vars>> for a complete list of
what date related variables are defined. The most useful being ${today} and
${yesterday} so that you can dynamically name your log files
F</my_path/my_log.${today}.txt> and you won't need any special date roll logic
to start a new log file.
=cut
sub lookup_one_variable
{
view all matches for this distribution
view release on metacpan or search on metacpan
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.pl'
######################### We start with some black magic to print on failure.
# Change 1..1 below to 1..last_test_to_print .
# (It may become useful if the test is moved to ./t subdirectory.)
BEGIN { $| = 1; print "1..1\n"; }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Affix/Wrap.pm view on Meta::CPAN
field $name : reader : param //= '';
field $doc : reader : param //= ();
field $file : reader : param //= '';
field $line : reader : param //= 0;
field $end_line : reader : param //= 0;
field $start_offset : reader : param //= 0;
field $end_offset : reader : param //= 0;
field $is_merged : reader = 0;
field $doc_data = undef;
method mark_merged { $is_merged = 1 }
method _base($p) { return '' unless defined $p; $p =~ s{^.*[/\\]}{}; return $p }
lib/Affix/Wrap.pm view on Meta::CPAN
# Strip outer quotes from C string literals
if ( $v =~ /^"(.*)"$/ ) { $v = $1; $v =~ s/\\(.)/$1/g; }
elsif ( $v =~ /^'(.*)'$/ ) { $v = $1; }
# Protect against Perl-internal reserved names (starting with __)
# and macros containing unresolved C calls or backslashes
if ( $self->name =~ /^__/ || $v =~ /[\\()]/ ) {
return '# use constant ' . $self->name . " => $v";
}
if ( $v =~ /^-?(?:0x[\da-fA-F]+|\d+(?:\.\d+)?)$/ ) {
lib/Affix/Wrap.pm view on Meta::CPAN
$self->_walk( $ast, \@objects, $ep_abs );
$self->_scan_macros_fallback( \@objects );
$self->_merge_typedefs( \@objects );
$self->_wrap_named_types( \@objects );
#~ @objects = sort { ( $a->file cmp $b->file ) || ( $a->start_offset <=> $b->start_offset ) } @objects;
@objects;
}
method _walk( $node, $acc, $current_file ) {
return unless ref $node eq 'HASH';
lib/Affix/Wrap.pm view on Meta::CPAN
file => $f,
line => $l,
end_line => $el,
value => $val,
doc => $self->_extract_doc( $f, $s ),
start_offset => $s,
end_offset => $e
);
}
method _typedef( $n, $acc, $f ) {
lib/Affix/Wrap.pm view on Meta::CPAN
file => $f,
line => $l,
end_line => $el,
underlying => Affix::Wrap::Type->parse( $n->{type}{qualType} ),
doc => $self->_doc_w_trail( $f, $s, $e ),
start_offset => $s,
end_offset => $e
);
}
method _record( $n, $acc, $f ) {
lib/Affix/Wrap.pm view on Meta::CPAN
file => $f,
line => $l,
end_line => $el,
members => $m_list,
doc => $self->_doc_w_trail( $f, $s, $e ),
start_offset => $s,
end_offset => $e
);
}
method _extract_members( $n, $f ) {
lib/Affix/Wrap.pm view on Meta::CPAN
file => $f,
line => $l,
end_line => $el,
constants => \@c,
doc => $self->_doc_w_trail( $f, $s, $e ),
start_offset => $s,
end_offset => $e
);
}
method _var( $n, $acc, $f ) {
lib/Affix/Wrap.pm view on Meta::CPAN
file => $f,
line => $l,
end_line => $el,
type => Affix::Wrap::Type->parse( $n->{type}{qualType} ),
doc => $self->_doc_w_trail( $f, $s, $e ),
start_offset => $s,
end_offset => $e
);
}
method _func( $n, $acc, $f ) {
lib/Affix/Wrap.pm view on Meta::CPAN
line => $l,
end_line => $el,
ret => $ret_obj,
args => \@args,
doc => $self->_doc_w_trail( $f, $s, $e ),
start_offset => $s,
end_offset => $e
);
}
method _get_content($f) {
lib/Affix/Wrap.pm view on Meta::CPAN
file => $f,
line => $line,
end_line => $line,
value => $val,
doc => $self->_extract_doc( $f, $off ),
start_offset => $off,
end_offset => $end
);
}
}
}
lib/Affix/Wrap.pm view on Meta::CPAN
name => $td->name,
underlying => $child,
file => $td->file,
line => $td->line,
end_line => $child->end_line,
doc => $td->doc // $child->doc // $self->_extract_doc( $td->file, $td->start_offset ),
start_offset => $td->start_offset,
end_offset => $td->end_offset
);
for ( my $i = 0; $i < @$objs; $i++ ) {
if ( $objs->[$i] == $td ) { $objs->[$i] = $new; last; }
}
lib/Affix/Wrap.pm view on Meta::CPAN
underlying => $node,
file => $node->file,
line => $node->line,
end_line => $node->end_line,
doc => $node->doc,
start_offset => $node->start_offset,
end_offset => $node->end_offset
);
$node->mark_merged();
$objs->[$i] = $new;
}
lib/Affix/Wrap.pm view on Meta::CPAN
next unless length $abs;
next unless $self->_is_valid_file($abs);
if ( $f =~ /\.h(pp|xx)?$/i ) { $self->_scan( $f, \@objs ); $self->_scan_funcs( $f, \@objs ); }
else { $self->_scan_funcs( $f, \@objs ); }
}
@objs = sort { ( $a->file cmp $b->file ) || ( $a->start_offset <=> $b->start_offset ) } @objs;
@objs;
}
method _read($f) {
my $abs = $self->_normalize($f);
lib/Affix/Wrap.pm view on Meta::CPAN
value => $val,
file => $f,
line => $self->_ln( $c, $s ),
end_line => $self->_ln( $c, $e ),
doc => $self->_doc( $c, $s ),
start_offset => $s,
end_offset => $e
);
}
# Structs
lib/Affix/Wrap.pm view on Meta::CPAN
members => $mem,
file => $f,
line => $self->_ln( $c, $s ),
end_line => $self->_ln( $c, $e ),
doc => undef,
start_offset => $s,
end_offset => $e
);
push @$acc,
Affix::Wrap::Typedef->new(
name => $2,
underlying => $struct,
file => $f,
line => $self->_ln( $c, $s ),
end_line => $self->_ln( $c, $e ),
doc => $self->_doc( $c, $s ),
start_offset => $s,
end_offset => $e
);
}
# Enums (typedef)
lib/Affix/Wrap.pm view on Meta::CPAN
constants => $self->_enum_consts( substr( $1, 1, -1 ) ),
file => $f,
line => $self->_ln( $c, $s ),
end_line => $self->_ln( $c, $e ),
doc => undef,
start_offset => $s,
end_offset => $e
);
push @$acc,
Affix::Wrap::Typedef->new(
name => $2,
underlying => $enum,
file => $f,
line => $self->_ln( $c, $s ),
end_line => $self->_ln( $c, $e ),
doc => $self->_doc( $c, $s ),
start_offset => $s,
end_offset => $e
);
}
# Enums (standard)
lib/Affix/Wrap.pm view on Meta::CPAN
constants => $self->_enum_consts( substr( $2, 1, -1 ) ),
file => $f,
line => $self->_ln( $c, $s ),
end_line => $self->_ln( $c, $e ),
doc => $self->_doc( $c, $s ),
start_offset => $s,
end_offset => $e
);
push @$acc,
Affix::Wrap::Typedef->new(
name => $1,
underlying => $enum,
file => $f,
line => $self->_ln( $c, $s ),
end_line => $self->_ln( $c, $e ),
doc => $self->_doc( $c, $s ),
start_offset => $s,
end_offset => $e
);
}
# Global variables
lib/Affix/Wrap.pm view on Meta::CPAN
type => Affix::Wrap::Type->parse($type_str),
file => $f,
line => $self->_ln( $c, $s ),
end_line => $self->_ln( $c, $e ),
doc => $doc,
start_offset => $s,
end_offset => $e
);
}
# Typedefs
lib/Affix/Wrap.pm view on Meta::CPAN
underlying => $coderef,
file => $f,
line => $self->_ln( $c, $s ),
end_line => $self->_ln( $c, $e ),
doc => $self->_doc( $c, $s ),
start_offset => $s,
end_offset => $e
);
}
elsif ( $content =~ /^(.+?)([\s\*]+)([a-zA-Z_]\w*(?:\[.*?\])?)$/ ) {
my ( $type_str, $sep, $name ) = ( $1, $2, $3 );
lib/Affix/Wrap.pm view on Meta::CPAN
underlying => Affix::Wrap::Type->parse($type_str),
file => $f,
line => $self->_ln( $c, $s ),
end_line => $self->_ln( $c, $e ),
doc => $self->_doc( $c, $s ),
start_offset => $s,
end_offset => $e
);
}
}
}
lib/Affix/Wrap.pm view on Meta::CPAN
args => \@args,
file => $f,
line => $self->_ln( $c, $s ),
end_line => $self->_ln( $c, $e ),
doc => $self->_doc( $c, $s ),
start_offset => $s,
end_offset => $e
);
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
bin/agent_net.pl view on Meta::CPAN
=back
=head1 DESCRIPTION
B<agent_net> will start a TCLI Agent running on the XMPP Transport
with the Net, Tail and XMPP packages loaded.
Use B<agent_net> as is or as the basis for creating Agents with different
functionaity.
bin/agent_net.pl view on Meta::CPAN
},
);
print "Starting ".$alias unless $verbose;
# Required to start the Agent
POE::Kernel->run();
print" FINISHED\n";
exit;
view all matches for this distribution
view release on metacpan or search on metacpan
bin/agent_tail.pl view on Meta::CPAN
=back
=head1 DESCRIPTION
B<agent_tail> will start a TCLI Agent running on the XMPP Transport
with the Tail and XMPP packages loaded.
Use B<agent_tail> as is or as the basis for creating Agents with different
functionaity.
bin/agent_tail.pl view on Meta::CPAN
},
);
print "Starting ".$alias unless $verbose;
# Required to start the Agent
POE::Kernel->run();
print" FINISHED";
exit;
view all matches for this distribution