Dist/Zilla/PluginBundle/MMCCLIMON.pm untested

filter: Statementstmt 0.0% 0 / 72 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 12 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 106 CC 4 SCAR 21.5
CC
4
Cov
0%
configure
20.0
mvp_multivalue_args
2.0
BEGIN
2.0
CRAP 8.5
1 package Dist::Zilla::PluginBundle::MMCCLIMON;
2 # ABSTRACT: BeLike::MMCCLIMON when you build your dists
3 $Dist::Zilla::PluginBundle::MMCCLIMON::VERSION = '5.013';
4 use Moose;
5 use Dist::Zilla 2.100922; # TestRelease
6 with
7 'Dist::Zilla::Role::PluginBundle::Easy',
8 'Dist::Zilla::Role::PluginBundle::PluginRemover' => { -version => '0.103' },
9 'Dist::Zilla::Role::PluginBundle::Config::Slicer';
10  
11 #pod =head1 DESCRIPTION
12 #pod
13 #pod This is the plugin bundle that MMCCLIMON uses. It is stolen directly from RJBS,
14 #pod with some things removed and a few others added.
15 #pod
16 #pod It is more or less equivalent to:
17 #pod
18 #pod [Git::GatherDir]
19 #pod [@Basic]
20 #pod ; ...but without GatherDir and ExtraTests and MakeMaker
21 #pod
22 #pod [MakeMaker]
23 #pod default_jobs = 9
24 #pod
25 #pod [AutoPrereqs]
26 #pod [Git::NextVersion]
27 #pod [PkgVersion]
28 #pod die_on_existing_version = 1
29 #pod die_on_line_insertion = 1
30 #pod [MetaConfig]
31 #pod [MetaJSON]
32 #pod [NextRelease]
33 #pod
34 #pod [Test::ChangesHasContent]
35 #pod [PodSyntaxTests]
36 #pod [Test::ReportPrereqs]
37 #pod
38 #pod [PodWeaver]
39 #pod config_plugin = @MMCCLIMON
40 #pod
41 #pod [GithubMeta]
42 #pod remote = github
43 #pod remote = origin
44 #pod
45 #pod [@Git]
46 #pod tag_format = %v
47 #pod
48 #pod [Git::Contributors]
49 #pod
50 #pod [CPANFile]
51 #pod
52 #pod [CopyFilesFromBuild]
53 #pod copy = Makefile.PL
54 #pod copy = LICENSE
55 #pod copy = cpanfile
56 #pod
57 #pod [Git::GatherDir]
58 #pod exclude_filename = Makefile.PL
59 #pod exclude_filename = LICENSE
60 #pod exclude_filename = cpanfile
61 #pod
62 #pod If the C<manual_version> argument is given, AutoVersion is omitted.
63 #pod
64 #pod If the C<github_issues> argument is given, and true, the F<META.*> files will
65 #pod point to GitHub issues for the dist's bugtracker.
66 #pod
67 #pod This bundle makes use of L<Dist::Zilla::Role::PluginBundle::PluginRemover> and
68 #pod L<Dist::Zilla::Role::PluginBundle::Config::Slicer> to allow further customization.
69 #pod
70 #pod =cut
71  
72 use Dist::Zilla::PluginBundle::Basic;
73 use Dist::Zilla::PluginBundle::Filter;
74 use Dist::Zilla::PluginBundle::Git;
75  
76 has manual_version => (
77 is => 'ro',
78 isa => 'Bool',
79 lazy => 1,
80 default => sub { $_[0]->payload->{manual_version} },
81 );
82  
83 has major_version => (
84 is => 'ro',
85 isa => 'Int',
86 lazy => 1,
87 default => sub { $_[0]->payload->{version} || 0 },
88 );
89  
90 has github_issues => (
91 is => 'ro',
92 isa => 'Bool',
93 lazy => 1,
94 default => sub { $_[0]->payload->{github_issues} // 1 },
95 );
96  
97 has homepage => (
98 is => 'ro',
99 isa => 'Str',
100 lazy => 1,
101 default => sub { $_[0]->payload->{homepage} // '' },
102 );
103  
104 has weaver_config => (
105 is => 'ro',
106 isa => 'Str',
107 lazy => 1,
108 default => sub { $_[0]->payload->{weaver_config} || '@MMCCLIMON' },
109 );
110  
111 sub mvp_multivalue_args { qw(dont_compile) }
112  
113 has dont_compile => (
114 is => 'ro',
115 isa => 'ArrayRef[Str]',
116 lazy => 1,
117 default => sub { $_[0]->payload->{dont_compile} || [] },
118 );
119  
120 has package_name_version => (
121 is => 'ro',
122 isa => 'Bool',
123 lazy => 1,
124 default => sub { $_[0]->payload->{package_name_version} // 0 },
125 );
126  
127 sub configure {
128 my ($self) = @_;
129  
130 my @filenames = qw(
131 Makefile.PL
132 LICENSE
133 cpanfile
134 );
135  
136 $self->add_plugins([ 'Git::GatherDir' => { exclude_filename => \@filenames }]);
137 $self->add_plugins('CheckPrereqsIndexed');
138 $self->add_plugins('CheckExtraTests');
139 $self->add_plugins(
140 [ PromptIfStale => 'MMCCLIMON-Outdated' => {
141 phase => 'build',
142 module => 'Dist::Zilla::PluginBundle::MMCCLIMON',
143 } ],
144 [ PromptIfStale => 'CPAN-Outdated' => {
145 phase => 'release',
146 check_all_plugins => 1,
147 } ],
148 );
149 $self->add_bundle('@Filter', {
150 '-bundle' => '@Basic',
151 '-remove' => [ 'GatherDir', 'ExtraTests', 'MakeMaker' ],
152 });
153  
154 $self->add_plugins([ MakeMaker => { default_jobs => 9 } ]);
155  
156 $self->add_plugins('AutoPrereqs');
157  
158 $self->add_plugins('CPANFile');
159 $self->add_plugins([ 'CopyFilesFromBuild' => { copy => \@filenames } ]);
160  
161 unless ($self->manual_version) {
162 $self->add_plugins([
163 'Git::NextVersion' => {
164 version_regexp => '^([0-9]+\.[0-9]+)$',
165 version_by_branch => 1,
166 }
167 ]);
168 }
169  
170 $self->add_plugins(
171 [
172 PkgVersion => {
173 die_on_existing_version => 1,
174 die_on_line_insertion => 1,
175 ($self->package_name_version ? (use_package => 1) : ()),
176 },
177 ],
178 qw(
179 MetaConfig
180 MetaJSON
181 NextRelease
182 Test::ChangesHasContent
183 PodSyntaxTests
184 Test::ReportPrereqs
185 ),
186 );
187  
188 $self->add_plugins(
189 [ Prereqs => 'TestMoreWithSubtests' => {
190 -phase => 'test',
191 -type => 'requires',
192 'Test::More' => '0.96'
193 } ],
194 );
195  
196 $self->add_plugins([
197 PodWeaver => {
198 config_plugin => $self->weaver_config,
199 replacer => 'replace_with_comment',
200 }
201 ]);
202  
203 $self->add_plugins(
204 [ GithubMeta => {
205 remote => [ qw(gitbox github upstream michael) ],
206 issues => $self->github_issues,
207 (length $self->homepage ? (homepage => $self->homepage) : ()),
208 } ],
209 );
210  
211 $self->add_bundle('@Git' => {
212 tag_format => '%v',
213 remotes_must_exist => 0,
214 push_to => [
215 'gitbox :',
216 'michael :',
217 ],
218 });
219  
220 $self->add_plugins('Git::Contributors');
221 }
222  
223 __PACKAGE__->meta->make_immutable;
224 no Moose;
225 1;
226  
227 __END__