File Coverage

blib/lib/Dist/Zilla/Plugin/ReversionAfterRelease.pm
Criterion Covered Total %
statement 17 17 100.0
branch 2 4 50.0
condition n/a
subroutine 5 5 100.0
pod 0 2 0.0
total 24 28 85.7


line stmt bran cond sub pod time code
1             package Dist::Zilla::Plugin::ReversionAfterRelease;
2             our $VERSION = '0.3';
3 1     1   3471154 use Moose;
  1         4  
  1         6  
4             extends 'Dist::Zilla::Plugin::ReversionOnRelease';
5             with 'Dist::Zilla::Role::AfterRelease';
6              
7             # Don't munge files before release
8       1 0   sub munge_files { }
9              
10             # Munge files after release
11             sub after_release {
12 1     1 0 205849 my $self = shift;
13 1         75 $self->SUPER::munge_files;
14 1         6400 for my $file (@{ $self->found_files }) {
  1         14  
15 1 50   1   153 open my $fh, '>:raw:encoding('.$file->encoding.')', $file->name
  1         4  
  1         28  
  1         1788  
16             or die "Can't write ".$file->name.": $!";
17 1         1791 print $fh $file->content;
18 1 50       227 close $fh
19             or die "Can't write ".$file->name.": $!";
20             }
21 1         14 return;
22             }
23              
24             __PACKAGE__->meta->make_immutable;
25 1     1   6726 no Moose;
  1         3  
  1         8  
26             1;
27             __END__
28              
29             =encoding utf-8
30              
31             =head1 NAME
32              
33             Dist::Zilla::Plugin::ReversionAfterRelease - Bump and reversion after distribution release
34              
35             =head1 SYNOPSIS
36              
37             [VersionFromModule]
38             [UploadToCPAN]
39             [CopyFilesFromRelease]
40             filename = Changes
41            
42             ; commit source files as of "dzil release" with any
43             ; allowable modifications (e.g Changes)
44             [Git::Commit / Commit_This_Release] ; commit files/Changes (as released)
45             commit_msg = Release %v
46            
47             ; tag as of "dzil release"
48             [Git::Tag]
49            
50             ; update Changes with timestamp of release
51             [NextRelease]
52            
53             [ReversionAfterRelease]
54            
55             ; commit source files after modification
56             [Git::Commit / Commit_Next_Version] ; commit Changes/version (for new dev)
57             allow_dirty =
58             allow_dirty_match =
59             commit_msg = Bump Version to %v
60              
61             =head1 DESCRIPTION
62              
63             This Dist::Zilla plugin will bump the version of your module I<after> a successful release.
64              
65             Similar to L<BumpVersionAfterRelease|Dist::Zilla::Plugin::BumpVersionAfterRelease> but uses the more permisable reversioning from L<ReversionOnRelease|Dist::Zilla::Plugin::ReversionOnRelease>.
66              
67             =head1 SEE ALSO
68              
69             Core Dist::Zilla plugins:
70             L<ReversionOnRelease|Dist::Zilla::Plugin::ReversionOnRelease>,
71             L<BumpVersionAfterRelease|Dist::Zilla::Plugin::BumpVersionAfterRelease>.
72            
73             Dist::Zilla roles:
74             L<AfterRelease|Dist::Zilla::Plugin::AfterRelease>,
75             L<FileMunger|Dist::Zilla::Role::FileMunger>.
76              
77             =head1 AUTHOR
78              
79             Vernon Lyon E<lt>vlyon@cpan.orgE<gt>
80              
81             =head1 COPYRIGHT
82              
83             Copyright 2018 Vernon Lyon
84              
85             =head1 LICENSE
86              
87             This library is free software; you can redistribute it and/or modify
88             it under the same terms as Perl itself.
89              
90             =cut