| 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
| |||||||||||
| 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__ | ||||||||||