App-Module-Template

 view release on metacpan or  search on metacpan

lib/App/Module/Template/Initialize.pm  view on Meta::CPAN

);

=pod

=head1 NAME

App::Module::Template::Initialize - Templates to pre-populate template directory

=head1 VERSION

This documentation refers to App::Module::Template::Initialize version 0.11.

=head1 SYNOPSIS

    use App::Module::Template::Initialize qw/module_template/;

    module_template($path);

=head1 DESCRIPTION

App::Module::Template::Initialize contains the templates and method to initialize the .module-templates/templates directory for use by module-template.

See module-template for configuration and usage.

=head1 SUBROUTINES/METHODS

=over

=item C<module_template>

This subroutine iterates the templates and creates files and directories in $HOME/.module-template.

=back

=head1 DIAGNOSTICS

None.

=head1 CONFIGURATION AND ENVIRONMENT

None.

=head1 DEPENDENCIES

=over

=item * Carp

=item * File::Path

=item * File::HomeDir

=item * File::Spec

=back

=head1 INCOMPATIBILITIES

None reported.

=head1 BUGS AND LIMITATIONS

No bugs have been reported.

Please report any issues or feature requests to L<https://github.com/tscornpropst/App-Module-Template/issues>. Patches are welcome.

=head1 AUTHOR

Trevor S. Cornpropst <tscornpropst@gmail.com>

=head1 COPYRIGHT AND LICENSE

Copyright (c) 2014 Trevor S. Cornpropst <tscornpropst@gmail.com>. All rights reserved.

This program is free software; you can redistribute it and/or modify it
under the terms of the the Artistic License (2.0). You may obtain a
copy of the full license at:

L<http://www.perlfoundation.org/artistic_license_2_0>

Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER
AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY
YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR
CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR
CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

=cut


