App-CELL

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


0.106  2014-05-23 22:54
- CELL.pm: honor "debug_mode" flag 
- Log.pm: honor debug_mode flag, replace a bunch of wrappers with a single
  AUTOLOAD routine
- t/001-log.t: add some debug_mode-related tests

0.107  2014-05-24 10:19
- Load.pm: add sanity check to constructor (ticket #21)
- config/: fix spelling of params, add params for sanity check
- Message.pm: tell Data::Dumper to not include any newlines

0.108  2014-05-24 12:26
- Load.pm: suppress caller info in "parsed message" $log->debug call,
  generate more useful warnings/errors in find_files
- Log.pm: expand AUTOLOAD routine, improve caller handling, eliminate ok
  and not_ok wrappers
- Message.pm: improve caller handling in constructor
- Status.pm: improve caller handling in constructor, make 'caller' accessor
  return array ref instead of array
- t/070-config.t: turn on debug_mode

Changes  view on Meta::CPAN

- Load.pm: make 'sharedir', 'sharedir_loaded', 'sitedir', 'sitedir_loaded'
  be package variables instead of state variables, return 'ERR' statuses
  instead of 'CRIT'
- Log.pm: implement 'ident', 'show_caller', 'debug_mode' that will replace
  'init'
- CELL_Config.pm: add CELL_CORE_SAMPLE

0.135  2014-05-27 09:05 CEST
- t/100-cell.t: add several tests
- Test.pm: export cmp_arrays symbol
- Build.PL: add 'Data::Dumper' to build_requires, add remote repo URL
- CELL.pm: add supported_languages method

0.136  2014-05-27 10:09 CEST
- dev.sh: always run './Build disttest' after 'perl Build.PL' to ensure
  META.json and META.yml are rebuilt, improve 'stop' routine

0.137  2014-05-27 10:35 CEST
- tweak Build.PL and release.sh

0.138  2014-05-27 22:54 CEST

lib/App/CELL/Config.pm  view on Meta::CPAN

# ************************************************************************* 

package App::CELL::Config;

use strict;
use warnings;
use 5.012;

use App::CELL::Log qw( $log );
use App::CELL::Status;
#use Data::Dumper;
use Scalar::Util qw( blessed );

=head1 NAME

App::CELL::Config -- load, store, and dispense meta parameters, core
parameters, and site parameters



=head1 SYNOPSIS

lib/App/CELL/Load.pm  view on Meta::CPAN

use strict;
use warnings;
use 5.012;

use App::CELL::Config qw( $meta $core $site );
use App::CELL::Log qw( $log );
use App::CELL::Message;
use App::CELL::Status;
use App::CELL::Test qw( cmp_arrays );
use App::CELL::Util qw( stringify_args is_directory_viable );
use Data::Dumper;
use File::Next;
use File::ShareDir;
use Params::Validate qw( :all );

=head1 NAME

App::CELL::Load -- find and load message files and config files



lib/App/CELL/Log.pm  view on Meta::CPAN

# ************************************************************************* 

package App::CELL::Log;

use strict;
use warnings;
use 5.012;

# IMPORTANT: this module must not depend on any other CELL modules
#            except possibly App::CELL::Util
use Data::Dumper;
use File::Spec;
use Log::Any;
use Scalar::Util;



=head1 NAME

App::CELL::Log - the Logging part of CELL

lib/App/CELL/Message.pm  view on Meta::CPAN

# ************************************************************************* 

package App::CELL::Message;

use strict;
use warnings;
use 5.012;

use App::CELL::Log qw( $log );
use App::CELL::Util qw( stringify_args );
use Data::Dumper;
use Try::Tiny;


=head1 NAME

App::CELL::Message - handle messages the user might see



=head1 SYNOPSIS

lib/App/CELL/Message.pm  view on Meta::CPAN

                                    code => $self->code, 
                                    lang => $lang, 
                                    args => $self->args,
                                 );
    return $status;
}


=head2 stringify

Generate a string representation of a message object using Data::Dumper.

=cut

sub stringify {
    local $Data::Dumper::Terse = 1;
    my $self = shift;
    my %u_self = %$self;
    return Dumper( \%u_self );
}


