File Coverage

blib/lib/Minilla/Release/RewriteChanges.pm
Criterion Covered Total %
statement 12 18 66.6
branch 0 2 0.0
condition n/a
subroutine 4 5 80.0
pod 0 1 0.0
total 16 26 61.5


line stmt bran cond sub pod time code
1             package Minilla::Release::RewriteChanges;
2 1     1   954 use strict;
  1         2  
  1         28  
3 1     1   6 use warnings;
  1         5  
  1         31  
4 1     1   5 use utf8;
  1         11  
  1         4  
5 1     1   25 use Minilla::Util qw(slurp_raw spew_raw);
  1         2  
  1         201  
6              
7             sub run {
8 0     0 0   my ($self, $project, $opts) = @_;
9 0 0         return if $opts->{dry_run};
10              
11 0           my $content = slurp_raw('Changes');
12 0           $content =~ s!\{\{\$NEXT\}\}!
13 0           "{{\$NEXT}}\n\n" . $project->version . " " . $project->work_dir->changes_time->strftime('%Y-%m-%dT%H:%M:%SZ')
14             !e;
15 0           spew_raw('Changes' => $content);
16             }
17              
18              
19             1;
20