Dist/Zilla/PluginBundle/ODYNIEC.pm

filter: Statementstmt 98.6% 148 / 150 Branchbran 46.5% 27 / 58 Conditioncond 33.3% 4 / 12 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 96.2% 51 / 53 Podpod 0.0% 0 / 1 totaltotal 82.4% 230 / 279 CC 34 SCAR 30.7
CC
34
Cov
81%
configure
79.0
__ANON__
6.0
__ANON__
6.0
CRAP 21.5
↑ Summary Pod/Weaver/PluginBundle/ODYNIEC.pm »
1 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package Dist::Zilla::PluginBundle::ODYNIEC;
5 2 our $VERSION = '0.021'; # VERSION
6  
7 # Dependencies
8 2 ▶use autodie 2.00;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use Moose 0.99;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use Moose::Autobox;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 ▶use namespace::autoclean 0.09;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 2 ▶use Dist::Zilla 5; # Number 5 is ALIVE!
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 2 ▶use Dist::Zilla::PluginBundle::Filter ();
Subroutine BEGIN: called CC=1 SCAR=0.0
16 2 ▶use Dist::Zilla::PluginBundle::Git 1.121010 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 2 ▶use Dist::Zilla::Plugin::Bugtracker 1.110 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
19 2 ▶use Dist::Zilla::Plugin::CheckChangesHasContent ();
Subroutine BEGIN: called CC=1 SCAR=0.0
20 2 ▶use Dist::Zilla::Plugin::CheckExtraTests ();
Subroutine BEGIN: called CC=1 SCAR=0.0
21 2 ▶use Dist::Zilla::Plugin::CheckMetaResources 0.001 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
22 2 ▶use Dist::Zilla::Plugin::CheckPrereqsIndexed 0.002 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
23 2 ▶use Dist::Zilla::Plugin::ContributorsFromGit 0.004 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
24 2 ▶use Dist::Zilla::Plugin::CopyFilesFromBuild ();
Subroutine BEGIN: called CC=1 SCAR=0.0
25 2 ▶use Dist::Zilla::Plugin::CPANFile ();
Subroutine BEGIN: called CC=1 SCAR=0.0
26 2 ▶use Dist::Zilla::Plugin::Git::NextVersion ();
Subroutine BEGIN: called CC=1 SCAR=0.0
27 2 ▶use Dist::Zilla::Plugin::GithubMeta 0.36 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
28 2 ▶use Dist::Zilla::Plugin::InsertCopyright 0.001 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
29 2 ▶use Dist::Zilla::Plugin::MetaNoIndex ();
Subroutine BEGIN: called CC=1 SCAR=0.0
30 2 ▶use Dist::Zilla::Plugin::MetaProvides::Package 1.14 (); # hides private packages
Subroutine BEGIN: called CC=1 SCAR=0.0
31 2 ▶use Dist::Zilla::Plugin::MinimumPerl ();
Subroutine BEGIN: called CC=1 SCAR=0.0
32 2 ▶use Dist::Zilla::Plugin::OurPkgVersion 0.004 (); # TRIAL comment support
Subroutine BEGIN: called CC=1 SCAR=0.0
33 2 ▶use Dist::Zilla::Plugin::PodWeaver ();
Subroutine BEGIN: called CC=1 SCAR=0.0
34 2 ▶use Dist::Zilla::Plugin::ReadmeAnyFromPod ();
Subroutine BEGIN: called CC=1 SCAR=0.0
35 2 ▶use Dist::Zilla::Plugin::TaskWeaver 0.101620 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
36 2 ▶use Dist::Zilla::Plugin::Test::Compile 2.036 (); # various features
Subroutine BEGIN: called CC=1 SCAR=0.0
37 2 ▶use Dist::Zilla::Plugin::Test::CPAN::Changes ();
Subroutine BEGIN: called CC=1 SCAR=0.0
38 2 ▶use Dist::Zilla::Plugin::Test::MinimumVersion 2.000003 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
39 2 ▶use Dist::Zilla::Plugin::Test::Perl::Critic ();
Subroutine BEGIN: called CC=1 SCAR=0.0
40 2 ▶use Dist::Zilla::Plugin::Test::PodSpelling 2.006001 (); # Pod::Wordlist
Subroutine BEGIN: called CC=1 SCAR=0.0
41 2 ▶use Test::Portability::Files 0.06 (); # buggy before that
Subroutine BEGIN: called CC=1 SCAR=0.0
42 2 ▶use Dist::Zilla::Plugin::Test::Portability ();
Subroutine BEGIN: called CC=1 SCAR=0.0
43 2 ▶use Dist::Zilla::Plugin::Test::ReportPrereqs 0.008 (); # warn on unsatisfied
Subroutine BEGIN: called CC=1 SCAR=0.0
44 2 ▶use Dist::Zilla::Plugin::Test::Version ();
Subroutine BEGIN: called CC=1 SCAR=0.0
45  
46 2 with 'Dist::Zilla::Role::PluginBundle::Easy';
47 2 with 'Dist::Zilla::Role::PluginBundle::Config::Slicer';
48 2 with 'Dist::Zilla::Role::PluginBundle::PluginRemover';
49  
50 1 ▶sub mvp_multivalue_args { qw/stopwords/ }
Subroutine mvp_multivalue_args: called CC=1 SCAR=0.0
51  
52 has stopwords => (
53 is => 'ro',
54 isa => 'Maybe[ArrayRef]',
55 lazy => 1,
56 1 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
57 1 ▶ exists $_[0]->payload->{stopwords} ? $_[0]->payload->{stopwords} : undef;
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'stopwords'} ? : 0 1 1
58 },
59 2 );
60  
61 has fake_release => (
62 is => 'ro',
63 isa => 'Bool',
64 lazy => 1,
65 1 ▶ default => sub { $_[0]->payload->{fake_release} },
Subroutine __ANON__: called CC=1 SCAR=0.0
66 2 );
67  
68 has no_git => (
69 is => 'ro',
70 isa => 'Bool',
71 lazy => 1,
72 1 ▶ default => sub { $_[0]->payload->{no_git} },
Subroutine __ANON__: called CC=1 SCAR=0.0
73 2 );
74  
75 has no_critic => (
76 is => 'ro',
77 isa => 'Bool',
78 lazy => 1,
79 1 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
80 1 ▶ exists $_[0]->payload->{no_critic} ? $_[0]->payload->{no_critic} : 0;
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'no_critic'} ? : 0 1 1
81 },
82 2 );
83  
84 has no_spellcheck => (
85 is => 'ro',
86 isa => 'Bool',
87 lazy => 1,
88 1 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
89 exists $_[0]->payload->{no_spellcheck}
90 ? $_[0]->payload->{no_spellcheck}
91 1 ▶ : 0;
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'no_spellcheck'} ? : 0 1 1
92 },
93 2 );
94  
95 has no_coverage => (
96 is => 'ro',
97 isa => 'Bool',
98 lazy => 1,
99 1 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
100 exists $_[0]->payload->{no_coverage}
101 ? $_[0]->payload->{no_coverage}
102 1 ▶ : 0;
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'no_coverage'} ? : 0 1 1
103 },
104 2 );
105  
106 has no_minimum_perl => (
107 is => 'ro',
108 isa => 'Bool',
109 lazy => 1,
110 1 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
111 exists $_[0]->payload->{no_minimum_perl}
112 ? $_[0]->payload->{no_minimum_perl}
113 1 ▶ : 0;
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'no_minimum_perl'} ? : 0 1 1
114 },
115 2 );
116  
117 has is_task => (
118 is => 'ro',
119 isa => 'Bool',
120 lazy => 1,
121 1 ▶ default => sub { $_[0]->payload->{is_task} },
Subroutine __ANON__: called CC=1 SCAR=0.0
122 2 );
123  
124 has auto_prereq => (
125 is => 'ro',
126 isa => 'Bool',
127 lazy => 1,
128 1 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
129 1 ▶ exists $_[0]->payload->{auto_prereq} ? $_[0]->payload->{auto_prereq} : 1;
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'auto_prereq'} ? : 0 1 1
130 },
131 2 );
132  
133 has tag_format => (
134 is => 'ro',
135 isa => 'Str',
136 lazy => 1,
137 0 ▶ default => sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
138 0 ▶ exists $_[0]->payload->{tag_format} ? $_[0]->payload->{tag_format} : 'v%v',;
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'tag_format'} ? : 0 0 0
139 },
140 2 );
141  
142 has version_regexp => (
143 is => 'ro',
144 isa => 'Str',
145 lazy => 1,
146 0 ▶ default => sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
147 exists $_[0]->payload->{version_regexp}
148 ? $_[0]->payload->{version_regexp}
149 0 ▶ : '^v(.+)$',
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'version_regexp'} ? : 0 0 0
150 ;
151 },
152 2 );
153  
154 has weaver_config => (
155 is => 'ro',
156 isa => 'Str',
157 lazy => 1,
158 1 ▶ default => sub { $_[0]->payload->{weaver_config} || '@ODYNIEC' },
Subroutine __ANON__: called CC=2 SCAR=7.6
Branch: 1 branch
BranchTrueFalseTotal
$_[0]->payload->{"weaver_config"} or "\@ODYNIEC" 0 1 1
159 2 );
160  
161 has github_issues => (
162 is => 'ro',
163 isa => 'Str',
164 lazy => 1,
165 1 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
166 1 ▶ exists $_[0]->payload->{github_issues} ? $_[0]->payload->{github_issues} : 1;
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'github_issues'} ? : 0 1 1
167 },
168 2 );
169  
170 has git_remote => (
171 is => 'ro',
172 isa => 'Str',
173 lazy => 1,
174 1 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
175 1 ▶ exists $_[0]->payload->{git_remote} ? $_[0]->payload->{git_remote} : 'origin',;
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'git_remote'} ? : 0 1 1
176 },
177 2 );
178  
179 has darkpan => (
180 is => 'ro',
181 isa => 'Bool',
182 lazy => 1,
183 1 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
184 1 ▶ exists $_[0]->payload->{darkpan} ? $_[0]->payload->{darkpan} : 0;
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]->payload->{'darkpan'} ? : 0 1 1
185 },
186 2 );
187  
188 1 ▶sub configure {
Subroutine configure: called CC=22 SCAR=43.7
Pod undocumented
189 1 my $self = shift;
190  
191 1 my @push_to = ();
192 1 push @push_to, $self->git_remote;
193  
194 $self->add_plugins(
195  
196 # Version provider
197 (
198 $self->no_git
199 ? 'AutoVersion' # (core)
200 : [ 'Git::NextVersion' =>
201 { version_regexp => $self->version_regexp } ]
202 # Get version from last release tag
203 ),
204  
205 # Collect contributors list
206 (
207 $self->no_git
208 ? ()
209 : 'ContributorsFromGit'
210 ),
211  
212 # Choose files to include
213 (
214 $self->no_git
215 ? [
216 'GatherDir' =>
217 { exclude_filename => [qw/META.json cpanfile/] }
218 ] # (core)
219 : [
220 'Git::GatherDir' =>
221 { exclude_filename => [qw/META.json cpanfile/] }
222 ] # Everything from git ls-files
223 ),
224 'PruneCruft', # Default stuff to skip (core)
225 'ManifestSkip', # If -f MANIFEST.SKIP, skip those, too (core)
226  
227 # File modifications
228 'OurPkgVersion', # Add $VERSION = ... to all files
229 'InsertCopyright', # Add copyright at "# COPYRIGHT"
230 (
231 $self->is_task
232 ? 'TaskWeaver'
233 : [ 'PodWeaver' => { config_plugin => $self->weaver_config } ]
234 # Generate Pod
235 ),
236  
237 # Generated distribution files
238 'License', # Boilerplate license (core)
239 [
240 'ReadmeAnyFromPod' => 'ReadmePodInRoot' => { type => 'pod' }
241 # For README.pod
242 ],
243
244 # Generated t/ tests
245 'Test::ReportPrereqs', # Show prereqs in automated test output
246  
247 # Generated xt/ tests
248 (
249 $self->no_minimum_perl
250 ? ()
251 : [ 'Test::MinimumVersion' => { max_target_perl => '5.010' } ]
252 # Don't use syntax/features past 5.10
253 ),
254 (
255 $self->no_spellcheck ? ()
256 : [ 'Test::PodSpelling' => $self->stopwords ? { stopwords => $self->stopwords } : () ]
257 # xt/author/pod-spell.t
258 ),
259 (
260 $self->no_critic ? ()
261 : ('Test::Perl::Critic')
262 # xt/author/critic.t
263 ),
264 'MetaTests', # xt/release/meta-yaml.t (core)
265 'PodSyntaxTests', # xt/release/pod-syntax.t (core)
266 (
267 $self->no_coverage
268 ? ()
269 : ('PodCoverageTests') # xt/release/pod-coverage.t (core)
270 ),
271 # xt/release/portability.t (of file name)
272 [ 'Test::Portability' => { options => "test_one_dot = 0" } ],
273 'Test::Version', # xt/release/test-version.t
274 [
275 'Test::Compile' => {
276 fake_home => 1, # Fake $ENV{HOME} just in case
277 }
278 ],
279 'Test::CPAN::Changes', # xt/release/cpan-changes.t
280  
281 # Metadata
282 (
283 $self->auto_prereq
284 ? [ 'AutoPrereqs' => { skip => "^t::lib" } ]
285 # Find prereqs from code (core)
286 : ()
287 ),
288 'MinimumPerl', # Determine minimum Perl version
289 [
290 # Sets 'no_index' in META
291 MetaNoIndex => {
292 directory => [qw/t xt examples corpus/],
293 'package' => [qw/DB/] # Just in case
294 }
295 ],
296 (
297 $self->darkpan
298 ? ()
299 : [
300 # Set META resources
301 GithubMeta => {
302 remote => [qw(origin github)],
303 issues => $self->github_issues,
304 }
305 ],
306 ),
307 # Add 'provides' to META files
308 [ 'MetaProvides::Package' =>
309 { meta_noindex => 1 } ], # Respect prior no_index directives
310 (
311 ( $self->no_git || $self->darkpan || !$self->github_issues ) ? (
312 # Fake out Pod::Weaver::Section::Support
313 [
314 'Bugtracker' =>
315 { mailto => '', $self->darkpan ? ( web => "http://localhost/" ) : () }
316 ],
317 )
318 : ()
319 ),
320 (
321 ( $self->no_git || $self->darkpan )
322 ? (
323 # Fake out Pod::Weaver::Section::Support
324 [
325 1 ▶ 'MetaResources' => { map { ; "repository.$_" => "http://localhost/" } qw/url web/ }
Branch: 17 branches
BranchTrueFalseTotal
$self->no_git ? : 1 0 1
$self->no_git ? : 1 0 1
$self->no_git ? : 1 0 1
$self->is_task ? : 0 1 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->no_git ? : 1 0 1
$self->fake_release || $self->darkpan ? : 0 1 1
$self->no_git ? : 1 0 1
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
326 ],
327 )
328 : ()
329 ),
330  
331 'MetaYAML', # Generate META.yml (v1.4) (core)
332 'MetaJSON', # Generate META.json (vw) (core)
333 'CPANFile',
334  
335 # Build system
336 'ExecDir', # Include 'bin/*' as executables (core)
337 'ShareDir', # Include 'share/' for File::ShareDir (core)
338 [ 'MakeMaker' => { eumm_version => '6.17' } ], # Create Makefile.PL (core)
339  
340 # Copy files from build back to root for inclusion in VCS
341 [ CopyFilesFromBuild => { copy => 'cpanfile', } ],
342  
343 # Manifest (after all generated files)
344 'Manifest', # Create MANIFEST (core)
345  
346 # Before release
347 (
348 $self->no_git
349 ? ()
350 : [ 'Git::Check' => { allow_dirty => [qw/dist.ini Changes cpanfile README.pod/] } ]
351 # Ensure all files checked in
352 ),
353 'CheckMetaResources', # Ensure META has 'resources' data
354 'CheckPrereqsIndexed', # Ensure prereqs are on CPAN
355 'CheckChangesHasContent', # Ensure Changes has been updated
356 'CheckExtraTests', # Ensure xt/tests pass
357 'TestRelease', # Ensure t/ tests pass (core)
358 'ConfirmRelease', # Prompt before uploading (core)
359  
360 # Release
361 ( $self->fake_release || $self->darkpan ? 'FakeRelease' : 'UploadToCPAN' ),
362 # Upload to CPAN (core)
363  
364 # After release
365  
366 [ 'NextRelease' => { format => '%-9v %{yyyy-MM-dd}d' } ],
367  
368 (
369 $self->no_git
370 ? ()
371 : (
372 [ 'Git::Commit' =>
373 { allow_dirty => [qw/dist.ini Changes README.pod cpanfile/] } ],
374 # Commit Changes
375 [
376 'Git::Tag' => {
377 tag_format => $self->tag_format,
378 tag_message => 'Version %v'
379 }
380 ],
381 # Tag repo with custom tag
382 [ 'Git::Push' => { push_to => \@push_to } ],
383 # Push repo to remote
384 )
385 ),
386  
387 );
388  
389 }
390  
391 2 __PACKAGE__->meta->make_immutable;
392  
393 2 1;
394  
395 # ABSTRACT: Dist::Zilla configuration the way ODYNIEC does it
396 #
397 # This file is part of Dist-Zilla-PluginBundle-ODYNIEC
398 #
399 # This software is Copyright (c) 2014 by Michal Wojciechowski.
400 #
401 # This is free software, licensed under:
402 #
403 # The Apache License, Version 2.0, January 2004
404 #
405  
406 __END__
↑ Summary Pod/Weaver/PluginBundle/ODYNIEC.pm »