our
$VERSION
=
'1.07'
;
our
@ISA
=
qw(Exporter)
;
our
@EXPORT_OK
=
qw(
_changes_file
_ci_github_file
_config_file
_git_ignore_file
_module_section_ci_badges
_module_template_file
_makefile_section_meta_merge
_makefile_section_bugtracker
_makefile_section_repo
_manifest_skip_file
_manifest_t_file
_unwanted_filesystem_entries
)
;
our
%EXPORT_TAGS
= (
all
=> \
@EXPORT_OK
);
sub
_changes_file {
my
(
$module
) =
@_
;
die
"_changes_file() needs module param"
if
!
defined
$module
;
$module
=~ s/::/-/g;
return
(
qq{Revision history for $module}
,
qq{}
,
qq{0.01 UNREL}
,
qq{ - Auto generated distribution with Dist::Mgr}
,
);
}
sub
_ci_github_file {
my
(
$os
) =
@_
;
if
(!
defined
$os
) {
$os
= [
qw(l w m)
];
}
my
%os_matrix_map
= (
l
=>
qq{ubuntu-latest}
,
w
=>
qq{windows-latest}
,
m
=>
qq{macos-latest}
,
);
my
$os_matrix
=
"[ "
;
$os_matrix
.=
join
(
', '
,
map
{
$os_matrix_map
{
$_
} }
@$os
);
$os_matrix
.=
" ]"
;
return
(
qq{name: CI}
,
qq{on:}
,
qq{ push:}
,
qq{ branches: [ master ]}
,
qq{ pull_request:}
,
qq{ branches: [ master ]}
,
qq{ workflow_dispatch:}
,
qq{jobs:}
,
qq{ build:}
,
qq{ runs-on: \${{ matrix.os }
}},
qq{ strategy:}
,
qq{ matrix:}
,
qq{ os: $os_matrix}
,
qq{ perl: [ '5.32', '5.24', '5.18', '5.14', '5.10' ]}
,
qq{ include:}
,
qq{ - perl: '5.32'}
,
qq{ os: ubuntu-latest}
,
qq{ coverage: true}
,
qq{ name: Perl \${{ matrix.perl }
} on \${{ matrix.os }}},
qq{ steps:}
,
qq{ - uses: actions/checkout\@v2}
,
qq{ - name: Set up perl}
,
qq{ uses: shogo82148/actions-setup-perl\@v1}
,
qq{ with:}
,
qq{ perl-version: \${{ matrix.perl }
}},
qq{ - run: perl -V}
,
qq{ - run: cpanm ExtUtils::PL2Bat}
,
qq{ - run: cpanm ExtUtils::MakeMaker}
,
qq{ - run: cpanm --installdeps .}
,
qq{ - name: Run tests (no coverage)}
,
qq{ if: \${{ !matrix.coverage }
}},
qq{ run: prove -lv t}
,
qq{ - name: Run tests (with coverage)}
,
qq{ if: \${{ matrix.coverage }
}},
qq{ env:}
,
qq{ GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }
}},
qq{ run: |}
,
qq{ cpanm -n Devel::Cover::Report::Coveralls}
,
qq{ cover -test -report Coveralls}
,
);
}
sub
_config_file {
return
{
cpan_id
=>
''
,
cpan_pw
=>
''
,
};
}
sub
_git_ignore_file {
return
(
q{Makefile}
,
q{*~}
,
q{*.bak}
,
q{*.swp}
,
q{*.bak}
,
q{.hg/}
,
q{.git/}
,
q{MYMETA.*}
,
q{*.tar.gz}
,
q{_build/}
,
q{blib/}
,
q{Build/}
,
q{META.json}
,
q{META.yml}
,
q{*.old}
,
q{*.orig}
,
q{pm_to_blib}
,
q{.metadata/}
,
q{.idea/}
,
q{*.debug}
,
q{*.iml}
,
q{*.bblog}
,
q{BB-Pass/}
,
q{BB-Fail/}
,
);
}
sub
_module_section_ci_badges {
my
(
$author
,
$repo
) =
@_
;
return
(
qq{}
,
qq{=for html}
,
qq{}
,
);
}
sub
_module_template_file {
my
(
$module
,
$author
,
$email
) =
@_
;
if
(!
defined
$module
|| !
defined
$author
|| !
defined
$email
) {
die
"_module_template_file() requires 'module', 'author' and 'email' parameters"
;
}
my
(
$email_user
,
$email_domain
);
if
(
$email
=~ /(.*)\@(.*)/) {
$email_user
= $1;
$email_domain
= $2;
}
my
$year
= (
localtime
)[5] + 1900;
return
(
qq{package $module;}
,
qq{}
,
qq{use strict;}
,
qq{use warnings;}
,
qq{}
,
qq{our \$VERSION = '0.01';}
,
qq{}
,
qq{sub __placeholder {}
},
qq{}
,
qq{1;}
,
qq{__END__}
,
qq{}
,
qq{=head1 NAME}
,
qq{}
,
qq{$module - One line description}
,
qq{}
,
qq{=head1 SYNOPSIS}
,
qq{}
,
qq{=head1 DESCRIPTION}
,
qq{}
,
qq{=head1 METHODS}
,
qq{}
,
qq{=head2 name}
,
qq{}
,
qq{Description.}
,
qq{}
,
qq{I<Parameters>:}
,
qq{}
,
qq{ \$bar}
,
qq{}
,
qq{I<Mandatory, String>: The name of the thing with the guy and the place.}
,
qq{}
,
qq{I<Returns>: C<0> upon success.}
,
qq{}
,
qq{=head1 AUTHOR}
,
qq{}
,
qq{$author, C<< <$email_user at $email_domain> >>}
,
qq{}
,
qq{=head1 LICENSE AND COPYRIGHT}
,
qq{}
,
qq{Copyright $year $author.}
,
qq{}
,
qq{This program is free software; you can redistribute it and/or modify it}
,
qq{under the terms of the the Artistic License (2.0). You may obtain a}
,
qq{copy of the full license at:}
,
qq{}
,
);
}
sub
_makefile_section_meta_merge {
return
(
" META_MERGE => {"
,
" 'meta-spec' => { version => 2 },"
,
" resources => {"
,
" },"
,
" },"
);
}
sub
_makefile_section_bugtracker {
my
(
$author
,
$repo
) =
@_
;
return
(
" bugtracker => {"
,
" },"
);
}
sub
_makefile_section_repo {
my
(
$author
,
$repo
) =
@_
;
return
(
" repository => {"
,
" type => 'git',"
,
" },"
);
}
sub
_manifest_skip_file {
return
(
q{~$}
,
q{^blib/}
,
q{^pm_to_blib/}
,
q{.old$}
,
q{.orig$}
,
q{.tar.gz$}
,
q{.bak$}
,
q{.swp$}
,
q{^test/}
,
q{.hg/}
,
q{.hgignore$}
,
q{^_build/}
,
q{^Build$}
,
q{^MYMETA\.yml$}
,
q{^MYMETA\.json$}
,
q{^README.bak$}
,
q{^Makefile$}
,
q{.metadata/}
,
q{.idea/}
,
q{pm_to_blib$}
,
q{.git/}
,
q{.debug$}
,
q{^\.github/}
,
q{.gitignore$}
,
q{^\w+.pl$}
,
q{.ignore.txt$}
,
q{.travis.yml$}
,
q{.iml$}
,
q{examples/}
,
q{build/}
,
q{^\w+.list$}
,
q{.bblog$}
,
q{.base$}
,
q{BB-Pass/}
,
q{BB-Fail/}
,
q{cover_db/}
,
q{scrap\.pl}
,
);
}
sub
_manifest_t_file {
return
(
q|use warnings;|
,
q|use strict;|
,
q||
,
q|use Test::More;|
,
q|use ExtUtils::Manifest;|
,
q||
,
q|if (! $ENV{RELEASE_TESTING}) {|
,
q| plan skip_all => "Author tests not required for installation";|
,
q|}|
,
q||
,
q|is_deeply [ ExtUtils::Manifest::manicheck() ], [], 'missing';|
,
q|is_deeply [ ExtUtils::Manifest::filecheck() ], [], 'extra';|
,
q||
,
q|done_testing;|
,
);
}
sub
_unwanted_filesystem_entries {
return
qw(
xt/
ignore.txt
README
MANIFEST
)
;
}
sub
__placeholder {}
1;