docs for ::Init

releases
Yanick Champoux 2022-07-25 11:55:42 -04:00
parent 0fa5f2a9a4
commit 3b4c019dcc
1 changed files with 3 additions and 7 deletions

View File

@ -12,13 +12,9 @@ use List::AllUtils qw/ first min uniq /;
use Version::Dotted::Semantic; use Version::Dotted::Semantic;
with 'App::Changelord::Role::ChangeTypes'; with 'App::Changelord::Role::ChangeTypes';
with 'App::Changelord::Role::Changelog';
has changelog => ( is => 'lazy' );
with 'App::Changelord::Role::Versions'; with 'App::Changelord::Role::Versions';
sub _build_changelog ($self) { $self->parent_command->changelog }
sub serialize_changelog($self, $changelog = undef) { sub serialize_changelog($self, $changelog = undef) {
$changelog //= $self->changelog; $changelog //= $self->changelog;
@ -42,7 +38,7 @@ sub serialize_changelog($self, $changelog = undef) {
} }
sub run ($self) { sub run ($self) {
my $src = $self->parent_command->source; my $src = $self->source;
die "file '$src' already exists, aborting\n" if -f $src; die "file '$src' already exists, aborting\n" if -f $src;
my $change = { my $change = {
@ -51,7 +47,7 @@ sub run ($self) {
homepage => undef, homepage => undef,
with_stats => 'true', with_stats => 'true',
ticket_url => undef, ticket_url => undef,
commit_regex => /^(?<type>[^: ]+):(?<desc>.*?)(\[(?<ticket>[^\]]+)\])?$/, commit_regex => q/^(?<type>[^: ]+):(?<desc>.*?)(\[(?<ticket>[^\]]+)\])?$/,
}, },
change_types => $self->change_types, change_types => $self->change_types,
releases => [ releases => [