File Coverage

blib/lib/Dist/Zilla/Plugin/ChangesFromYaml.pm
Criterion Covered Total %
statement 13 13 100.0
branch 2 2 100.0
condition n/a
subroutine 4 4 100.0
pod 0 1 0.0
total 19 20 95.0


line stmt bran cond sub pod time code
1             package Dist::Zilla::Plugin::ChangesFromYaml;
2             # ABSTRACT: convert Changes from YAML to CPAN::Changes::Spec format
3             our $VERSION = '0.001'; # TRIAL VERSION
4              
5 1     1   2687276 use Moose;
  1         1  
  1         6  
6             with( 'Dist::Zilla::Role::FileMunger' );
7 1     1   4177 use namespace::autoclean;
  1         2  
  1         9  
8 1     1   423 use Dist::Zilla::Plugin::ChangesFromYaml::Convert qw(convert);
  1         1  
  1         109  
9              
10             sub munge_file {
11 7     7 0 80844 my ($self, $file) = @_;
12              
13 7 100       14 return unless $file->name eq 'Changes';
14              
15 1         30 $file->content( convert( $file->content ) );
16 1         1073 $self->log_debug(
17             [
18             'Converte Changes from YAML to CPAN::Changes::Spec', $file->name
19             ]
20             );
21             }
22              
23             __PACKAGE__->meta->make_immutable;
24             1;
25              
26             __END__
27              
28             =head1 SYNOPSIS
29              
30             In your 'dist.ini':
31              
32             [ChangesFromYaml]
33              
34             =head1 DESCRIPTION
35              
36             This module lets you keep your Changes file in YAML format:
37              
38             version: 0.37
39             date: Fri Oct 25 21:46:59 MYT 2013
40             changes:
41             - 'Bugfix: Run Test::Compile tests as xt as they require optional dependencies to be present (GH issue #22)'
42             - 'Testing: Added Travis-CI integration'
43             - 'Makefile: Added target to update version on all packages'
44              
45             and during build converts it to CPAN::Changes::Spec format
46              
47             0.37 Fri Oct 25 21:46:59 MYT 2013
48             - Bugfix: Run Test::Compile tests as xt as they require optional
49             dependencies to be present (GH issue #22)
50             - Testing: Added Travis-CI integration
51             - Makefile: Added target to update version on all packages
52              
53             =head1 AUTHOR
54              
55             Carlos Lima <carlos@cpan.org>
56              
57             =cut