our $TEMPLATES = {
    config => {
        file => 'config',
        path => '.module-template',
        body => <<'END_OF_BODY',
author           = Default Author
email            = author@example.com
support_address  = support@example.com
min_perl_version = 5.016
eumm_version     = 6.63
license_type     = artistic_2
license_body     =<<END_OF_LICENSE
This program is free software; you can redistribute it and/or modify it
under the terms of the the Artistic License (2.0). You may obtain a
copy of the full license at:

L<http://www.perlfoundation.org/artistic_license_2_0>

Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER
AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY
YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR
CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR
CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
END_OF_LICENSE

<template_toolkit>

lib/App/Module/Template/Initialize.pm  view on Meta::CPAN

use [% min_perl_version %];

use strict;
use warnings;

our $VERSION = '0.01';

use Carp;
use POSIX qw(strftime);

__END__

=pod

=head1 NAME

[% module %] - <one line description>

=head1 VERSION

This documentation refers to [% module %] version 0.01.

=head1 USAGE

=head1 REQUIRED ARGUMENTS

=head1 OPTIONS

=head1 DESCRIPTION

=head1 REQUIREMENTS

None.

=head1 DIAGNOSTICS

None.

=head1 CONFIGURATION

None.

=head1 EXIT STATUS

None.

=head1 DEPENDENCIES

=over

=item * Carp

=item * POSIX

=back

=head1 INCOMPATIBILITIES

None reported.

=head1 BUGS AND LIMITATIONS

No bugs have been reported.

Please report any issues or feature requests to L<[% support_address %]>. Patches are welcome.

=head1 AUTHOR

[% author %] <[% email %]>

=head1 COPYRIGHT AND LICENSE

Copyright (c) [% year %], [% author %] <[% email %]>. All rights reserved.

[% license_body %]

=cut

END_OF_BODY
    },
    module => {
        file => 'Module.pm',
        path => '.module-template/templates/lib',
        body => <<'END_OF_BODY',
package [% module %];

use [% min_perl_version %];

use strict;
use warnings FATAL => 'all';

our $VERSION = '0.01';

use Carp;
use POSIX qw(strftime);

our (@EXPORT, @EXPORT_OK, %EXPORT_TAGS);

@EXPORT      = qw(); # by default, don't do this unless absolutely necessary
@EXPORT_OK   = qw(); # on demand
%EXPORT_TAGS = (
    ALL => [ @EXPORT_OK ],
);

{
#-------------------------------------------------------------------------------
sub new {
    my ($class, $arg) = @_;

    my $self = bless {}, $class;

    $self->_init($args);

    return $self;
}

#-------------------------------------------------------------------------------
sub _init {
    my ($self, $arg) = @_;

#    $self->SUPER::_init($arg);

lib/App/Module/Template/Initialize.pm  view on Meta::CPAN

}

1;

__END__

=pod

=head1 NAME

[% module %] - <one line description>

=head1 VERSION

This documentation refers to [% module %] version 0.01

=head1 SYNOPSIS

=head1 DESCRIPTION

=head1 SUBROUTINES/METHODS

=over

=item C<function_name>

=back

=head1 EXAMPLES

None.

=head1 DIAGNOSTICS

=over

=item B<Error Message>

=item B<Error Message>

=back

=head1 CONFIGURATION AND ENVIRONMENT

[% module %] requires no configuration files or environment variables.

=head1 DEPENDENCIES

=over

=item * Carp

=item * POSIX

=back

=head1 INCOMPATIBILITIES

None reported.

=head1 BUGS AND LIMITATIONS

No bugs have been reported.

Please report any issues or feature requests to L<[% support_address %]>. Patches are welcome.

=head1 AUTHOR

[% author %] <[% email %]>

=head1 COPYRIGHT AND LICENSE

Copyright (c) [% year %], [% author %] <[% email %]>. All rights reserved.

[% license_body %]

=cut

END_OF_BODY
    },
    load_test => {
        file => '00-load.t',
        path => '.module-template/templates/t',
        body => <<'END_OF_BODY',
#!perl

use strict;
use warnings;

use Test::More tests => 1;

use_ok( '[% module %]' );

diag( "Testing [% module %] $[% module %]::VERSION, Perl $], $^X" );
END_OF_BODY
    },
    critic_test => {
        file => 'critic.t',
        path => '.module-template/templates/xt/author',
        body => <<'END_OF_BODY',
#!perl

use strict;
use warnings;

use File::Spec;
use Test::More;

eval { require Test::Perl::Critic; };

if ( $@ ) {
    my $msg = 'Test::Perl::Critic required to criticise code';
    plan( skip_all => $msg );
}

my $rcfile = File::Spec->catfile( 'xt/author', 'perlcritic.rc' );

Test::Perl::Critic->import( -profile => $rcfile );

all_critic_ok();
END_OF_BODY
    },
    critic_rc => {
        file => 'perlcritic.rc',
        path => '.module-template/templates/xt/author',
        body => <<'END_OF_BODY',
severity = 1
color = 1
verbose = 8

# Configure these policies
[InputOutput::RequireCheckedSyscalls]
exclude_functions = print
[Documentation::RequirePodSections]
lib_sections = NAME | VERSION | SYNOPSIS | DESCRIPTION | SUBROUTINES/METHODS | DIAGNOSTICS | CONFIGURATION AND ENVIRONMENT | DEPENDENCIES | INCOMPATIBILITIES | BUGS AND LIMITATIONS | AUTHOR | COPYRIGHT AND LICENSE
script_sections = NAME | USAGE | DESCRIPTION | REQUIRED ARGUMENTS | OPTIONS | DIAGNOSTICS | EXIT STATUS | CONFIGURATION | DEPENDENCIES | INCOMPATIBILITIES | BUGS AND LIMITATIONS | AUTHOR | COPYRIGHT AND LICENSE

# Do not load these policies
[-CodeLayout::ProhibitParensWithBuiltins]
[-CodeLayout::RequireTidyCode]
[-ControlStructures::ProhibitCStyleForLoops]
[-ControlStructures::ProhibitPostfixControls]
[-ControlStructures::ProhibitUnlessBlocks]
[-Subroutines::ProhibitBuiltinHomonyms]
[-ValuesAndExpressions::ProhibitNoisyQuotes]
[-ValuesAndExpressions::RequireInterpolationOfMetachars]
[-Variables::ProhibitPunctuationVars]
END_OF_BODY
    },
    pod_coverage_test => {
        file => 'pod-coverage.t',
        path => '.module-template/templates/xt/author',
        body => <<'END_OF_BODY',
#!perl

use strict;
use warnings;

use Test::More;

# Ensure a recent version of Test::Pod::Coverage
my $min_tpc = 1.08;
eval "use Test::Pod::Coverage $min_tpc";
plan skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage"
    if $@;

# Test::Pod::Coverage doesn't require a minimum Pod::Coverage version,
# but older versions don't recognize some common documentation styles
my $min_pc = 0.18;
eval "use Pod::Coverage $min_pc";
plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage"
    if $@;

all_pod_coverage_ok();
END_OF_BODY
    },
    pod_syntax_test => {
        file => 'pod-syntax.t',
        path => '.module-template/templates/xt/release',
        body => <<'END_OF_BODY',
#!perl

use strict;
use warnings;

use Test::More;

my $min_tp = 1.41;

eval "use Test::Pod $min_tp";

plan skip_all => "Test::Pod $min_tp required for testing POD" if $@;

all_pod_files_ok();
END_OF_BODY
    },



( run in 0.653 second using v1.01-cache-2.11-cpan-39bf76dae61 )