=head2 code

Accessor method for the 'code' attribute.

lib/App/CELL/Status.pm  view on Meta::CPAN

# *************************************************************************

package App::CELL::Status;

use strict;
use warnings;
use 5.012;

use App::CELL::Log qw( $log );
use App::CELL::Util qw( stringify_args );
use Data::Dumper;
use Params::Validate qw( :all );
use Storable qw( dclone );
use Scalar::Util qw( blessed );
use Try::Tiny;



=head1 NAME

App::CELL::Status - class for return value objects

lib/App/CELL/Util.pm  view on Meta::CPAN

# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
# ************************************************************************* 

package App::CELL::Util;

use strict;
use warnings;
use 5.012;

use Data::Dumper;
use Date::Format;
use Params::Validate qw( :all );

=head1 NAME

App::CELL::Util - generalized, reuseable functions



=head1 SYNOPSIS

lib/App/CELL/Util.pm  view on Meta::CPAN


=head2 stringify_args

Convert args (or any data structure) into a string -- useful for error
reporting.

=cut

sub stringify_args {
    my $args = shift;
    local $Data::Dumper::Indent = 0;
    local $Data::Dumper::Terse = 1;
    my $args_as_string;
    if ( ref $args ) {
        $args_as_string = Dumper( $args );
    } else {
        $args_as_string = $args;
    }
    return $args_as_string;
}


t/000-dependencies.t  view on Meta::CPAN

use 5.012;
use strict;
use warnings;
use Test::More;
use Test::Warnings;

