blib/lib/Dist/Zilla/PluginBundle/Apocalyptic.pm

filter: Statementstmt 88.1% 126 / 143 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 97.5% 40 / 41 Podpod 0.0% 0 / 1 totaltotal 85.1% 166 / 195 CC 7 SCAR 22.2
CC
7
Cov
82%
configure
56.0
BEGIN
1.0
BEGIN
1.0
CRAP 9.2
↑ Summary
1 #
2 # This file is part of Dist-Zilla-PluginBundle-Apocalyptic
3 #
4 # This software is copyright (c) 2014 by Apocalypse.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 1 ▶use strict; use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
10 package Dist::Zilla::PluginBundle::Apocalyptic;
11 # git description: release-0.004-3-g7f6133e
12 1 $Dist::Zilla::PluginBundle::Apocalyptic::VERSION = '0.005';
13 1 our $AUTHORITY = 'cpan:APOCAL';
14  
15 # ABSTRACT: Let the apocalypse build your dist!
16  
17 1 ▶use Moose 1.21;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 # The plugins we use ( excluding ones bundled in dzil )
20 1 with 'Dist::Zilla::Role::PluginBundle::Easy' => { -version => '5.011' }; # basically sets the dzil version
21 1 ▶use Pod::Weaver::PluginBundle::Apocalyptic 0.002;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 1 ▶use Dist::Zilla::Plugin::Test::Compile 1.112820;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 1 ▶use Dist::Zilla::Plugin::ApocalypseTests 0.01;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 1 ▶use Dist::Zilla::Plugin::Prepender 1.101590;
Subroutine BEGIN: called CC=1 SCAR=0.0
25 1 ▶use Dist::Zilla::Plugin::Authority 1.001;
Subroutine BEGIN: called CC=1 SCAR=0.0
26 1 ▶use Dist::Zilla::Plugin::PodWeaver 3.101641;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 1 ▶use Dist::Zilla::Plugin::ChangelogFromGit 0.002;
Subroutine BEGIN: called CC=1 SCAR=0.0
28 1 ▶use Dist::Zilla::Plugin::MinimumPerl 1.001;
Subroutine BEGIN: called CC=1 SCAR=0.0
29 1 ▶use Dist::Zilla::Plugin::MetaProvides::Package 1.12044908;
Subroutine BEGIN: called CC=1 SCAR=0.0
30 1 ▶use Dist::Zilla::Plugin::Bugtracker 1.102670;
Subroutine BEGIN: called CC=1 SCAR=0.0
31 1 ▶use Dist::Zilla::Plugin::Homepage 1.101420;
Subroutine BEGIN: called CC=1 SCAR=0.0
32 1 ▶use Dist::Zilla::Plugin::Repository 0.16;
Subroutine BEGIN: called CC=1 SCAR=0.0
33 1 ▶use Dist::Zilla::Plugin::InstallGuide 1.101461;
Subroutine BEGIN: called CC=1 SCAR=0.0
34 1 ▶use Dist::Zilla::Plugin::Signature 1.100930;
Subroutine BEGIN: called CC=1 SCAR=0.0
35 1 ▶use Dist::Zilla::Plugin::CheckChangesHasContent 0.003;
Subroutine BEGIN: called CC=1 SCAR=0.0
36 1 ▶use Dist::Zilla::Plugin::Git 1.110500;
Subroutine BEGIN: called CC=1 SCAR=0.0
37 1 ▶use Dist::Zilla::Plugin::ArchiveRelease 3.01;
Subroutine BEGIN: called CC=1 SCAR=0.0
38 1 ▶use Dist::Zilla::Plugin::ReportVersions::Tiny 1.02;
Subroutine BEGIN: called CC=1 SCAR=0.0
39 1 ▶use Dist::Zilla::Plugin::MetaData::BuiltWith 0.01018204;
Subroutine BEGIN: called CC=1 SCAR=0.0
40 1 ▶use Dist::Zilla::Plugin::Clean 0.002;
Subroutine BEGIN: called CC=1 SCAR=0.0
41 1 ▶use Dist::Zilla::Plugin::LocaleMsgfmt 1.203;
Subroutine BEGIN: called CC=1 SCAR=0.0
42 1 ▶use Dist::Zilla::Plugin::CheckPrereqsIndexed 0.007;
Subroutine BEGIN: called CC=1 SCAR=0.0
43 1 ▶use Dist::Zilla::Plugin::DOAP 0.002;
Subroutine BEGIN: called CC=1 SCAR=0.0
44 1 ▶use Dist::Zilla::Plugin::Covenant 0.1.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
45 1 ▶use Dist::Zilla::Plugin::CheckIssues 0.002;
Subroutine BEGIN: called CC=1 SCAR=0.0
46 1 ▶use Dist::Zilla::Plugin::SchwartzRatio 0.2.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
47 1 ▶use Dist::Zilla::Plugin::CheckSelfDependency 0.007;
Subroutine BEGIN: called CC=1 SCAR=0.0
48 1 ▶use Dist::Zilla::Plugin::Git::Describe 0.003;
Subroutine BEGIN: called CC=1 SCAR=0.0
49 1 ▶use Dist::Zilla::Plugin::ReportPhase; # TODO we wanted to specify 0.03 but it's weird version stanza blows up! RT#99769
Subroutine BEGIN: called CC=1 SCAR=0.0
50 1 ▶use Dist::Zilla::Plugin::ReadmeAnyFromPod 0.142470;
Subroutine BEGIN: called CC=1 SCAR=0.0
51 1 ▶use Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch 0.011;
Subroutine BEGIN: called CC=1 SCAR=0.0
52 1 ▶use Dist::Zilla::Plugin::Git::Remote::Check 0.1.2;
Subroutine BEGIN: called CC=1 SCAR=0.0
53 1 ▶use Dist::Zilla::Plugin::PromptIfStale 0.028;
Subroutine BEGIN: called CC=1 SCAR=0.0
54 1 ▶use Dist::Zilla::Plugin::ModuleBuildTiny 0.007;
Subroutine BEGIN: called CC=1 SCAR=0.0
55 1 ▶use Dist::Zilla::Plugin::MakeMaker::Fallback 0.013;
Subroutine BEGIN: called CC=1 SCAR=0.0
56 1 ▶use Dist::Zilla::Plugin::Git::Contributors 0.008;
Subroutine BEGIN: called CC=1 SCAR=0.0
57  
58 # Allow easier config manipulation
59 1 with qw(
60 Dist::Zilla::Role::PluginBundle::Config::Slicer
61 Dist::Zilla::Role::PluginBundle::PluginRemover
62 );
63  
64 0 ▶sub configure {
Subroutine configure: not called CC=7 SCAR=40.3
Pod undocumented
65 0 my $self = shift;
66  
67 # ; -- Report the phases as a debugging aid
68 # TODO should this module automatically figure it out? if so, go make a pull req!
69 0 ▶ if ( join( ' ', @ARGV ) =~ /--verbose/i ) {
Branch: 1 branch
BranchTrueFalseTotal
if (join(" ", @ARGV) =~ /--verbose/i) 0 0 0
70 0 $self->add_plugins( [ 'ReportPhase' => 'ENTER' ] );
71 }
72  
73 # ; -- start off by bumping the version
74 $self->add_plugins(
75 [
76 0 'Git::NextVersion' => {
77 'version_regexp' => '^release-(.+)$',
78 }
79 ],
80  
81 # ; -- import our files from the git root
82 [
83 'Git::GatherDir' => {
84 'exclude_filename' => 'README.pod',
85 },
86 ],
87  
88 # ; -- start the basic dist skeleton
89 qw(
90 PruneCruft
91 AutoPrereqs
92 ),
93 [
94 'GenerateFile', 'MANIFEST.SKIP', {
95 'filename' => 'MANIFEST.SKIP',
96 'is_template' => 1,
97 'content' => <<'EOC',
98 # Added by Dist::Zilla::PluginBundle::Apocalyptic v{{$Dist::Zilla::PluginBundle::Apocalyptic::VERSION}}
99  
100 # skip Eclipse IDE stuff
101 \.includepath$
102 \.project$
103 \.settings/
104  
105 # Avoid version control files.
106 \bRCS\b
107 \bCVS\b
108 ,v$
109 \B\.svn\b
110 \B\.git\b
111 ^\.gitignore$
112  
113 # Ignore Dist::Zilla's build dir
114 ^\.build/
115  
116 # Avoid configuration metadata file
117 ^MYMETA\.
118  
119 # Avoid Makemaker generated and utility files.
120 ^Makefile$
121 ^blib/
122 ^MakeMaker-\d
123 \bpm_to_blib$
124 ^blibdirs$
125  
126 # Avoid Module::Build generated and utility files.
127 \bBuild$
128 \bBuild.bat$
129 \b_build
130 \bBuild.COM$
131 \bBUILD.COM$
132 \bbuild.com$
133  
134 # Avoid temp and backup files.
135 ~$
136 \.old$
137 \#$
138 ^\.#
139 \.bak$
140  
141 # our tarballs
142 \.tar\.gz$
143 ^releases/
144 EOC
145 }
146 ],
147 [
148 'ManifestSkip' => {
149 'skipfile' => 'MANIFEST.SKIP',
150 }
151 ],
152  
153 # ; -- Generate our tests
154 [
155 'Test::Compile' => {
156 # fake the $ENV{HOME} in case smokers don't like us
157 'fake_home' => 1,
158 }
159 ],
160 qw(
161 ApocalypseTests
162 ReportVersions::Tiny
163 ),
164  
165 # ; -- munge files
166 [
167 'Prepender' => {
168 'copyright' => 1,
169 'line' => 'use strict; use warnings;',
170 }
171 ],
172 qw(
173 Authority
174 Git::Describe
175 PkgVersion
176 ),
177 [
178 'PodWeaver' => {
179 'config_plugin' => '@Apocalyptic',
180 'replacer' => 'replace_with_comment',
181 'post_code_replacer' => 'replace_with_nothing',
182 }
183 ],
184 [
185 'LocaleMsgfmt' => {
186 'locale' => 'share/locale',
187 },
188 ],
189  
190 # ; -- update the Changelog
191 [
192 'NextRelease' => {
193 'time_zone' => 'UTC',
194 'filename' => 'Changes',
195 'format' => '%v%t%{yyyy-MM-dd HH:mm:ss VVVV}d',
196 }
197 ],
198 [
199 'ChangelogFromGit' => {
200 'tag_regexp' => '^release-(.+)$',
201 'file_name' => 'CommitLog',
202 }
203 ],
204 );
205  
206 # ; -- generate/process meta-information
207 0 ▶ if ( -d 'bin' ) {
Branch: 1 branch
BranchTrueFalseTotal
if (-d "bin") 0 0 0
208 0 $self->add_plugins( [ 'ExecDir' => {
209 'dir' => 'bin',
210 } ] );
211 }
212 0 ▶ if ( -d 'share' ) {
Branch: 1 branch
BranchTrueFalseTotal
if (-d "share") 0 0 0
213 0 $self->add_plugins( [ 'ShareDir' => {
214 'dir' => 'bin',
215 } ] );
216 }
217 $self->add_plugins(
218 0 qw(
219 MinimumPerl
220 Bugtracker
221 Homepage
222 MetaConfig
223 Git::Contributors
224 ),
225 [
226 'MetaData::BuiltWith' => {
227 'show_uname' => 1,
228 'uname_args' => '-s -r -m',
229 }
230 ],
231 [
232 'Repository' => {
233 # TODO convert "origin" to "github"
234 # TODO actually use gitorious!
235 'git_remote' => 'origin',
236 }
237 ],
238 [
239 'MetaResources' => {
240 # TODO add the usual list of stuff found in my POD? ( cpants, bla bla )
241 'license' => 'http://dev.perl.org/licenses/',
242 }
243 ],
244 );
245  
246 # ; -- generate meta files
247 0 my @dirs;
248 0 foreach my $d ( qw( inc t xt examples share eg mylib ) ) {
249 0 ▶ push( @dirs, $d ) if -d $d;
Branch: 1 branch
BranchTrueFalseTotal
if -d $d 0 0 0
250 }
251 $self->add_plugins(
252 [
253 0 'MetaNoIndex' => {
254 'directory' => \@dirs,
255 }
256 ],
257 [
258 'MetaProvides::Package' => { # needs to be added after MetaNoIndex
259 # don't report the noindex directories
260 'meta_noindex' => 1,
261 }
262 ],
263 qw(
264 License
265 ModuleBuildTiny
266 MakeMaker::Fallback
267 ),
268 qw(
269 MetaYAML
270 MetaJSON
271 InstallGuide
272 DOAP
273 Covenant
274 CPANFile
275 ),
276 );
277  
278 # ; -- special stuff for README files
279 # we want README and README.pod but only include README in the built tarball and use README.pod in the root of the project!
280 0 $self->add_plugins(
281 'ReadmeAnyFromPod',
282 [
283 'ReadmeAnyFromPod', 'pod for github' => {
284 'type' => 'pod',
285 'location' => 'root',
286 'phase' => 'release',
287 },
288 ],
289 [
290 'Signature' => {
291 'sign' => 'always',
292 }
293 ],
294 qw(
295 Manifest
296 ),
297  
298 # ; -- pre-release
299 [
300 'CheckChangesHasContent' => {
301 'changelog' => 'Changes',
302 }
303 ],
304 [
305 'Git::Check' => {
306 'changelog' => 'Changes',
307 'allow_dirty' => [ 'README.pod', 'Changes' ], # TODO Changes shouldn't be in here but if I don't add it as allow_dirty it doesn't get committed!
308 }
309 ],
310  
311 # ; -- sanity-check our git stuff
312 # TODO we need to fix Git::CheckFor::Fixups so it uses the version_regexp!
313 qw(
314 Git::CheckFor::CorrectBranch
315 ) );
316 0 $self->add_plugins( [ 'Git::CheckFor::MergeConflicts' => {
317 'ignore' => 'CommitLog',
318 } ],
319 qw(
320 Git::Remote::Check
321 ),
322  
323 # ; -- more sanity tests before confirming
324 [
325 'PromptIfStale' => {
326 'check_authordeps' => 1,
327 'check_all_plugins' => 1,
328 'check_all_prereqs' => 1,
329 'phase' => 'release',
330 'fatal' => 1,
331 },
332 ],
333 qw(
334 TestRelease
335 CheckPrereqsIndexed
336 CheckSelfDependency
337 CheckIssues
338 ConfirmRelease
339 ),
340  
341 # ; -- release
342 qw(
343 UploadToCPAN
344 ),
345  
346 # ; -- post-release
347 [
348 'ArchiveRelease' => {
349 'directory' => 'releases',
350 }
351 ],
352 [
353 'Git::Commit' => {
354 'changelog' => 'Changes',
355 'commit_msg' => 'New CPAN release of %N - v%v%n%n%c',
356 'time_zone' => 'UTC',
357 'add_files_in' => 'releases',
358 'allow_dirty' => [ 'README.pod', 'Changes' ], # TODO Changes shouldn't be in here but if I don't add it as allow_dirty it doesn't get committed!
359 }
360 ],
361 [
362 'Git::Tag' => {
363 'tag_format' => 'release-%v',
364 'tag_message' => 'Tagged release-%v',
365 }
366 ],
367 [
368 'Git::Push' => {
369 # TODO add "github", "gitorious" support somehow... introspect the Git config?
370 'push_to' => 'origin',
371 }
372 ],
373 qw(
374 Clean
375 SchwartzRatio
376 ),
377 );
378  
379 0 ▶ if ( join( ' ', @ARGV ) =~ /--verbose/i ) {
Branch: 1 branch
BranchTrueFalseTotal
if (join(" ", @ARGV) =~ /--verbose/i) 0 0 0
380 0 $self->add_plugins( [ 'ReportPhase' => 'LEAVE' ] );
381 }
382 }
383  
384 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
385 1 __PACKAGE__->meta->make_immutable;
386 1 1;
387  
388 __END__
↑ Summary