Dist/Zilla/PluginBundle/NGLENN.pm

filter: Statementstmt 98.8% 165 / 167 Branchbran 44.5% 33 / 74 Conditioncond 33.3% 4 / 12 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 96.6% 58 / 60 Podpod 0.0% 0 / 1 totaltotal 81.5% 260 / 319 CC 42 SCAR 37.9
CC
42
Cov
80%
configure
149.4
__ANON__
6.0
__ANON__
6.0
CRAP 44.0
↑ Summary Pod/Weaver/PluginBundle/NGLENN.pm »
1 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package Dist::Zilla::PluginBundle::NGLENN;
5 # ABSTRACT: Dist::Zilla plugin configuration for me
6  
7 1 our $VERSION = '0.07';
8  
9 # Dependencies
10 1 ▶use Moose 0.99;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use namespace::autoclean 0.09;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 ▶use Dist::Zilla 5.014; # default_jobs
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 1 ▶use Dist::Zilla::PluginBundle::Filter ();
Subroutine BEGIN: called CC=1 SCAR=0.0
16 1 ▶use Dist::Zilla::PluginBundle::Git 1.121010 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 1 ▶use Dist::Zilla::Plugin::Authority 1.006 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use Dist::Zilla::Plugin::Bugtracker 1.110 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 ▶use Dist::Zilla::Plugin::BumpVersionAfterRelease 0.003 (); # tweak Makefile.PL
Subroutine BEGIN: called CC=1 SCAR=0.0
21 1 ▶use Dist::Zilla::Plugin::CheckChangesHasContent ();
Subroutine BEGIN: called CC=1 SCAR=0.0
22 1 ▶use Dist::Zilla::Plugin::RunExtraTests ();
Subroutine BEGIN: called CC=1 SCAR=0.0
23 1 ▶use Dist::Zilla::Plugin::CheckMetaResources 0.001 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
24 1 ▶use Dist::Zilla::Plugin::CheckPrereqsIndexed 0.002 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
25 1 ▶use Dist::Zilla::Plugin::Git::Contributors 0.007 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
26 1 ▶use Dist::Zilla::Plugin::CopyFilesFromBuild ();
Subroutine BEGIN: called CC=1 SCAR=0.0
27 1 ▶use Dist::Zilla::Plugin::CPANFile ();
Subroutine BEGIN: called CC=1 SCAR=0.0
28 1 ▶use Dist::Zilla::Plugin::Git::NextVersion ();
Subroutine BEGIN: called CC=1 SCAR=0.0
29 # use Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch ();
30 1 ▶use Dist::Zilla::Plugin::GithubMeta 0.36 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
31 1 ▶use Dist::Zilla::Plugin::GitHub::UploadRelease ();
Subroutine BEGIN: called CC=1 SCAR=0.0
32 1 ▶use Dist::Zilla::Plugin::TravisYML ();
Subroutine BEGIN: called CC=1 SCAR=0.0
33 1 ▶use Dist::Zilla::Plugin::TravisCI::StatusBadge;
Subroutine BEGIN: called CC=1 SCAR=0.0
34 1 ▶use Dist::Zilla::Plugin::InsertCopyright 0.001 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
35 1 ▶use Dist::Zilla::Plugin::MetaNoIndex ();
Subroutine BEGIN: called CC=1 SCAR=0.0
36 1 ▶use Dist::Zilla::Plugin::MetaProvides::Package 1.14 (); # hides private packages
Subroutine BEGIN: called CC=1 SCAR=0.0
37 1 ▶use Dist::Zilla::Plugin::MinimumPerl ();
Subroutine BEGIN: called CC=1 SCAR=0.0
38 1 ▶use Dist::Zilla::Plugin::PodWeaver ();
Subroutine BEGIN: called CC=1 SCAR=0.0
39 1 ▶use Dist::Zilla::Plugin::PromptIfStale 0.011 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
40 1 ▶use Dist::Zilla::Plugin::Prereqs::AuthorDeps ();
Subroutine BEGIN: called CC=1 SCAR=0.0
41 1 ▶use Dist::Zilla::Plugin::RewriteVersion ();
Subroutine BEGIN: called CC=1 SCAR=0.0
42 1 ▶use Dist::Zilla::Plugin::ReadmeFromPod 0.19 (); # for dzil v5
Subroutine BEGIN: called CC=1 SCAR=0.0
43 1 ▶use Dist::Zilla::Plugin::InstallGuide ();
Subroutine BEGIN: called CC=1 SCAR=0.0
44 1 ▶use Dist::Zilla::Plugin::TaskWeaver 0.101620 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
45 1 ▶use Dist::Zilla::Plugin::Test::Compile 2.036 (); # various features
Subroutine BEGIN: called CC=1 SCAR=0.0
46 1 ▶use Dist::Zilla::Plugin::Test::MinimumVersion 2.000003 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
47 1 ▶use Dist::Zilla::Plugin::Test::Perl::Critic ();
Subroutine BEGIN: called CC=1 SCAR=0.0
48 1 ▶use Dist::Zilla::Plugin::Test::PodSpelling 2.006001 (); # Pod::Wordlist
Subroutine BEGIN: called CC=1 SCAR=0.0
49 1 ▶use Test::Portability::Files 0.06 (); # buggy before that
Subroutine BEGIN: called CC=1 SCAR=0.0
50 1 ▶use Dist::Zilla::Plugin::Test::Portability ();
Subroutine BEGIN: called CC=1 SCAR=0.0
51 1 ▶use Dist::Zilla::Plugin::Test::ReportPrereqs 0.016 (); # better reporting & bug fixes
Subroutine BEGIN: called CC=1 SCAR=0.0
52 1 ▶use Dist::Zilla::Plugin::Test::Version ();
Subroutine BEGIN: called CC=1 SCAR=0.0
53  
54 1 with qw(
55 Dist::Zilla::Role::PluginBundle::Easy
56 Dist::Zilla::Role::PluginBundle::Config::Slicer
57 Dist::Zilla::Role::PluginBundle::PluginRemover
58 );
59  
60 1 ▶sub mvp_multivalue_args { qw/stopwords/ }
Subroutine mvp_multivalue_args: called CC=1 SCAR=0.0
61  
62 has stopwords => (
63 is => 'ro',
64 isa => 'Maybe[ArrayRef]',
65 lazy => 1,
66 1 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
67 1 ▶ exists $_[0]->payload->{stopwords} ? $_[0]->payload->{stopwords} : undef;
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'stopwords'} ? : 0 1 1
68 },
69 1 );
70  
71 has fake_release => (
72 is => 'ro',
73 isa => 'Bool',
74 lazy => 1,
75 1 ▶ default => sub { $_[0]->payload->{fake_release} },
Subroutine __ANON__: called CC=1 SCAR=0.0
76 1 );
77  
78 has no_git => (
79 is => 'ro',
80 isa => 'Bool',
81 lazy => 1,
82 1 ▶ default => sub { $_[0]->payload->{no_git} },
Subroutine __ANON__: called CC=1 SCAR=0.0
83 1 );
84  
85 has no_critic => (
86 is => 'ro',
87 isa => 'Bool',
88 lazy => 1,
89 1 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
90 1 ▶ exists $_[0]->payload->{no_critic} ? $_[0]->payload->{no_critic} : 0;
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'no_critic'} ? : 0 1 1
91 },
92 1 );
93  
94 has no_spellcheck => (
95 is => 'ro',
96 isa => 'Bool',
97 lazy => 1,
98 1 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
99 exists $_[0]->payload->{no_spellcheck}
100 ? $_[0]->payload->{no_spellcheck}
101 1 ▶ : 0;
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'no_spellcheck'} ? : 0 1 1
102 },
103 1 );
104  
105 has no_coverage => (
106 is => 'ro',
107 isa => 'Bool',
108 lazy => 1,
109 1 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
110 exists $_[0]->payload->{no_coverage}
111 ? $_[0]->payload->{no_coverage}
112 1 ▶ : 0;
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'no_coverage'} ? : 0 1 1
113 },
114 1 );
115  
116 has no_minimum_perl => (
117 is => 'ro',
118 isa => 'Bool',
119 lazy => 1,
120 1 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
121 exists $_[0]->payload->{no_minimum_perl}
122 ? $_[0]->payload->{no_minimum_perl}
123 1 ▶ : 0;
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'no_minimum_perl'} ? : 0 1 1
124 },
125 1 );
126  
127 has is_task => (
128 is => 'ro',
129 isa => 'Bool',
130 lazy => 1,
131 1 ▶ default => sub { $_[0]->payload->{is_task} },
Subroutine __ANON__: called CC=1 SCAR=0.0
132 1 );
133  
134 has auto_prereq => (
135 is => 'ro',
136 isa => 'Bool',
137 lazy => 1,
138 1 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
139 1 ▶ exists $_[0]->payload->{auto_prereq} ? $_[0]->payload->{auto_prereq} : 1;
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'auto_prereq'} ? : 0 1 1
140 },
141 1 );
142  
143 has tag_format => (
144 is => 'ro',
145 isa => 'Str',
146 lazy => 1,
147 0 ▶ default => sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
148 0 ▶ exists $_[0]->payload->{tag_format} ? $_[0]->payload->{tag_format} : 'release-%v',;
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'tag_format'} ? : 0 0 0
149 },
150 1 );
151  
152 has version_regexp => (
153 is => 'ro',
154 isa => 'Str',
155 lazy => 1,
156 0 ▶ default => sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
157 exists $_[0]->payload->{version_regexp}
158 ? $_[0]->payload->{version_regexp}
159 0 ▶ : '^release-(.+)$',
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'version_regexp'} ? : 0 0 0
160 ;
161 },
162 1 );
163  
164 has weaver_config => (
165 is => 'ro',
166 isa => 'Str',
167 lazy => 1,
168 1 ▶ default => sub { $_[0]->payload->{weaver_config} || '@NGLENN' },
Subroutine __ANON__: called CC=2 SCAR=7.6
Branch: 1 branch
BranchTrueFalseTotal
$_[0]->payload->{"weaver_config"} or "\@NGLENN" 0 1 1
169 1 );
170  
171 has github_issues => (
172 is => 'ro',
173 isa => 'Str',
174 lazy => 1,
175 1 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
176 1 ▶ exists $_[0]->payload->{github_issues} ? $_[0]->payload->{github_issues} : 1;
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'github_issues'} ? : 0 1 1
177 },
178 1 );
179  
180 has git_remote => (
181 is => 'ro',
182 isa => 'Str',
183 lazy => 1,
184 1 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
185 1 ▶ exists $_[0]->payload->{git_remote} ? $_[0]->payload->{git_remote} : 'origin',;
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'git_remote'} ? : 0 1 1
186 },
187 1 );
188  
189 has authority => (
190 is => 'ro',
191 isa => 'Str',
192 lazy => 1,
193 1 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
194 1 ▶ exists $_[0]->payload->{authority} ? $_[0]->payload->{authority} : 'cpan:NGLENN';
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'authority'} ? : 0 1 1
195 },
196 1 );
197  
198 has darkpan => (
199 is => 'ro',
200 isa => 'Bool',
201 lazy => 1,
202 1 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
203 1 ▶ exists $_[0]->payload->{darkpan} ? $_[0]->payload->{darkpan} : 0;
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'darkpan'} ? : 0 1 1
204 },
205 1 );
206  
207 has auto_version => (
208 is => 'ro',
209 isa => 'Bool',
210 lazy => 1,
211 1 ▶ default => sub { $_[0]->payload->{auto_version} },
Subroutine __ANON__: called CC=1 SCAR=0.0
212 1 );
213  
214 1 ▶sub configure {
Subroutine configure: called CC=29 SCAR=50.1
Pod undocumented
215 1 my $self = shift;
216  
217 1 my @push_to = ('origin');
218 1 ▶ push @push_to, $self->git_remote if $self->git_remote ne 'origin';
Branch: 1 branch
BranchTrueFalseTotal
if $self->git_remote ne "origin" 0 1 1
219  
220 $self->add_plugins(
221  
222 # version number
223 ( $self->auto_version ? 'AutoVersion' : 'RewriteVersion' ),
224  
225 # contributors
226 (
227 $self->no_git
228 ? ()
229 : 'Git::Contributors'
230 ),
231  
232 # gather and prune
233 (
234 $self->no_git
235 ? [ 'GatherDir' => { exclude_filename => [qw/README.mkdn cpanfile Makefile.PL LICENSE INSTALL/] }
236 ] # core
237 : [
238 'Git::GatherDir' => { exclude_filename => [qw/README.mkdn cpanfile Makefile.PL LICENSE INSTALL/] }
239 ]
240 ),
241 'PruneCruft', # core
242 'ManifestSkip', # core
243  
244 # file munging
245 ( $self->auto_version ? 'PkgVersion' : () ),
246 'InsertCopyright',
247 (
248 $self->is_task
249 ? 'TaskWeaver'
250 : [
251 'PodWeaver' => {
252 config_plugin => $self->weaver_config,
253 replacer => 'replace_with_comment',
254 post_code_replacer => 'replace_with_nothing',
255 }
256 ]
257 ),
258  
259 # generated distribution files
260 'ReadmeFromPod', # in build dir
261 'InstallGuide', # in build dir
262 'TravisCI::StatusBadge', # in readme file
263 'License', # core
264  
265 # Travis config file
266 (
267 $self->no_git
268 ? ()
269 : [
270 'TravisYML' => {
271 build_branch => 'master',
272 }
273 ]
274 ),
275  
276 # generated t/ tests
277 [
278 'Test::Compile' => {
279 fake_home => 1,
280 xt_mode => 1,
281 }
282 ],
283 (
284 $self->no_minimum_perl
285 ? ()
286 : [ 'Test::MinimumVersion' => { max_target_perl => '5.010' } ]
287 ),
288 'Test::ReportPrereqs',
289  
290 # generated xt/ tests
291 (
292 $self->no_spellcheck ? ()
293 : [
294 'Test::PodSpelling' => $self->stopwords ? { stopwords => $self->stopwords } : ()
295 ]
296 ),
297 (
298 $self->no_critic ? ()
299 : ('Test::Perl::Critic')
300 ),
301 'MetaTests', # core
302 'PodSyntaxTests', # core
303 (
304 $self->no_coverage
305 ? ()
306 : ('PodCoverageTests') # core
307 ),
308 [ 'Test::Portability' => { options => "test_one_dot = 0" } ],
309 'Test::Version',
310  
311 # metadata
312 [
313 'Authority' => {
314 authority => $self->authority,
315 do_munging => 0,
316 }
317 ],
318 'MinimumPerl',
319 (
320 $self->auto_prereq
321 ? [ 'AutoPrereqs' => { skip => "^t::lib" } ]
322 : ()
323 ),
324 [
325 MetaNoIndex => {
326 directory => [qw/t xt examples corpus/],
327 'package' => [qw/DB/]
328 }
329 ],
330 [ 'MetaProvides::Package' => { meta_noindex => 1 } ], # AFTER MetaNoIndex
331 (
332 $self->darkpan
333 ? ()
334 : [
335 GithubMeta => {
336 remote => [qw(origin github)],
337 issues => $self->github_issues,
338 }
339 ],
340 ),
341 (
342 ( $self->no_git || $self->darkpan || !$self->github_issues ) ? (
343 # fake out Pod::Weaver::Section::Support
344 [
345 'Bugtracker' =>
346 { mailto => '', $self->darkpan ? ( web => "http://localhost/" ) : () }
347 ],
348 )
349 : ()
350 ),
351 (
352 ( $self->no_git || $self->darkpan )
353 ? (
354 # fake out Pod::Weaver::Section::Support
355 [
356 1 ▶ 'MetaResources' => { map { ; "repository.$_" => "http://localhost/" } qw/url web/ }
Branch: 23 branches
BranchTrueFalseTotal
$self->auto_version ? : 0 1 1
$self->no_git ? : 1 0 1
$self->no_git ? : 1 0 1
$self->auto_version ? : 0 1 1
$self->is_task ? : 0 1 1
$self->no_git ? : 1 0 1
$self->no_minimum_perl ? : 0 1 1
$self->no_spellcheck ? : 0 1 1
$self->stopwords ? : 0 1 1
$self->no_critic ? : 0 1 1
$self->no_coverage ? : 0 1 1
$self->auto_prereq ? : 1 0 1
$self->darkpan ? : 0 1 1
$self->no_git || $self->darkpan || !$self->github_issues ? : 1 0 1
$self->darkpan ? : 0 1 1
$self->no_git || $self->darkpan ? : 1 0 1
$self->auto_version ? : 0 1 1
$self->no_git ? : 1 0 1
$self->auto_version ? : 0 0 0
$self->fake_release || $self->darkpan ? : 0 1 1
$self->auto_version ? : 0 1 1
$self->no_git ? : 1 0 1
$self->auto_version ? : 0 0 0
Condition33%4/12
$self->no_git or $self->darkpan or not $self->github_issues
l!l&&r!l&&!r
100
$self->no_git or $self->darkpan
l!l&&r!l&&!r
100
$self->no_git or $self->darkpan
l!l&&r!l&&!r
100
$self->fake_release or $self->darkpan
l!l&&r!l&&!r
001
MC/DC0%0/3
$self->no_git or $self->darkpan or not $self->github_issues
$self->no_git $self->darkpan not $self->github_issues
MC/DC0%0/2
$self->fake_release or $self->darkpan
$self->fake_release $self->darkpan
Truth table25%1/4
A or B or not(C)
A= $self->no_gitB= $self->darkpanC= not $self->github_issues
ABCresult
1XX1
01X1
0011
0000
Truth table33%1/3
A or B
A= $self->fake_releaseB= $self->darkpan
ABresult
1X1
011
000
357 ],
358 )
359 : ()
360 ),
361  
362 'Prereqs::AuthorDeps',
363 'MetaYAML', # core
364 'MetaJSON', # core
365 'CPANFile',
366  
367 # build system
368 'ExecDir', # core
369 'ShareDir', # core
370 [ 'MakeMaker' => { eumm_version => '6.17', default_jobs => 9 } ], # core
371  
372 # are we up to date?
373 [
374 'PromptIfStale' => {
375 modules => [qw/Dist::Zilla Dist::Zilla::PluginBundle::NGLENN/],
376 check_all_plugins => 1,
377 }
378 ],
379  
380 # copy files from build back to root for inclusion in VCS;
381 # for auto_version we want cpanfile. For embedded version we want Makefile.PL
382 [
383 CopyFilesFromBuild => { copy => $self->auto_version ? ['cpanfile', 'LICENSE', 'INSTALL'] : ['Makefile.PL', 'LICENSE', 'INSTALL'] }
384 ],
385  
386 # manifest -- must come after all generated files
387 'Manifest', # core
388  
389 # before release
390 # (
391 # $self->no_git ? ()
392 # : ('Git::CheckFor::CorrectBranch')
393 # ),
394 (
395 $self->no_git ? ()
396 : [ 'Git::Check' => {
397 # these are copied to the root by CopyFilesFromBuild
398 allow_dirty => $self->auto_version ? 'cpanfile' : 'Makefile.PL'
399 }
400 ]
401 ),
402 'CheckMetaResources',
403 'CheckPrereqsIndexed',
404 'CheckChangesHasContent',
405 [ 'RunExtraTests' => { default_jobs => 9 } ],
406 'TestRelease', # core
407 'ConfirmRelease', # core
408  
409 # release
410 ( $self->fake_release || $self->darkpan ? 'FakeRelease' : 'UploadToCPAN' ), # core
411  
412 # after release
413 # Note -- NextRelease is here to get the ordering right with
414 # git actions. It is *also* a file munger that acts earlier
415  
416 # bumps Changes
417 'NextRelease', # core (also munges files)
418  
419 # bumps $VERSION, maybe
420 ( $self->auto_version ? () : 'BumpVersionAfterRelease' ),
421  
422 (
423 $self->no_git ? ()
424 : (
425 [
426 'Git::Commit' => 'Commit_Changes' => {
427 $self->auto_version ? ( commit_msg => "After release: timestamp Changes" )
428 : (
429 commit_msg => "After release: bump \$VERSION and timestamp Changes",
430 allow_dirty => [qw/Changes Makefile.PL/],
431 allow_dirty_match => '^lib|^bin',
432 )
433 },
434 'Git::Tag' => { tag_format => $self->tag_format },
435 'Git::Push' => { push_to => \@push_to },
436 'GitHub::UploadRelease' => {}
437 ],
438 )
439 )
440  
441 );
442  
443 }
444  
445 1 __PACKAGE__->meta->make_immutable;
446  
447 1 1;
448  
449 #
450 # This file is part of Dist-Zilla-PluginBundle-NGLENN
451 #
452 # This software is Copyright (c) 2017 by Nathan Glenn.
453 #
454 # This is free software, licensed under:
455 #
456 # The Apache License, Version 2.0, January 2004
457 #
458  
459 __END__
↑ Summary Pod/Weaver/PluginBundle/NGLENN.pm »