BEGIN {

    # CORE modules
    use_ok( 'Carp' );
    use_ok( 'Data::Dumper' );
    use_ok( 'Exporter', qw( import ) );
    use_ok( 'File::Spec' );
    use_ok( 'File::Temp' );
    use_ok( 'Scalar::Util', qw( blessed ) );
    use_ok( 'Storable' );
    use_ok( 'Test::More' );

    # non-core (CPAN) modules
    use_ok( 'Date::Format' );
    use_ok( 'File::HomeDir' );

t/004-debug.t  view on Meta::CPAN

# The purpose of this unit test is to demonstrate how the unit tests can be
# used for debugging (not to test debugging)
#

use 5.012;
use strict;
use warnings;
use App::CELL::Config qw( $site );
use App::CELL::Load;
use App::CELL::Log qw( $log );
use Data::Dumper;
use Test::More;
use Test::Warnings;

#
# To activate debugging, uncomment the following
#
#use App::CELL::Test::LogToFile;
#$log->init( debug_mode => 1 );

my $status;

t/005-message.t  view on Meta::CPAN

#!perl
use 5.012;
use strict;
use warnings;
use File::ShareDir;
use App::CELL::Load;
use App::CELL::Log qw( $log );
use App::CELL::Message;
#use App::CELL::Test::LogToFile;
use Data::Dumper;
use Test::More;
use Test::Warnings;

$log->init( ident => 'CELLtest', debug_mode => 1 );
$log->info("----------------------------------------------- ");
$log->info("---             005-message.t               ---");
$log->info("----------------------------------------------- ");

is_deeply( App::CELL::Message::supported_languages(), [ 'en' ], 
    "Hard-coded list of supported languages consists of just 'en'" );

t/030-status.t  view on Meta::CPAN

#!perl -T
use 5.012;
use strict;
use warnings;
use App::CELL::Log qw( $log );
use App::CELL::Status;
use App::CELL::Test;
use Data::Dumper;
use Test::More;
use Test::Warnings;

my $status;
$log->init( ident => 'CELLtest' );
$log->info("------------------------------------------------- ");
$log->info("---               030-status.t                ---");
$log->info("------------------------------------------------- ");

$status = App::CELL::Status->ok;

t/031-status_ok.t  view on Meta::CPAN

#!perl -T
use 5.012;
use strict;
use warnings;
use App::CELL qw( $CELL $log );
#use App::CELL::Test::LogToFile;
use Data::Dumper;
use Test::More;
use Test::Warnings;

my $status;
$log->init( ident => 'CELLtest' );
$log->info("---------------------------------------------------- ");
$log->info("---               031-status_ok.t                ---");
$log->info("---------------------------------------------------- ");

$status = $CELL->status_ok();

t/032-status-expurgate.t  view on Meta::CPAN

#!perl
use 5.012;
use strict;
use warnings;
use App::CELL qw( $CELL $log );
#use App::CELL::Test::LogToFile;
use Data::Dumper;
use Scalar::Util qw( blessed );
use Test::More;
use Test::Warnings;

my $status;
$log->init( ident => 'CELLtest' );
$log->info("-------------------------------------------------- ");
$log->info("---          032-status-expurgate.t            ---");
$log->info("-------------------------------------------------- ");

t/033-status-accessor.t  view on Meta::CPAN

#!perl
use 5.012;
use strict;
use warnings;
use App::CELL qw( $CELL $log );
#use App::CELL::Test::LogToFile;
use Data::Dumper;
use Test::More;
use Test::Warnings;

my $status;
$log->init( ident => 'CELLtest' );
$log->info("------------------------------------------------- ");
$log->info("---          033-status-accessor.t            ---");
$log->info("------------------------------------------------- ");

$status = $CELL->load( verbose => 1 );

t/034-status-dump.t  view on Meta::CPAN

#!perl
use 5.012;
use strict;
use warnings;
use App::CELL qw( $CELL $log );
use Data::Dumper;
use Test::More;
use Test::Output;
use Test::Warnings;

#
# To activate debugging, uncomment the following
#
#use App::CELL::Test::LogToFile;
#$log->init( debug_mode => 1 );

t/070-config.t  view on Meta::CPAN

#

use 5.012;
use strict;
use warnings;
use App::CELL::Config qw( $meta $core $site );
use App::CELL::Load;
use App::CELL::Log qw( $log );
use App::CELL::Test;
#use App::CELL::Test::LogToFile;
use Data::Dumper;
use Test::More;
use Test::Warnings;

my $status;
$log->init( ident => 'CELLtest', debug_mode => 1 );
$log->info("-------------------------------------------------------");
$log->info("---                  070-config.t                   ---");
$log->info("-------------------------------------------------------");

#

t/100-cell.t  view on Meta::CPAN

#!perl
use 5.012;
use strict;
use warnings;
use App::CELL qw( $CELL $log $meta $core $site );
use App::CELL::Test qw( cmp_arrays );
#use App::CELL::Test::LogToFile;
use Data::Dumper;
use File::ShareDir;
use Test::More;
use Test::Warnings;

my $status;
$log->init( ident => 'CELLtest' );
$log->info("------------------------------------------------------- ");
$log->info("---                   100-cell.t                    ---");
$log->info("------------------------------------------------------- ");

t/110-site.t  view on Meta::CPAN

#!perl
use 5.012;
use strict;
use warnings;
use App::CELL qw( $CELL $log $meta $core $site );
use App::CELL::Test qw( mktmpdir cleartmpdir populate_file );
#use App::CELL::Test::LogToFile;
#use Data::Dumper;
use File::Spec;
use Scalar::Util qw( blessed );
use Test::More;
use Test::Warnings;

my $status;
delete $ENV{CELL_DEBUG_MODE};
$log->init( ident => 'CELLtest', debug_mode => 1 );
$log->info("------------------------------------------------------- ");
$log->info("---                   110-site.t                    ---");

t/111-site.t  view on Meta::CPAN

#!perl
use 5.012;
use strict;
use warnings;
use App::CELL qw( $CELL $log $meta $core $site );
use App::CELL::Test qw( mktmpdir cleartmpdir populate_file );
#use App::CELL::Test::LogToFile;
#use Data::Dumper;
use File::Spec;
use Scalar::Util qw( blessed );
use Test::More;
use Test::Warnings;

my $status;
delete $ENV{CELL_DEBUG_MODE};
$log->init( ident => 'CELLtest', debug_mode => 1 );
$log->info("------------------------------------------------------- ");
$log->info("---                   111-site.t                    ---");



( run in 0.649 second using v1.01-cache-2.11-cpan-4d50c553e7e )