File Coverage

blib/lib/Dist/Zilla/PluginBundle/Author/CJM.pm
Criterion Covered Total %
statement 22 22 100.0
branch 2 4 50.0
condition 1 2 50.0
subroutine 4 4 100.0
pod 0 2 0.0
total 29 34 85.2


line stmt bran cond sub pod time code
1             #---------------------------------------------------------------------
2             package Dist::Zilla::PluginBundle::Author::CJM;
3             #
4             # Copyright 2011 Christopher J. Madsen
5             #
6             # Author: Christopher J. Madsen <perl@cjmweb.net>
7             # Created: 19 Oct 2011
8             #
9             # This program is free software; you can redistribute it and/or modify
10             # it under the same terms as Perl itself.
11             #
12             # This program is distributed in the hope that it will be useful,
13             # but WITHOUT ANY WARRANTY; without even the implied warranty of
14             # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either the
15             # GNU General Public License or the Artistic License for more details.
16             #
17             # ABSTRACT: Build a distribution like CJM
18             #---------------------------------------------------------------------
19              
20             our $VERSION = '4.36';
21             # This file is part of Dist-Zilla-PluginBundle-Author-CJM 4.36 (September 5, 2015)
22              
23 2     2   742018 use Moose;
  2         483277  
  2         15  
24             with 'Dist::Zilla::Role::PluginBundle::Easy';
25              
26              
27             sub configure
28             {
29 1     1 0 6 my $self = shift;
30              
31 1         34 my $arg = $self->payload;
32              
33             $self->add_plugins('VersionFromModule')
34 1 50       12 unless $arg->{manual_version};
35              
36             $self->add_plugins(
37             qw(
38             GatherDir
39             PruneCruft
40             ManifestSkip
41             MetaJSON
42             MetaYAML
43             License
44             Test::PrereqsFromMeta
45             PodSyntaxTests
46             PodCoverageTests
47             ),
48             [PodLoom => {
49             data => 'tools/loom.pl',
50 1         8 %{ $self->config_slice({
51             pod_finder => 'finder',
52             pod_template => 'template',
53             }) },
54             } ],
55             # either MakeMaker or ModuleBuild:
56             [ ($arg->{builder} || 'MakeMaker') =>
57             scalar $self->config_slice(qw( eumm_version mb_version mb_class ))
58             ],
59             qw(
60             RunExtraTests
61             MetaConfig
62             MatchManifest
63             ),
64             [ RecommendedPrereqs => scalar $self->config_slice({
65             check_recommend => 'finder',
66             check_recommend_tests => 'test_finder',
67             }) ],
68             [ CheckPrereqsIndexed => scalar $self->config_slice({
69             skip_index_check => 'skips'
70             }) ],
71             [ GitVersionCheckCJM => scalar $self->config_slice({
72             single_version => 'single_version',
73             check_files => 'finder'
74             }) ],
75             [ TemplateCJM => {
76             date_format => 'MMMM d, y',
77 1   50     115 %{$self->config_slice(
  1         254  
78             'changelog_re',
79             { pod_finder => 'finder',
80             template_date_format => 'date_format',
81             template_file => 'file',
82             })},
83             } ],
84             [ Repository => { git_remote => 'github' } ],
85             );
86              
87 1         540 $self->add_bundle(Git => {
88             allow_dirty => 'Changes',
89             commit_msg => 'Updated Changes for %{MMMM d, yyyy}d%{ trial}t release of %v',
90             tag_format => '%v%t',
91             tag_message => 'Tagged %N %v%{ (trial release)}t',
92             push_to => 'github master',
93             });
94              
95 1         706158 $self->add_plugins(
96             'TestRelease',
97             'UploadToCPAN',
98             [ ArchiveRelease => { directory => 'cjm_releases' } ],
99             );
100              
101 1 50       167 if (my $remove = $arg->{remove_plugin}) {
102 1         35 my $prefix = $self->name . '/';
103 1         8 my %remove = map { $prefix . $_ => 1 } @$remove;
  1         7  
104 1         34 my $plugins = $self->plugins;
105 1         6 @$plugins = grep { not $remove{$_->[0]} } @$plugins;
  27         120  
106             }
107             } # end configure
108              
109 1     1 0 258 sub mvp_multivalue_args { qw(check_files check_recommend check_recommend_tests
110             remove_plugin
111             pod_finder skip_index_check template_file) }
112              
113 2     2   13464 no Moose;
  2         5  
  2         9  
