File Coverage

lib/Dist/Zilla/PluginBundle/Author/JMASLAK.pm
Criterion Covered Total %
statement 131 219 59.8
branch 0 24 0.0
condition n/a
subroutine 44 54 81.4
pod 0 1 0.0
total 175 298 58.7


line stmt bran cond sub pod time code
1             #!/usr/bin/perl
2              
3             #
4             # Copyright (C) 2018,2020-2021 Joelle Maslak
5             # All Rights Reserved - See License
6             #
7              
8 1     1   122712 use v5.14;
  1         4  
9 1     1   6 use strict;
  1         5  
  1         21  
10 1     1   4 use warnings;
  1         1  
  1         64  
11              
12             package Dist::Zilla::PluginBundle::Author::JMASLAK;
13             # ABSTRACT: JMASLAK's Plugin Bundle
14             $Dist::Zilla::PluginBundle::Author::JMASLAK::VERSION = '1.231930';
15              
16 1     1   615 use Moose;
  1         540821  
  1         7  
17 1     1   10185 use Dist::Zilla;
  1         1310049  
  1         77  
18              
19             with 'Dist::Zilla::Role::PluginBundle::Easy';
20              
21             # For auto plugins
22             AUTOPLUG: {
23 1     1   700 use Dist::Zilla::Plugin::AutoVersion;
  1         75752  
  1         50  
24 1     1   672 use Dist::Zilla::Plugin::NextRelease;
  1         120667  
  1         51  
25 1     1   561 use Dist::Zilla::Plugin::AutoPrereqs;
  1         294116  
  1         45  
26 1     1   688 use Dist::Zilla::Plugin::ContributorCovenant;
  1         192838  
  1         39  
27 1     1   559 use Dist::Zilla::Plugin::ExecDir;
  1         54919  
  1         36  
28 1     1   521 use Dist::Zilla::Plugin::ExtraTests;
  1         29146  
  1         35  
29 1     1   582 use Dist::Zilla::Plugin::GatherDir;
  1         89590  
  1         37  
30 1     1   506 use Dist::Zilla::Plugin::GenerateFile::FromShareDir;
  1         376550  
  1         41  
31 1     1   549 use Dist::Zilla::Plugin::GitHub::Meta;
  1         199232  
  1         45  
32 1     1   607 use Dist::Zilla::Plugin::License;
  1         34524  
  1         36  
33 1     1   494 use Dist::Zilla::Plugin::ManifestSkip;
  1         31093  
  1         33  
34 1     1   502 use Dist::Zilla::Plugin::MetaJSON;
  1         43336  
  1         35  
35 1     1   531 use Dist::Zilla::Plugin::MetaProvides::Package;
  1         351417  
  1         49  
36 1     1   643 use Dist::Zilla::Plugin::MetaYAML;
  1         36646  
  1         44  
37 1     1   700 use Dist::Zilla::Plugin::PkgVersion;
  1         78612  
  1         41  
38 1     1   618 use Dist::Zilla::Plugin::PodSyntaxTests;
  1         61022  
  1         33  
39 1     1   524 use Dist::Zilla::Plugin::PodWeaver;
  1         1228541  
  1         45  
40 1     1   546 use Dist::Zilla::Plugin::PruneCruft;
  1         53282  
  1         53  
41 1     1   500 use Dist::Zilla::Plugin::ShareDir;
  1         45649  
  1         36  
42 1     1   517 use Dist::Zilla::Plugin::ReadmeAnyFromPod;
  1         109887  
  1         56  
43 1     1   807 use Dist::Zilla::Plugin::Test::ChangesHasContent;
  1         91059  
  1         44  
44 1     1   575 use Dist::Zilla::Plugin::Test::EOL;
  1         90617  
  1         49  
45 1     1   593 use Dist::Zilla::Plugin::Test::Kwalitee;
  1         87642  
  1         49  
46 1     1   657 use Dist::Zilla::Plugin::Test::NoTabs;
  1         84588  
  1         48  
47 1     1   667 use Dist::Zilla::Plugin::Test::ReportPrereqs;
  1         74570  
  1         37  
48 1     1   538 use Dist::Zilla::Plugin::Test::TrailingSpace;
  1         46741  
  1         38  
49 1     1   505 use Dist::Zilla::Plugin::Test::UnusedVars;
  1         58943  
  1         38  
50 1     1   568 use Dist::Zilla::Plugin::Test::UseAllModules;
  1         29606  
  1         36  
51 1     1   562 use Dist::Zilla::Plugin::Test::Version;
  1         95801  
  1         53  
52              
53 1     1   735 use Dist::Zilla::Plugin::MakeMaker;
  1         183511  
  1         50  
54 1     1   630 use Dist::Zilla::Plugin::Manifest;
  1         103806  
  1         48  
55              
56 1     1   614 use Dist::Zilla::Plugin::CopyFilesFromBuild;
  1         59416  
  1         42  
57 1     1   550 use Dist::Zilla::Plugin::ConfirmRelease;
  1         39942  
  1         42  
58 1     1   532 use Dist::Zilla::Plugin::TestRelease;
  1         30875  
  1         39  
59 1     1   571 use Dist::Zilla::Plugin::UploadToCPAN;
  1         129794  
  1         64  
60              
61 1     1   607 use Dist::Zilla::Plugin::Git::Check;
  1         269127  
  1         41  
62 1     1   578 use Dist::Zilla::Plugin::Git::Commit;
  1         107365  
  1         40  
63 1     1   495 use Dist::Zilla::Plugin::Git::Push;
  1         71481  
  1         46  
64 1     1   601 use Dist::Zilla::Plugin::Git::Tag;
  1         93423  
  1         976  
65             }
66              
67             sub configure {
68 0     0 0   my ($self) = (@_);
69              
70 0           $self->add_plugins( $self->_contributing_plugin() );
71 0           $self->add_plugins( $self->_copy_files_from_build() );
72 0           $self->add_plugins( $self->_covenant_plugin() );
73 0           $self->add_plugins( $self->_mailmap_plugin() );
74 0           $self->add_plugins( $self->_manifestskip_plugin() );
75 0           $self->add_plugins( $self->_todo_plugin() );
76 0           $self->add_plugins( $self->_travis_plugin() );
77              
78 0           $self->add_plugins('AutoVersion');
79 0           $self->add_plugins('NextRelease');
80 0           $self->add_plugins('AutoPrereqs');
81 0           $self->add_plugins('ContributorCovenant');
82 0           $self->add_plugins('ExecDir');
83 0           $self->add_plugins('ExtraTests');
84 0           $self->add_plugins('GatherDir');
85 0           $self->add_plugins('GitHub::Meta');
86 0           $self->add_plugins('License');
87 0           $self->add_plugins('ManifestSkip');
88 0           $self->add_plugins('MetaJSON');
89 0           $self->add_plugins('MetaProvides::Package');
90 0           $self->add_plugins('MetaYAML');
91 0           $self->add_plugins('PkgVersion');
92 0           $self->add_plugins('PodSyntaxTests');
93 0           $self->add_plugins('PodWeaver');
94 0           $self->add_plugins('PruneCruft');
95 0           $self->add_plugins('ShareDir');
96 0           $self->add_plugins( [ 'ReadmeAnyFromPod' => { type => 'pod', filename => 'README.pod' } ] );
97 0           $self->add_plugins('Test::ChangesHasContent');
98 0           $self->add_plugins('Test::EOL');
99 0           $self->add_plugins('Test::Kwalitee');
100 0           $self->add_plugins('Test::NoTabs');
101 0           $self->add_plugins('Test::ReportPrereqs');
102 0           $self->add_plugins(
103             [ 'Test::TrailingSpace' => { filename_regex => '\.($?:ini|pl|pm|t|txt)\z' } ] );
104 0           $self->add_plugins('Test::UnusedVars');
105 0           $self->add_plugins('Test::UseAllModules');
106 0           $self->add_plugins('Test::Version');
107              
108 0           $self->add_plugins('MakeMaker');
109 0           $self->add_plugins('Manifest');
110              
111 0           $self->add_plugins('ConfirmRelease');
112 0           $self->add_plugins('TestRelease');
113 0           $self->add_plugins('UploadToCPAN');
114              
115 0           $self->add_plugins(
116             [ 'Git::Check', => { allow_dirty => [ 'dist.ini', _changes_file(), 'README.pod' ] } ] );
117 0           $self->add_plugins(
118             [ 'Git::Commit', => { allow_dirty => [ 'dist.ini', _changes_file(), 'README.pod' ] } ] );
119 0           $self->add_plugins('Git::Push');
120 0           $self->add_plugins('Git::Tag');
121              
122 0           return;
123             }
124              
125             sub _copy_files_from_build {
126 0     0     my $self = shift;
127              
128 0           my (@files) = ('README.pod');
129              
130 0 0         if ( !-e 'CODE_OF_CONDUCT.md' ) {
131 0           push @files, 'CODE_OF_CONDUCT.md';
132             }
133              
134             return [
135 0           'CopyFilesFromBuild' => {
136             copy => [@files],
137             }
138             ];
139             }
140              
141             sub _changes_file {
142 0 0   0     if ( -f 'Changes' ) { return 'Changes'; }
  0            
143 0 0         if ( -f 'CHANGES' ) { return 'CHANGES'; }
  0            
144 0 0         if ( -f 'ChangeLog' ) { return 'ChangeLog'; }
  0            
145 0 0         if ( -f 'CHANGELOG' ) { return 'CHANGELOG'; }
  0            
146              
147 0           return 'Changes';
148             }
149              
150             sub _changes_plugin {
151 0     0     my $self = shift;
152              
153 0 0         if ( -f _changes_file() ) { return; }
  0            
154              
155             return [
156 0           'GenerateFile::FromShareDir' => 'Generate Changes' => {
157             -dist => ( __PACKAGE__ =~ s/::/-/gr ),
158             -filename => 'Changes',
159             -location => 'root',
160             },
161             ];
162             }
163              
164             # Ruthlessly stolen from DROLSKY
165             sub _contributing_plugin {
166 0     0     my $self = shift;
167              
168 0 0         if ( -f 'CONTRIBUTING' ) { return; }
  0            
169              
170             return [
171 0           'GenerateFile::FromShareDir' => 'Generate CONTRIBUTING' => {
172             -dist => ( __PACKAGE__ =~ s/::/-/gr ),
173             -filename => 'CONTRIBUTING',
174             -location => 'root',
175             },
176             ];
177             }
178              
179             sub _covenant_plugin {
180 0     0     my $self = shift;
181              
182 0 0         if ( -f 'AUTHOR_PLEDGE' ) { return; }
  0            
183              
184             return [
185 0           'GenerateFile::FromShareDir' => 'Generate AUTHOR_PLEDGE' => {
186             -dist => ( __PACKAGE__ =~ s/::/-/gr ),
187             -filename => 'AUTHOR_PLEDGE',
188             -location => 'root',
189             },
190             ];
191             }
192              
193             sub _mailmap_plugin {
194 0     0     my $self = shift;
195              
196 0 0         if ( -f '.mailmap' ) { return; }
  0            
197              
198             return [
199 0           'GenerateFile::FromShareDir' => 'Generate .mailmap' => {
200             -dist => ( __PACKAGE__ =~ s/::/-/gr ),
201             -filename => '.mailmap',
202             -source_filename => 'mailmap',
203             -location => 'root',
204             },
205             ];
206             }
207              
208             sub _manifestskip_plugin {
209 0     0     my $self = shift;
210              
211 0 0         if ( -f 'MANIFEST.SKIP' ) { return; }
  0            
212              
213             return [
214 0           'GenerateFile::FromShareDir' => 'Generate MANIFEST.SKIP' => {
215             -dist => ( __PACKAGE__ =~ s/::/-/gr ),
216             -filename => 'MANIFEST.SKIP',
217             -location => 'root',
218             },
219             ];
220             }
221              
222             sub _travis_plugin {
223 0     0     my $self = shift;
224              
225 0 0         if ( -f '.travis.yml' ) { return; }
  0            
226              
227             return [
228 0           'GenerateFile::FromShareDir' => 'Generate .travis.yml' => {
229             -dist => ( __PACKAGE__ =~ s/::/-/gr ),
230             -filename => '.travis.yml',
231             -source_filename => 'travis.yml',
232             -location => 'root',
233             },
234             ];
235             }
236              
237             sub _todo_plugin {
238 0     0     my $self = shift;
239              
240 0 0         if ( -f 'TODO' ) { return; }
  0            
241              
242             return [
243 0           'GenerateFile::FromShareDir' => 'Generate TODO' => {
244             -dist => ( __PACKAGE__ =~ s/::/-/gr ),
245             -filename => 'TODO',
246             -source_filename => 'TODO',
247             -location => 'root',
248             },
249             ];
250             }
251              
252             __PACKAGE__->meta->make_immutable;
253              
254             1;
255              
256             __END__
257              
258             =pod
259              
260             =encoding UTF-8
261              
262             =head1 NAME
263              
264             Dist::Zilla::PluginBundle::Author::JMASLAK - JMASLAK's Plugin Bundle
265              
266             =head1 VERSION
267              
268             version 1.231930
269              
270             =head1 DESCRIPTION
271              
272             This is Joelle Maslak's plugin bundle, used for her modules. If you're not
273             her, you probably want to create your own plugin module because I may modify
274             this module based on her needs, breaking third party modules that use this.
275              
276             All of the following are in this module as of v1.181840.
277              
278             It is somewhat equivilent to:
279              
280             [AutoVersion]
281             [NextRelease]
282             [AutoPrereqs]
283             [ConfirmRelease]
284             [ContributorCovenant]
285              
286             [CopyFilesFromBuild]
287             copy = 'README.pod'
288              
289             [ExecDir]
290             [ExtraTests]
291             [GatherDir]
292             [GitHub::Meta]
293             [License]
294             [Manifest]
295             [ManifestSkip]
296             [Makemaker]
297             [MetaJSON]
298             [MetaProvides::Package]
299             [MetaYAML]
300             [PkgVersion]
301             [PodSyntaxTests]
302             [PodWeaver]
303             [PruneCruft]
304             [ShareDir]
305              
306             [ReadmeAnyFromPod]
307             type = markdown
308             filename = README.md
309              
310             [Test::ChangesHasContent]
311             [Test::EOL]
312             [Test::Kwalitee]
313             [Test::NoTabs]
314             [Test::ReportPrereqs]
315              
316             [Test::TrailingSpace]
317             filename_regex = '\.($?:ini|pl|pm|t|txt)\z'
318              
319             [Test::UnusedVars]
320             [Test::UseAllModules]
321             [Test::Version]
322             [TestRelease]
323             [UploadToCPAN]
324              
325             [Git::Check]
326             allow_dirty = dist.ini
327             allow_dirty = Changes
328             allow_dirty = README.pod
329              
330             [Git::Commit]
331             allow_dirty = dist.ini
332             allow_dirty = Changes
333             allow_dirty = README.pod
334              
335             [Git::Push]
336             [Git::Tag]
337              
338             This automatically numbers releases.
339              
340             This creates a C<CODE_OF_CONDUCT.md> from the awesome Contributor Covenant
341             project, a C<Changes> file, a C<CONTRIBUTING> file, a C<TODO> file,
342             a C<MANIFEST_SKIP> file, an C<AUTHOR_PLEDGE> file that indicates CPAN admins
343             can take ownership should the project become abandoned, and a C<.travis.yml>
344             file that will probably need to be edited. If these files exist already, they
345             will not get overwritten.
346              
347             It also generates a C<.mailmap> base file suitable for Joelle, if one does
348             not already exists.
349              
350             =head1 USAGE
351              
352             In your C<dist.ini> -
353              
354             [@Filter]
355             -bundle = @Author::JMASLAK
356             -version = 0.003
357              
358             The C<-version> option should specify the latest version required and tested
359             with a given package.
360              
361             =head1 SEE ALSO
362              
363             Core Dist::Zilla plugins:
364              
365             Dist::Zilla roles:
366             L<PluginBundle|Dist::Zilla::Role::PluginBundle>,
367             L<PluginBundle::Easy|Dist::Zilla::Role::PluginBundle::Easy>.
368              
369             =head1 AUTHOR
370              
371             Joelle Maslak <jmaslak@antelope.net>
372              
373             =head1 COPYRIGHT AND LICENSE
374              
375             This software is copyright (c) 2018,2020-2023 by Joelle Maslak.
376              
377             This is free software; you can redistribute it and/or modify it under
378             the same terms as the Perl 5 programming language system itself.
379              
380             =cut