lib/Dist/Zilla/PluginBundle/Author/JMASLAK.pm

filter: Statementstmt 60.4% 133 / 220 Branchbran 0.0% 0 / 24 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 81.1% 43 / 53 Podpod 0.0% 0 / 1 totaltotal 59.0% 176 / 298 CC 13 SCAR 15.0
CC
13
Cov
55%
_changes_file
30.0
_copy_files_from_build
6.0
_changes_plugin
6.0
CRAP 4.5
↑ Summary
1 #!/usr/bin/perl
2  
3 #
4 # Copyright (C) 2018,2020-2021 Joelle Maslak
5 # All Rights Reserved - See License
6 #
7  
8 1 ▶use v5.14;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 package Dist::Zilla::PluginBundle::Author::JMASLAK;
13 # ABSTRACT: JMASLAK's Plugin Bundle
14 1 $Dist::Zilla::PluginBundle::Author::JMASLAK::VERSION = '1.231931';
15  
16 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 1 ▶use Dist::Zilla;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 1 with 'Dist::Zilla::Role::PluginBundle::Easy';
20  
21 # For auto plugins
22 AUTOPLUG: {
23 1 ▶ use Dist::Zilla::Plugin::AutoVersion;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 1 ▶ use Dist::Zilla::Plugin::NextRelease;
Subroutine BEGIN: called CC=1 SCAR=0.0
25 1 ▶ use Dist::Zilla::Plugin::AutoPrereqs;
Subroutine BEGIN: called CC=1 SCAR=0.0
26 1 ▶ use Dist::Zilla::Plugin::ContributorCovenant;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 1 ▶ use Dist::Zilla::Plugin::ExecDir;
Subroutine BEGIN: called CC=1 SCAR=0.0
28 1 ▶ use Dist::Zilla::Plugin::ExtraTests;
Subroutine BEGIN: called CC=1 SCAR=0.0
29 1 ▶ use Dist::Zilla::Plugin::GatherDir;
Subroutine BEGIN: called CC=1 SCAR=0.0
30 1 ▶ use Dist::Zilla::Plugin::GenerateFile::FromShareDir;
Subroutine BEGIN: called CC=1 SCAR=0.0
31 1 ▶ use Dist::Zilla::Plugin::GitHub::Meta;
Subroutine BEGIN: called CC=1 SCAR=0.0
32 1 ▶ use Dist::Zilla::Plugin::License;
Subroutine BEGIN: called CC=1 SCAR=0.0
33 1 ▶ use Dist::Zilla::Plugin::ManifestSkip;
Subroutine BEGIN: called CC=1 SCAR=0.0
34 1 ▶ use Dist::Zilla::Plugin::MetaJSON;
Subroutine BEGIN: called CC=1 SCAR=0.0
35 1 ▶ use Dist::Zilla::Plugin::MetaProvides::Package;
Subroutine BEGIN: called CC=1 SCAR=0.0
36 1 ▶ use Dist::Zilla::Plugin::MetaYAML;
Subroutine BEGIN: called CC=1 SCAR=0.0
37 1 ▶ use Dist::Zilla::Plugin::PkgVersion;
Subroutine BEGIN: called CC=1 SCAR=0.0
38 1 ▶ use Dist::Zilla::Plugin::PodSyntaxTests;
Subroutine BEGIN: called CC=1 SCAR=0.0
39 1 ▶ use Dist::Zilla::Plugin::PodWeaver;
Subroutine BEGIN: called CC=1 SCAR=0.0
40 1 ▶ use Dist::Zilla::Plugin::PruneCruft;
Subroutine BEGIN: called CC=1 SCAR=0.0
41 1 ▶ use Dist::Zilla::Plugin::ShareDir;
Subroutine BEGIN: called CC=1 SCAR=0.0
42 1 ▶ use Dist::Zilla::Plugin::ReadmeAnyFromPod;
Subroutine BEGIN: called CC=1 SCAR=0.0
43 1 ▶ use Dist::Zilla::Plugin::Test::ChangesHasContent;
Subroutine BEGIN: called CC=1 SCAR=0.0
44 1 ▶ use Dist::Zilla::Plugin::Test::EOL;
Subroutine BEGIN: called CC=1 SCAR=0.0
45 1 ▶ use Dist::Zilla::Plugin::Test::Kwalitee;
Subroutine BEGIN: called CC=1 SCAR=0.0
46 1 ▶ use Dist::Zilla::Plugin::Test::NoTabs;
Subroutine BEGIN: called CC=1 SCAR=0.0
47 1 ▶ use Dist::Zilla::Plugin::Test::ReportPrereqs;
Subroutine BEGIN: called CC=1 SCAR=0.0
48 1 ▶ use Dist::Zilla::Plugin::Test::TrailingSpace;
Subroutine BEGIN: called CC=1 SCAR=0.0
49 1 ▶ use Dist::Zilla::Plugin::Test::UseAllModules;
Subroutine BEGIN: called CC=1 SCAR=0.0
50 1 ▶ use Dist::Zilla::Plugin::Test::Version;
Subroutine BEGIN: called CC=1 SCAR=0.0
51  
52 1 ▶ use Dist::Zilla::Plugin::MakeMaker;
Subroutine BEGIN: called CC=1 SCAR=0.0
53 1 ▶ use Dist::Zilla::Plugin::Manifest;
Subroutine BEGIN: called CC=1 SCAR=0.0
54  
55 1 ▶ use Dist::Zilla::Plugin::CopyFilesFromBuild;
Subroutine BEGIN: called CC=1 SCAR=0.0
56 1 ▶ use Dist::Zilla::Plugin::ConfirmRelease;
Subroutine BEGIN: called CC=1 SCAR=0.0
57 1 ▶ use Dist::Zilla::Plugin::TestRelease;
Subroutine BEGIN: called CC=1 SCAR=0.0
58 1 ▶ use Dist::Zilla::Plugin::UploadToCPAN;
Subroutine BEGIN: called CC=1 SCAR=0.0
59  
60 1 ▶ use Dist::Zilla::Plugin::Git::Check;
Subroutine BEGIN: called CC=1 SCAR=0.0
61 1 ▶ use Dist::Zilla::Plugin::Git::Commit;
Subroutine BEGIN: called CC=1 SCAR=0.0
62 1 ▶ use Dist::Zilla::Plugin::Git::Push;
Subroutine BEGIN: called CC=1 SCAR=0.0
63 1 ▶ use Dist::Zilla::Plugin::Git::Tag;
Subroutine BEGIN: called CC=1 SCAR=0.0
64 }
65  
66 1 ▶sub configure {
Subroutine configure: not called CC=1 SCAR=6.6
Pod undocumented
67 0 my ($self) = (@_);
68  
69 0 $self->add_plugins( $self->_contributing_plugin() );
70 0 $self->add_plugins( $self->_copy_files_from_build() );
71 0 $self->add_plugins( $self->_covenant_plugin() );
72 0 $self->add_plugins( $self->_mailmap_plugin() );
73 0 $self->add_plugins( $self->_manifestskip_plugin() );
74 0 $self->add_plugins( $self->_todo_plugin() );
75 0 $self->add_plugins( $self->_travis_plugin() );
76  
77 0 $self->add_plugins('AutoVersion');
78 0 $self->add_plugins('NextRelease');
79 0 $self->add_plugins('AutoPrereqs');
80 0 $self->add_plugins('ContributorCovenant');
81 0 $self->add_plugins('ExecDir');
82 0 $self->add_plugins('ExtraTests');
83 0 $self->add_plugins('GatherDir');
84 0 $self->add_plugins('GitHub::Meta');
85 0 $self->add_plugins('License');
86 0 $self->add_plugins('ManifestSkip');
87 0 $self->add_plugins('MetaJSON');
88 0 $self->add_plugins('MetaProvides::Package');
89 0 $self->add_plugins('MetaYAML');
90 0 $self->add_plugins('PkgVersion');
91 0 $self->add_plugins('PodSyntaxTests');
92 0 $self->add_plugins('PodWeaver');
93 0 $self->add_plugins('PruneCruft');
94 0 $self->add_plugins('ShareDir');
95 0 $self->add_plugins( [ 'ReadmeAnyFromPod' => { type => 'pod', filename => 'README.pod' } ] );
96 0 $self->add_plugins('Test::ChangesHasContent');
97 0 $self->add_plugins('Test::EOL');
98 0 $self->add_plugins('Test::Kwalitee');
99 0 $self->add_plugins('Test::NoTabs');
100 0 $self->add_plugins('Test::ReportPrereqs');
101 0 $self->add_plugins(
102 [ 'Test::TrailingSpace' => { filename_regex => '\.($?:ini|pl|pm|t|txt)\z' } ] );
103 0 $self->add_plugins('Test::UseAllModules');
104 0 $self->add_plugins('Test::Version');
105  
106 0 $self->add_plugins('MakeMaker');
107 0 $self->add_plugins('Manifest');
108  
109 0 $self->add_plugins('ConfirmRelease');
110 0 $self->add_plugins('TestRelease');
111 0 $self->add_plugins('UploadToCPAN');
112  
113 0 $self->add_plugins(
114 [ 'Git::Check', => { allow_dirty => [ 'dist.ini', _changes_file(), 'README.pod' ] } ] );
115 0 $self->add_plugins(
116 [ 'Git::Commit', => { allow_dirty => [ 'dist.ini', _changes_file(), 'README.pod' ] } ] );
117 0 $self->add_plugins('Git::Push');
118 0 $self->add_plugins('Git::Tag');
119  
120 0 return;
121 }
122  
123 0 ▶sub _copy_files_from_build {
Subroutine _copy_files_from_build: not called CC=2 SCAR=17.9
124 0 my $self = shift;
125  
126 0 my (@files) = ('README.pod');
127  
128 0 ▶ if ( !-e 'CODE_OF_CONDUCT.md' ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (-e "CODE_OF_CONDUCT.md") 0 0 0
129 0 push @files, 'CODE_OF_CONDUCT.md';
130 }
131  
132 return [
133 0 'CopyFilesFromBuild' => {
134 copy => [@files],
135 }
136 ];
137 }
138  
139 0 ▶sub _changes_file {
Subroutine _changes_file: not called CC=5 SCAR=34.0
140 0 ▶ if ( -f 'Changes' ) { return 'Changes'; }
Branch: 1 branch
BranchTrueFalseTotal
if (-f "Changes") 0 0 0
141 0 ▶ if ( -f 'CHANGES' ) { return 'CHANGES'; }
Branch: 1 branch
BranchTrueFalseTotal
if (-f "CHANGES") 0 0 0
142 0 ▶ if ( -f 'ChangeLog' ) { return 'ChangeLog'; }
Branch: 1 branch
BranchTrueFalseTotal
if (-f "ChangeLog") 0 0 0
143 0 ▶ if ( -f 'CHANGELOG' ) { return 'CHANGELOG'; }
Branch: 1 branch
BranchTrueFalseTotal
if (-f "CHANGELOG") 0 0 0
144  
145 0 return 'Changes';
146 }
147  
148 0 ▶sub _changes_plugin {
Subroutine _changes_plugin: not called CC=2 SCAR=17.9
149 0 my $self = shift;
150  
151 0 ▶ if ( -f _changes_file() ) { return; }
Branch: 1 branch
BranchTrueFalseTotal
if (-f _changes_file()) 0 0 0
152  
153 return [
154 0 'GenerateFile::FromShareDir' => 'Generate Changes' => {
155 -dist => ( __PACKAGE__ =~ s/::/-/gr ),
156 -filename => 'Changes',
157 -location => 'root',
158 },
159 ];
160 }
161  
162 # Ruthlessly stolen from DROLSKY
163 0 ▶sub _contributing_plugin {
Subroutine _contributing_plugin: not called CC=2 SCAR=17.9
164 0 my $self = shift;
165  
166 0 ▶ if ( -f 'CONTRIBUTING' ) { return; }
Branch: 1 branch
BranchTrueFalseTotal
if (-f "CONTRIBUTING") 0 0 0
167  
168 return [
169 0 'GenerateFile::FromShareDir' => 'Generate CONTRIBUTING' => {
170 -dist => ( __PACKAGE__ =~ s/::/-/gr ),
171 -filename => 'CONTRIBUTING',
172 -location => 'root',
173 },
174 ];
175 }
176  
177 0 ▶sub _covenant_plugin {
Subroutine _covenant_plugin: not called CC=2 SCAR=17.9
178 0 my $self = shift;
179  
180 0 ▶ if ( -f 'AUTHOR_PLEDGE' ) { return; }
Branch: 1 branch
BranchTrueFalseTotal
if (-f "AUTHOR_PLEDGE") 0 0 0
181  
182 return [
183 0 'GenerateFile::FromShareDir' => 'Generate AUTHOR_PLEDGE' => {
184 -dist => ( __PACKAGE__ =~ s/::/-/gr ),
185 -filename => 'AUTHOR_PLEDGE',
186 -location => 'root',
187 },
188 ];
189 }
190  
191 0 ▶sub _mailmap_plugin {
Subroutine _mailmap_plugin: not called CC=2 SCAR=17.9
192 0 my $self = shift;
193  
194 0 ▶ if ( -f '.mailmap' ) { return; }
Branch: 1 branch
BranchTrueFalseTotal
if (-f ".mailmap") 0 0 0
195  
196 return [
197 0 'GenerateFile::FromShareDir' => 'Generate .mailmap' => {
198 -dist => ( __PACKAGE__ =~ s/::/-/gr ),
199 -filename => '.mailmap',
200 -source_filename => 'mailmap',
201 -location => 'root',
202 },
203 ];
204 }
205  
206 0 ▶sub _manifestskip_plugin {
Subroutine _manifestskip_plugin: not called CC=2 SCAR=17.9
207 0 my $self = shift;
208  
209 0 ▶ if ( -f 'MANIFEST.SKIP' ) { return; }
Branch: 1 branch
BranchTrueFalseTotal
if (-f "MANIFEST.SKIP") 0 0 0
210  
211 return [
212 0 'GenerateFile::FromShareDir' => 'Generate MANIFEST.SKIP' => {
213 -dist => ( __PACKAGE__ =~ s/::/-/gr ),
214 -filename => 'MANIFEST.SKIP',
215 -location => 'root',
216 },
217 ];
218 }
219  
220 0 ▶sub _travis_plugin {
Subroutine _travis_plugin: not called CC=2 SCAR=17.9
221 0 my $self = shift;
222  
223 0 ▶ if ( -f '.travis.yml' ) { return; }
Branch: 1 branch
BranchTrueFalseTotal
if (-f ".travis.yml") 0 0 0
224  
225 return [
226 0 'GenerateFile::FromShareDir' => 'Generate .travis.yml' => {
227 -dist => ( __PACKAGE__ =~ s/::/-/gr ),
228 -filename => '.travis.yml',
229 -source_filename => 'travis.yml',
230 -location => 'root',
231 },
232 ];
233 }
234  
235 0 ▶sub _todo_plugin {
Subroutine _todo_plugin: not called CC=2 SCAR=17.9
236 0 my $self = shift;
237  
238 0 ▶ if ( -f 'TODO' ) { return; }
Branch: 1 branch
BranchTrueFalseTotal
if (-f "TODO") 0 0 0
239  
240 return [
241 0 'GenerateFile::FromShareDir' => 'Generate TODO' => {
242 -dist => ( __PACKAGE__ =~ s/::/-/gr ),
243 -filename => 'TODO',
244 -source_filename => 'TODO',
245 -location => 'root',
246 },
247 ];
248 }
249  
250 1 __PACKAGE__->meta->make_immutable;
251  
252 1 1;
253  
254 __END__
↑ Summary