Siffra-Bootstrap
view release on metacpan or search on metacpan
lib/Siffra/Bootstrap.pm view on Meta::CPAN
package Siffra::Bootstrap;
use 5.014;
use strict;
use warnings;
use utf8;
use Data::Dumper;
use DDP;
use Log::Any qw($log);
use Scalar::Util qw(blessed);
$Carp::Verbose = 1;
use Config::Any;
use IO::Prompter;
$| = 1; #autoflush
use constant {
FALSE => 0,
TRUE => 1,
DEBUG => $ENV{ DEBUG } // 0,
};
BEGIN
{
binmode( STDOUT, ":encoding(UTF-8)" );
binmode( STDERR, ":encoding(UTF-8)" );
require Siffra::Tools;
use Exporter ();
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
$VERSION = '0.11';
@ISA = qw(Siffra::Tools Exporter);
#Give a hoot don't pollute, do not export more than needed by default
@EXPORT = qw();
@EXPORT_OK = qw();
%EXPORT_TAGS = ();
} ## end BEGIN
UNITCHECK
{
# eval { use Fcntl qw(:flock); };
# $log->info( "Tentando lockar o programa [ $0 ]..." );
# unless ( flock( DATA, LOCK_EX | LOCK_NB ) )
# {
# $log->warn( "O programa [ $0 ] já está sendo executado. Saindo." );
# exit( 1 );
# }
# $log->info( "Programa [ $0 ] lockado com sucesso..." );
} ## end UNITCHECK
#################### subroutine header begin ####################
=head2 sample_function
Usage : How to use this function/method
Purpose : What it does
Returns : What it returns
Argument : What it wants to know
Throws : Exceptions and other anomolies
Comment : This is a sample subroutine header.
: It is polite to include more pod and fewer comments.
See Also :
=cut
#################### subroutine header end ####################
=head2 C<new()>
Usage : $self->block_new_method() within text_pm_file()
Purpose : Build 'new()' method as part of a pm file
Returns : String holding sub new.
Argument : $module: pointer to the module being built
(as there can be more than one module built by EU::MM);
for the primary module it is a pointer to $self
Throws : n/a
Comment : This method is a likely candidate for alteration in a subclass,
e.g., pass a single hash-ref to new() instead of a list of
parameters.
=cut
sub new
{
$log->debug( "new", { progname => $0, pid => $$, perl_version => $], package => __PACKAGE__ } );
my ( $class, %parameters ) = @_;
my $self = $class->SUPER::new( %parameters );
$self->{ beachmarck } = {
created => $^T,
started => undef,
finished => undef
};
$self->{ configurations } = \%parameters;
$self->_initialize( %parameters );
return $self;
} ## end sub new
sub _initialize()
{
$log->debug( "_initialize", { package => __PACKAGE__ } );
my ( $self, %parameters ) = @_;
$self->SUPER::_initialize( %parameters );
}
sub _finalize()
( run in 1.483 second using v1.01-cache-2.11-cpan-39bf76dae61 )