Changes.pm

filter: Statementstmt 66.6% 18 / 27 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 1 totaltotal 62.8% 22 / 35 CC 2 SCAR 9.8
CC
2
Cov
62%
gather_files
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.7
« GitIgnore.pm ↑ Summary
1 package Dist::Zilla::Plugin::Changes;
2 1 $Dist::Zilla::Plugin::Changes::VERSION = '0.003';
3 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 with qw/Dist::Zilla::Role::FileGatherer/;
5 1 ▶use MooseX::Types::Moose qw/Str Int/;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use experimental 'signatures';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 has filename => (
12 is => 'ro',
13 isa => Str,
14 default => 'Changes',
15 );
16  
17 1 has initial => (
18 is => 'ro',
19 isa => Str,
20 predicate => 'has_initial',
21 );
22  
23 1 has indent => (
24 is => 'ro',
25 isa => Int,
26 default => 10, # [NextRelease]
27 );
28  
29 0 ▶sub gather_files($self) {
Subroutine gather_files: not called CC=2 SCAR=17.9
Pod undocumented
30 0 my $header = "Revision history for " . $self->zilla->name;
31 0 my @lines = ($header, '', '{{$NEXT}}');
32  
33 0 ▶ if ($self->has_initial) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->has_initial) 0 0 0
34 0 my $indent = ' ' x $self->indent;
35 0 push @lines, $indent . $self->initial
36 }
37  
38 0 my $payload = join '', map { "$_\n" } @lines;
39 0 $self->add_file(Dist::Zilla::File::InMemory->new(
40 name => $self->filename,
41 content => $payload,
42 ));
43  
44 0 return;
45 }
46  
47 1 1;
48  
49 # ABSTRACT: Create a changes file
50  
51 __END__
« GitIgnore.pm ↑ Summary