114             __PACKAGE__->meta->make_immutable;
115             1;
116              
117             __END__
118              
119             =head1 NAME
120              
121             Dist::Zilla::PluginBundle::Author::CJM - Build a distribution like CJM
122              
123             =head1 VERSION
124              
125             This document describes version 4.36 of
126             Dist::Zilla::PluginBundle::Author::CJM, released September 5, 2015.
127              
128             =head1 SYNOPSIS
129              
130             In dist.ini:
131              
132             [@Author::CJM / CJM]
133              
134             =head1 DESCRIPTION
135              
136             This is the plugin bundle that CJM uses. It is equivalent to:
137              
138             [VersionFromModule]
139              
140             [GatherDir]
141             [PruneCruft]
142             [ManifestSkip]
143             [MetaJSON]
144             [MetaYAML]
145             [License]
146             [Test::PrereqsFromMeta]
147             [PodSyntaxTests]
148             [PodCoverageTests]
149             [PodLoom]
150             data = tools/loom.pl
151             [MakeMaker]
152             [RunExtraTests]
153             [MetaConfig]
154             [MatchManifest]
155             [RecommendedPrereqs]
156             [CheckPrereqsIndexed]
157             [GitVersionCheckCJM]
158             [TemplateCJM]
159              
160             [Repository]
161             git_remote = github
162              
163             [@Git]
164             allow_dirty = Changes
165             commit_msg = Updated Changes for %{MMMM d, yyyy}d%{ trial}t release of %v
166             tag_format = %v%t
167             tag_message = Tagged %N %v%{ (trial release)}t
168             push_to = github master
169              
170             [TestRelease]
171             [UploadToCPAN]
172             [ArchiveRelease]
173             directory = cjm_releases
174              
175             =head1 ATTRIBUTES
176              
177             =head2 builder
178              
179             Use the specified plugin instead of MakeMaker.
180              
181              
182             =head2 changelog_re
183              
184             Passed to TemplateCJM.
185              
186              
187             =head2 check_files
188              
189             Passed to GitVersionCheckCJM as its C<finder>.
190              
191              
192             =head2 check_recommend
193              
194             Passed to RecommendedPrereqs as its C<finder>.
195              
196              
197             =head2 check_recommend_tests
198              
199             Passed to RecommendedPrereqs as its C<test_finder>.
200              
201              
202             =head2 eumm_version
203              
204             Passed to MakeMaker (or its replacement C<builder>).
205              
206              
207             =head2 manual_version
208              
209             If true, VersionFromModule is omitted.
210              
211              
212             =head2 mb_class
213              
214             Passed to MakeMaker (or its replacement C<builder>).
215              
216              
217             =head2 mb_version
218              
219             Passed to MakeMaker (or its replacement C<builder>).
220              
221              
222             =head2 pod_finder
223              
224             Passed to both PodLoom and TemplateCJM as their C<finder>.
225              
226              
227             =head2 pod_template
228              
229             Passed to PodLoom as its C<template>.
230              
231              
232             =head2 remove_plugin
233              
234             The named plugin is removed from the bundle (may be specified multiple
235             times). This exists because you can't pass multi-value parameters
236             through L<@Filter|Dist::Zilla::PluginBundle::Filter>.
237              
238              
239             =head2 single_version
240              
241             Passed to GitVersionCheckCJM.
242              
243              
244             =head2 skip_index_check
245              
246             Passed to CheckPrereqsIndexed as its C<skips>.
247              
248              
249             =head2 template_date_format
250              
251             Passed to TemplateCJM as its C<date_format>. Defaults to C<MMMM d, y>.
252              
253              
254             =head2 template_file
255              
256             Passed to TemplateCJM as its C<file>.
257              
258             =for Pod::Coverage
259             configure
260             mvp_multivalue_args
261              
262             =head1 CONFIGURATION AND ENVIRONMENT
263              
264             Dist::Zilla::PluginBundle::Author::CJM requires no configuration files or environment variables.
265              
266             =head1 INCOMPATIBILITIES
267              
268             None reported.
269              
270             =head1 BUGS AND LIMITATIONS
271              
272             No bugs have been reported.
273              
274             =head1 AUTHOR
275              
276             Christopher J. Madsen S<C<< <perl AT cjmweb.net> >>>
277              
278             Please report any bugs or feature requests
279             to S<C<< <bug-Dist-Zilla-PluginBundle-Author-CJM AT rt.cpan.org> >>>
280             or through the web interface at
281             L<< http://rt.cpan.org/Public/Bug/Report.html?Queue=Dist-Zilla-PluginBundle-Author-CJM >>.
282              
283             You can follow or contribute to Dist-Zilla-PluginBundle-Author-CJM's development at
284             L<< https://github.com/madsen/dist-zilla-pluginbundle-cjm >>.
285              
286             =head1 COPYRIGHT AND LICENSE
287              
288             This software is copyright (c) 2015 by Christopher J. Madsen.
289              
290             This is free software; you can redistribute it and/or modify it under
291             the same terms as the Perl 5 programming language system itself.
292              
293             =head1 DISCLAIMER OF WARRANTY
294              
295             BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
296             FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
297             OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
298             PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
299             EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
300             WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
301             ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
302             YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
303             NECESSARY SERVICING, REPAIR, OR CORRECTION.
304              
305             IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
306             WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
307             REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE
308             LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL,
309             OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
310             THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
311             RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
312             FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
313             SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
314             SUCH DAMAGES.
315              
316             =cut