Module-Starter-TOSHIOITO
view release on metacpan or search on metacpan
lib/Module/Starter/TOSHIOITO.pm view on Meta::CPAN
my %t_files = ();
my $header = $self->_t_header;
my $nmodules = @modules;
my $main_module = $modules[0];
my $use_lines = join(
"\n", map { qq{ use_ok( '$_' ) || print "Bail out!\\n";} } @modules
);
$t_files{'00-load.t'} = $header.<<"HERE";
plan tests => $nmodules;
BEGIN {
$use_lines
}
diag( "Testing $main_module \$${main_module}::VERSION, Perl \$], \$^X" );
HERE
return %t_files;
}
sub xt_guts {
my ($self, @modules) = @_;
my %t_files = ();
my $header = $self->_t_header;
$t_files{'pod.t'} = $header.<<'HERE';
use Test::Pod;
all_pod_files_ok();
done_testing;
HERE
$t_files{'manifest.t'} = $header.<<'HERE';
use Test::CheckManifest;
unless($ENV{RELEASE_TESTING}) {
plan(skip_all => "Set RELEASE_TESTING environment variable to test MANIFEST");
}
ok_manifest();
done_testing;
HERE
return %t_files;
}
sub _t_header {
my ($self) = @_;
return <<"EOH";
use $self->{minperl};
use strict;
use warnings;
use Test::More;
EOH
}
sub _ensure_dir {
my ($self, @dirpaths) = @_;
my $dir = File::Spec->catdir($self->{basedir}, @dirpaths);
if (not -d $dir) {
local @ARGV = $dir;
mkpath();
$self->progress("Created $dir");
}
}
sub ignores_guts {
my ($self, $type) = @_;
return $self->SUPER::ignores_guts($type) if $type ne "manifest";
return <<'HERE'
^_
^\.
^MYMETA\.yml$
^MYMETA\.json$
^_build
^Build$
^blib
^MANIFEST\.
^README\.pod$
# Avoid version control files.
\bRCS\b
\bCVS\b
,v$
\B\.svn\b
\b_darcs\b
# (.git only in top-level, hence it's blocked above)
# Avoid temp and backup files.
~$
\.tmp$
\.old$
\.bak$
\..*?\.sw[po]$
\#$
\b\.#
# avoid OS X finder files
\.DS_Store$
# ditto for Windows
\bdesktop\.ini$
\b[Tt]humbs\.db$
# Avoid patch remnants
\.orig$
\.rej$
HERE
}
1;
__END__
=pod
=head1 NAME
Module::Starter::TOSHIOITO - create a module like TOSHIOITO does
=head1 SYNOPSIS
( run in 1.101 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )