blib/lib/Dist/Zilla/PluginBundle/Author/OALDERS.pm

filter: Statementstmt 56.2% 27 / 48 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 58.3% 7 / 12 Podpod 100% 1 / 1 totaltotal 49.3% 35 / 71 CC 6 SCAR 20.3
CC
6
Cov
48%
configure
20.0
_all_stopwords
12.0
__ANON__
2.0
CRAP 7.6
↑ Summary
1 package Dist::Zilla::PluginBundle::Author::OALDERS;
2  
3 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 our $VERSION = '0.000030';
7  
8 1 ▶use feature qw( say );
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶use List::AllUtils qw( first );
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use Pod::Elemental::Transformer::List;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use Types::Path::Tiny qw( Path );
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶use Types::Standard qw( ArrayRef Maybe Str );
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 1 with(
16 'Dist::Zilla::Role::PluginBundle::Easy',
17 'Dist::Zilla::Role::PluginBundle::PluginRemover',
18 'Dist::Zilla::Role::PluginBundle::Config::Slicer', # needs to come last
19 );
20  
21 1 has stopwords => (
22 traits => ['Array'],
23 is => 'ro',
24 isa => ArrayRef [Str],
25 predicate => '_has_stopwords',
26 required => 0,
27 );
28  
29 has stopwords_file => (
30 is => 'ro',
31 isa => Maybe [Path],
32 coerce => 1,
33 0 ▶ default => sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
34 0 ▶ first { -e } ( '.stopwords', 'stopwords' );
Subroutine __ANON__: not called CC=1 SCAR=6.9
35 },
36 1 );
37  
38 0 ▶sub configure {
Subroutine configure: not called CC=4 SCAR=30.0
Pod documented
39 0 my $self = shift;
40  
41 0 my $readme = 'README.md';
42 0 my @copy_from_build = (
43 'cpanfile', 'LICENSE', 'Makefile.PL', 'META.json', $readme,
44 );
45 0 my @copy_from_release = ('Install');
46  
47 my @allow_dirty
48 0 = ( 'dist.ini', 'Changes', @copy_from_build, @copy_from_release );
49  
50 0 ▶ my $static_install_mode = $self->payload->{'StaticInstall.mode'}
Condition0%0/2
$self->payload->{"StaticInstall.mode"} // "auto"
l!l
00
MC/DC0%0/1
$self->payload->{"StaticInstall.mode"} // "auto"
$self->payload->{"StaticInstall.mode"}
Truth table0%0/2
A
A= $self->payload->{"StaticInstall.mode"}
Aresult
11
00
51 // 'auto';
52 0 ▶ my $static_install_dry_run = $self->payload->{'StaticInstall.dry_run'}
Condition0%0/2
$self->payload->{"StaticInstall.dry_run"} // 1
l!l
00
MC/DC0%0/1
$self->payload->{"StaticInstall.dry_run"} // 1
$self->payload->{"StaticInstall.dry_run"}
Truth table0%0/2
A
A= $self->payload->{"StaticInstall.dry_run"}
Aresult
11
00
53 // 1;
54  
55 0 my @plugins = (
56 [
57 'PromptIfStale' => 'stale modules, build' => {
58 phase => 'build',
59 module => [ $self->meta->name ]
60 }
61 ],
62 [
63 'PromptIfStale' => 'stale modules, release' => {
64 phase => 'release',
65 check_all_plugins => 1,
66 check_all_prereqs => 1,
67 }
68 ],
69 'AutoPrereqs',
70 'CheckChangesHasContent',
71 'MakeMaker', # needs to precede InstallGuide
72 'CPANFile',
73 'ContributorsFile',
74 'MetaJSON',
75 'MetaYAML',
76 'Manifest',
77 [ 'MetaNoIndex' => { directory => [ 'examples', 't', 'xt' ] } ],
78 'MetaConfig',
79 'MetaResources',
80 'License',
81 'InstallGuide',
82  
83 # Stolen from Dist::Zilla::PluginBundle::DROLSKY
84 [
85 'Prereqs' => 'Modules for use with tidyall' => {
86 -phase => 'develop',
87 -type => 'requires',
88 'Code::TidyAll' => '0.71',
89 'Code::TidyAll::Plugin::SortLines::Naturally' => '0.000003',
90 'Code::TidyAll::Plugin::Test::Vars' => '0.04',
91 'Code::TidyAll::Plugin::UniqueLines' => '0.000003',
92 'Parallel::ForkManager' => '1.19',
93 'Perl::Critic' => '1.132',
94 'Perl::Tidy' => '20180220',
95 'Test::Vars' => '0.014',
96 }
97 ],
98  
99 [ 'ExecDir' => { dir => 'script' } ],
100  
101 [ 'Test::PodSpelling' => { stopwords => $self->_all_stopwords } ],
102 'MojibakeTests',
103 'PodSyntaxTests',
104 'Test::CPAN::Changes',
105 'Test::EOL',
106 'Test::Pod::Coverage::Configurable',
107 'Test::Portability',
108 'TestRelease',
109 'Test::ReportPrereqs',
110 'Test::Synopsis',
111 'Test::TidyAll',
112 'Test::Version',
113  
114 'RunExtraTests',
115  
116 'MinimumPerl',
117 'PodWeaver',
118 'PruneCruft',
119  
120 [ 'CopyFilesFromBuild' => { copy => \@copy_from_build } ],
121  
122 [ 'GithubMeta' => { issues => 1 } ],
123 [
124 'Git::GatherDir' => {
125 exclude_filename => [ @copy_from_build, @copy_from_release ]
126 }
127 ],
128 [ 'CopyFilesFromRelease' => { filename => [@copy_from_release] } ],
129 [ 'Git::Check' => { allow_dirty => \@allow_dirty } ],
130 'Git::Contributors',
131  
132 [
133 'ReadmeAnyFromPod' => 'ReadmeMdInBuild' => {
134 filename => $readme,
135 location => 'build',
136 type => 'markdown',
137 }
138 ],
139 [
140 'StaticInstall' => {
141 ':version' => '0.005', mode => $static_install_mode,
142 dry_run => $static_install_dry_run
143 }
144 ],
145 'ShareDir',
146 'CheckIssues',
147 'ConfirmRelease',
148 'UploadToCPAN',
149 );
150  
151 0 $self->add_plugins($_) for @plugins;
152 0 $self->add_bundle(
153 '@Git::VersionManager' => {
154 commit_files_after_release => \@allow_dirty,
155 'RewriteVersion::Transitional.fallback_version_provider' =>
156 'Git::NextVersion',
157 }
158 );
159  
160 0 $self->add_plugins('Git::Push');
161 }
162  
163 0 ▶sub _all_stopwords {
Subroutine _all_stopwords: not called CC=3 SCAR=24.8
164 0 my $self = shift;
165  
166 0 my @stopwords = $self->_default_stopwords;
167 0 ▶ push @stopwords, @{ $self->stopwords } if $self->_has_stopwords;
Branch: 1 branch
BranchTrueFalseTotal
if $self->_has_stopwords 0 0 0
168  
169 0 ▶ if ( $self->stopwords_file ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->stopwords_file) 0 0 0
170 0 push @stopwords, $self->stopwords_file->lines_utf8( { chomp => 1 } );
171 }
172  
173 0 return \@stopwords;
174 }
175  
176 0 ▶sub _default_stopwords {
Subroutine _default_stopwords: not called CC=1 SCAR=6.9
177 0 qw(
178 Alders
179 Alders'
180 );
181 }
182  
183 1 __PACKAGE__->meta->make_immutable;
184 1 1;
185  
186 #ABSTRACT: A plugin bundle for distributions built by OALDERS
187  
188 __END__
↑ Summary