File Coverage

blib/lib/Dist/Zilla/PluginBundle/BioPerl.pm
Criterion Covered Total %
statement 31 31 100.0
branch n/a
condition 1 3 33.3
subroutine 8 8 100.0
pod 0 2 0.0
total 40 44 90.9


line stmt bran cond sub pod time code
1             package Dist::Zilla::PluginBundle::BioPerl;
2             $Dist::Zilla::PluginBundle::BioPerl::VERSION = '0.25';
3 1     1   1959606 use utf8;
  1         1  
  1         7  
4              
5             # ABSTRACT: Build your distributions like Bioperl does
6             # AUTHOR: Florian Ragwitz <rafl@debian.org>
7             # AUTHOR: Sheena Scroggins
8             # AUTHOR: Carnë Draug <carandraug+dev@gmail.com>
9             # AUTHOR: Chris Fields <cjfields1@gmail.com>
10             # OWNER: 2010 Florian Ragwitz
11             # OWNER: 2011 Sheena Scroggins
12             # OWNER: 2013-2017 Carnë Draug
13             # LICENSE: Perl_5
14              
15 1     1   32 use Moose 1.00;
  1         21  
  1         7  
16 1     1   4689 use MooseX::AttributeShortcuts;
  1         127146  
  1         3  
17 1     1   24745 use MooseX::Types::Email qw(EmailAddress);
  1         117548  
  1         10  
18 1     1   1302 use MooseX::Types::Moose qw(ArrayRef Bool Str);
  1         2  
  1         6  
19 1     1   3262 use namespace::autoclean;
  1         2  
  1         6  
