File Coverage

blib/lib/Module/Changes/Formatter/YAML.pm
Criterion Covered Total %
statement 21 21 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 1 1 100.0
total 28 28 100.0


line stmt bran cond sub pod time code
1             package Module::Changes::Formatter::YAML;
2              
3 2     2   1628 use warnings;
  2         4  
  2         69  
4 2     2   9 use strict;
  2         6  
  2         60  
5 2     2   1661 use YAML;
  2         15925  
  2         187  
6 2     2   1870 use DateTime::Format::W3CDTF;
  2         1721  
  2         28  
7              
8              
9             our $VERSION = '0.05';
10              
11              
12 2     2   84 use base 'Module::Changes::Formatter';
  2         6  
  2         1063  
13              
14              
15             sub format {
16 1     1 1 9 my ($self, $changes) = @_;
17              
18 1         8 my %format = ( global => { name => $changes->name } );
19              
20 1         16 for my $release ($changes->releases) {
21 1         15 push @{ $format{releases} } => {
  1         9  
22             version => $release->version_as_string,
23             date => DateTime::Format::W3CDTF->new->format_datetime(
24             $release->date
25             ),
26             author => $release->author,
27             changes => scalar($release->changes),
28             tags => scalar($release->tags),
29             };
30             }
31              
32 1         178 Dump \%format;
33             }
34              
35              
36             1;
37              
38             __END__