| 1 | package Dist::Zilla::Plugin::NoAutomatedTesting; | ||||||||||||||||||||
| 2 | { | ||||||||||||||||||||
| 3 | 1 | $Dist::Zilla::Plugin::NoAutomatedTesting::VERSION = '0.08'; | |||||||||||||||||||
| 4 | } | ||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | # ABSTRACT: Avoid running under CPAN Testers | ||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | 1 | ▶ | use Moose; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | 1 | with 'Dist::Zilla::Role::InstallTool'; | |||||||||||||||||||
| 10 | |||||||||||||||||||||
| 11 | 0 | ▶ | sub setup_installer { | ||||||||||||||||||
|
Subroutine
setup_installer: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||
| 12 | 0 | my $self = shift; | |||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | 0 | ▶ | my @build_files = grep { $_->name eq 'Makefile.PL' or $_->name eq 'Build.PL' } @{ $self->zilla->files }; | ||||||||||||||||||
|
Condition0%0/3
$_->name eq 'Makefile.PL' || $_->name eq 'Build.PL'
MC/DC0%0/2
$_->name eq 'Makefile.PL' || $_->name eq 'Build.PL'
$_->name eq 'Makefile.PL'
$_->name eq 'Build.PL'
Truth table0%0/3
A || B
A= $_->name eq 'Makefile.PL'B= $_->name eq 'Build.PL'
| |||||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | 0 | ▶ | $self->log_fatal('No Makefile.PL or Build.PL was found. [NoAutomatedTesting] should appear in dist.ini after your installer plugin!') | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 17 | unless @build_files; | ||||||||||||||||||||
| 18 | |||||||||||||||||||||
| 19 | 0 | my $content = 'exit 0 if $ENV{AUTOMATED_TESTING};' . "\n"; | |||||||||||||||||||
| 20 | 0 | foreach my $file (@build_files) | |||||||||||||||||||
| 21 | { | ||||||||||||||||||||
| 22 | 0 | $file->content( $content . $file->content ); | |||||||||||||||||||
| 23 | } | ||||||||||||||||||||
| 24 | 0 | return; | |||||||||||||||||||
| 25 | } | ||||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | 1 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||
| 28 | 1 | ▶ | no Moose; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | 1 | 'NO SMOKING' | |||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | __END__ | ||||||||||||||||||||