20              
21             with qw(
22             Dist::Zilla::Role::PluginBundle::Easy
23             Dist::Zilla::Role::PluginBundle::PluginRemover
24             Dist::Zilla::Role::PluginBundle::Config::Slicer
25             );
26              
27              
28              
29             sub get_value {
30 6     6 0 10 my ($self, $accessor) = @_;
31 6         23 my %defaults = (
32             'homepage' => 'https://metacpan.org/release/%{dist}',
33             'repository.github' => 'user:bioperl',
34             'bugtracker.github' => 'user:bioperl',
35             'bugtracker.mailto' => 'bioperl-l@bioperl.org',
36             'trailing_whitespace' => 1,
37             'allow_dirty' => ['Changes', 'dist.ini'],
38             );
39 6   33     145 return $self->payload->{$accessor} || $defaults{$accessor};
40             }
41              
42             has homepage => (
43             is => 'lazy',
44             isa => Str,
45             default => sub { shift->get_value('homepage') }
46             );
47              
48             has repository_github => (
49             is => 'lazy',
50             isa => Str,
51             default => sub { shift->get_value('repository.github') }
52             );
53              
54             has bugtracker_github => (
55             is => 'lazy',
56             isa => Str,
57             default => sub { shift->get_value('bugtracker.github') }
58             );
59              
60             has bugtracker_mailto => (
61             is => 'lazy',
62             isa => EmailAddress,
63             default => sub { shift->get_value('bugtracker.mailto') }
64             );
65              
66             has trailing_whitespace => (
67             is => 'lazy',
68             isa => Bool,
69             default => sub { shift->get_value('trailing_whitespace') }
70             );
71              
72              
73             sub mvp_multivalue_args { qw( allow_dirty ) }
74             has allow_dirty => (
75             is => 'lazy',
76             isa => ArrayRef,
77             default => sub { shift->get_value('allow_dirty') }
78             );
79              
80              
81             sub configure {
82 1     1 0 5 my $self = shift;
83              
84 1         9 $self->add_bundle('@Filter' => {
85             '-bundle' => '@Basic',
86             '-remove' => ['Readme'],
87             });
88              
89 1         42969 $self->add_plugins(qw(
90             MetaConfig
91             MetaJSON
92             PkgVersion
93             PodSyntaxTests
94             Test::NoTabs
95             Test::Compile
96             PodCoverageTests
97             MojibakeTests
98             AutoPrereqs
99             ));
100              
101 1         211 my @allow_dirty;
102 1         3 foreach (@{$self->allow_dirty}) {
  1         50  
103 2         4 push (@allow_dirty, 'allow_dirty', $_);
104             }
105              
106             $self->add_plugins(
107 1         32 [AutoMetaResources => [
108             'repository.github' => $self->repository_github,
109             'homepage' => $self->homepage,
110             'bugtracker.github' => $self->bugtracker_github,
111             ]],
112             [MetaResources => [
113             'bugtracker.mailto' => $self->bugtracker_mailto,
114             ]],
115             ['Test::EOL' => {
116             trailing_whitespace => $self->trailing_whitespace,
117             }],
118             [PodWeaver => {
119             config_plugin => '@BioPerl',
120             }],
121             );
122              
123 1         121 $self->add_plugins(qw(
124             NextRelease
125             ));
126              
127 1         73 $self->add_plugins(
128             ['Git::Check' => [
129             @allow_dirty,
130             ]],
131             ['Git::Commit' => [
132             @allow_dirty,
133             ]],
134             ['Git::Tag' => [
135             tag_format => '%N-v%v',
136             tag_message => '%N-v%v',
137             ]],
138             );
139             }
140              
141             __PACKAGE__->meta->make_immutable;
142             1;
143              
144             __END__
145              
146             =pod
147              
148             =encoding UTF-8
149              
150             =head1 NAME
151              
152             Dist::Zilla::PluginBundle::BioPerl - Build your distributions like Bioperl does
153              
154             =head1 VERSION
155              
156             version 0.25
157              
158             =head1 SYNOPSIS
159              
160             # dist.ini
161             name = Dist-Zilla-Plugin-BioPerl
162             ...
163              
164             [@BioPerl]
165              
166             =head1 DESCRIPTION
167              
168             This is the L<Dist::Zilla> configuration for the BioPerl project. It is roughly
169             equivalent to:
170              
171             [@Filter]
172             -bundle = @Basic ; the basic to maintain and release CPAN distros
173             -remove = Readme ; avoid conflict since we already have a README file
174              
175             [MetaConfig] ; summarize Dist::Zilla configuration on distribution
176             [MetaJSON] ; produce a META.json
177             [PkgVersion] ; add a $version to the modules
178             [PodSyntaxTests] ; create a release test for Pod syntax
179             [Test::NoTabs] ; create a release tests making sure hard tabs aren't used
180             [Test::Compile] ; test syntax of all modules
181             [PodCoverageTests] ; create release test for Pod coverage
182             [MojibakeTests] ; create release test for correct encoding
183             [AutoPrereqs] ; automatically find the dependencies
184              
185             [AutoMetaResources] ; automatically fill resources fields on metadata
186             repository.github = user:bioperl
187             bugtracker.github = user:bioperl
188             homepage = https://metacpan.org/release/${dist}
189              
190             [MetaResources] ; fill resources fields on metadata
191             bugtracker.mailto = bioperl-l@bioperl.org
192              
193             [Test::EOL] ; create release tests for correct line endings
194             trailing_whitespace = 1
195              
196             [PodWeaver]
197             config_plugin = @BioPerl
198              
199             [NextRelease] ; update release number on Changes file
200             [Git::Check] ; check working path for any uncommitted stuff
201             allow_dirty = Changes
202             allow_dirty = dist.ini
203             [Git::Commit] ; commit the dzil-generated stuff
204             allow_dirty = Changes
205             allow_dirty = dist.ini
206             [Git::Tag] ; tag our new release
207             tag_format = %N-v%v
208             tag_message = %N-v%v
209              
210             In addition, this also has two roles, L<Dist::Zilla::PluginBundle::PluginRemover> and
211             Dist::Zilla::PluginBundle::Config::Slice, so one could do something like this for
212             problematic distributions:
213              
214             [@BioPerl]
215             -remove = MojibakeTests
216             -remove = PodSyntaxTests
217              
218             =head1 Pushing releases
219              
220             With this PluginBundle, there's a lot of things happening
221             automatically. It might not be clear what actually needs to be done
222             and what will be done automatically unless you are already familiar
223             with all the plugins being used. Assuming that F<Changes> is up
224             to date (you should be updating F<Changes> as the changes are made
225             and not when preparing a release. If you need to add notes to that
226             file, then do it do it at the same time you bump the version number in
227             F<dist.ini>), the following steps will make a release:
228              
229             =over 4
230              
231             =item 1
232              
233             Make sure the working directory is clean with `git status'.
234              
235             =item 2
236              
237             Run `dzil test --all'
238              
239             =item 3
240              
241             Edit dist.ini to bump the version number only.
242              
243             =item 4
244              
245             Run `dzil release'
246              
247             =item 5
248              
249             Run `git push --tags'
250              
251             =back
252              
253             These steps will automatically do the following:
254              
255             =over 4
256              
257             =item *
258              
259             Modify F<Changes> with the version number and time of release.
260              
261             =item *
262              
263             Make a git commit with the changes to F<Changes> and F<dist.ini> using a standard commit message.
264              
265             =item *
266              
267             Add a lightweight git tag for the release.
268              
269             =item *
270              
271             Run the tests (including a series of new tests for maintainers only) and push release to CPAN.
272              
273             =back
274              
275             =head1 CONFIGURATION
276              
277             Use the L<Dist::Zilla::PluginBundle::Filter> to filter any undesired plugin
278             that is part of the default set. This also allows to change those plugins
279             default values. However, the BioPerl bundle already recognizes some of the
280             plugins options and will pass it to the corresponding plugin. If any is missing,
281             please consider patching this bundle.
282              
283             In some cases, this bundle will also perform some sanity checks before passing
284             the value to the original plugin.
285              
286             =over 4
287              
288             =item *
289              
290             homepage
291              
292             Same option used by the L<Dist::Zilla::Plugin::AutoMetaResources>
293              
294             =item *
295              
296             repository.github
297              
298             Same option used by the L<Dist::Zilla::Plugin::AutoMetaResources>
299              
300             =item *
301              
302             bugtracker.github
303              
304             Same option used by the L<Dist::Zilla::Plugin::AutoMetaResources>
305              
306             =item *
307              
308             bugtracker.mailto
309              
310             Same option used by the L<Dist::Zilla::Plugin::MetaResources>
311              
312             =item *
313              
314             trailing_whitespace
315              
316             Same option used by the L<Dist::Zilla::Plugin::EOLTests>
317              
318             =item *
319              
320             allow_dirty
321              
322             Same option used by the L<Dist::Zilla::Plugin::Git::Commit> and
323             L<Dist::Zilla::Plugin::Git::Check>
324              
325             =back
326              
327             =for Pod::Coverage get_value
328              
329             =for Pod::Coverage mvp_multivalue_args
330              
331             =for Pod::Coverage configure
332              
333             =head1 FEEDBACK
334              
335             =head2 Mailing lists
336              
337             User feedback is an integral part of the evolution of this and other
338             Bioperl modules. Send your comments and suggestions preferably to
339             the Bioperl mailing list. Your participation is much appreciated.
340              
341             bioperl-l@bioperl.org - General discussion
342             http://bioperl.org/Support.html - About the mailing lists
343              
344             =head2 Support
345              
346             Please direct usage questions or support issues to the mailing list:
347             I<bioperl-l@bioperl.org>
348              
349             rather than to the module maintainer directly. Many experienced and
350             reponsive experts will be able look at the problem and quickly
351             address it. Please include a thorough description of the problem
352             with code and data examples if at all possible.
353              
354             =head2 Reporting bugs
355              
356             Report bugs to the Bioperl bug tracking system to help us keep track
357             of the bugs and their resolution. Bug reports can be submitted via the
358             web:
359              
360             https://github.com/bioperl/dist-zilla-pluginbundle-bioperl/issues
361              
362             =head1 AUTHORS
363              
364             Florian Ragwitz <rafl@debian.org>
365              
366             Sheena Scroggins
367              
368             Carnë Draug <carandraug+dev@gmail.com>
369              
370             Chris Fields <cjfields1@gmail.com>
371              
372             =head1 COPYRIGHT
373              
374             This software is copyright (c) 2010 by Florian Ragwitz, 2011 by Sheena Scroggins, and 2013-2017 by Carnë Draug.
375              
376             This software is available under the same terms as the perl 5 programming language system itself.
377              
378             =cut