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   118788 use v5.14;
  1         5  
9 1     1   6 use strict;
  1         1  
  1         22  
10 1     1   4 use warnings;
  1         3  
  1         67  
11              
12             package Dist::Zilla::PluginBundle::Author::JMASLAK;
13             # ABSTRACT: JMASLAK's Plugin Bundle
14             $Dist::Zilla::PluginBundle::Author::JMASLAK::VERSION = '1.210880';
15              
16 1     1   654 use Moose;
  1         512725  
  1         9  
17 1     1   9165 use Dist::Zilla;
  1         1229206  
  1         71  
18              
19             with 'Dist::Zilla::Role::PluginBundle::Easy';
20              
21             # For auto plugins
22             AUTOPLUG: {
23 1     1   734 use Dist::Zilla::Plugin::AutoVersion;
  1         74232  
  1         48  
24 1     1   700 use Dist::Zilla::Plugin::NextRelease;
  1         118229  
  1         52  
25 1     1   719 use Dist::Zilla::Plugin::AutoPrereqs;
  1         282351  
  1         50  
26 1     1   749 use Dist::Zilla::Plugin::ContributorCovenant;
  1         193975  
  1         51  
27 1     1   673 use Dist::Zilla::Plugin::ExecDir;
  1         54736  
  1         44  
28 1     1   639 use Dist::Zilla::Plugin::ExtraTests;
  1         29544  
  1         34  
29 1     1   659 use Dist::Zilla::Plugin::GatherDir;
  1         88565  
  1         45  
30 1     1   674 use Dist::Zilla::Plugin::GenerateFile::FromShareDir;
  1         380350  
  1         47  
31 1     1   618 use Dist::Zilla::Plugin::GitHub::Meta;
  1         203096  
  1         47  
32 1     1   677 use Dist::Zilla::Plugin::License;
  1         35328  
  1         62  
33 1     1   635 use Dist::Zilla::Plugin::ManifestSkip;
  1         32347  
  1         43  
34 1     1   621 use Dist::Zilla::Plugin::MetaJSON;
  1         44810  
  1         50  
35 1     1   710 use Dist::Zilla::Plugin::MetaProvides::Package;
  1         351407  
  1         52  
36 1     1   693 use Dist::Zilla::Plugin::MetaYAML;
  1         35256  
  1         40  
37 1     1   625 use Dist::Zilla::Plugin::PkgVersion;
  1         75511  
  1         49  
38 1     1   618 use Dist::Zilla::Plugin::PodSyntaxTests;
  1         60871  
  1         43  
39 1     1   637 use Dist::Zilla::Plugin::PodWeaver;
  1         1243408  
  1         47  
40 1     1   700 use Dist::Zilla::Plugin::PruneCruft;
  1         52943  
  1         54  
41 1     1   673 use Dist::Zilla::Plugin::ShareDir;
  1         46909  
  1         48  
42 1     1   687 use Dist::Zilla::Plugin::ReadmeAnyFromPod;
  1         109304  
  1         49  
43 1     1   735 use Dist::Zilla::Plugin::Test::ChangesHasContent;
  1         90708  
  1         48  
44 1     1   729 use Dist::Zilla::Plugin::Test::EOL;
  1         90844  
  1         51  
45 1     1   716 use Dist::Zilla::Plugin::Test::Kwalitee;
  1         90834  
  1         50  
46 1     1   715 use Dist::Zilla::Plugin::Test::NoTabs;
  1         86143  
  1         55  
47 1     1   731 use Dist::Zilla::Plugin::Test::ReportPrereqs;
  1         74739  
  1         41  
48 1     1   633 use Dist::Zilla::Plugin::Test::TrailingSpace;
  1         47249  
  1         47  
49 1     1   604 use Dist::Zilla::Plugin::Test::UnusedVars;
  1         55333  
  1         45  
50 1     1   700 use Dist::Zilla::Plugin::Test::UseAllModules;
  1         30940  
  1         45  
51 1     1   610 use Dist::Zilla::Plugin::Test::Version;
  1         97627  
  1         54  
52              
53 1     1   761 use Dist::Zilla::Plugin::MakeMaker;
  1         179680  
  1         55  
54 1     1   670 use Dist::Zilla::Plugin::Manifest;
  1         103685  
  1         49  
55              
56 1     1   722 use Dist::Zilla::Plugin::CopyFilesFromBuild;
  1         58300  
  1         50  
57 1     1   664 use Dist::Zilla::Plugin::ConfirmRelease;
  1         40043  
  1         45  
58 1     1   626 use Dist::Zilla::Plugin::TestRelease;
  1         31202  
  1         64  
59 1     1   618 use Dist::Zilla::Plugin::UploadToCPAN;
  1         130899  
  1         53  
60              
61 1     1   705 use Dist::Zilla::Plugin::Git::Check;
  1         265522  
  1         45  
62 1     1   644 use Dist::Zilla::Plugin::Git::Commit;
  1         106487  
  1         49  
63 1     1   678 use Dist::Zilla::Plugin::Git::Push;
  1         73661  
  1         47  
64 1     1   705 use Dist::Zilla::Plugin::Git::Tag;
  1         93778  
  1         943  
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.210880
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-2021 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