docs for ::GitGather

This commit is contained in:
Yanick Champoux 2022-07-25 11:45:03 -04:00
parent 364ad6d587
commit 0fa5f2a9a4
2 changed files with 8 additions and 11 deletions

View File

@ -41,10 +41,7 @@ END_POD
use Path::Tiny; use Path::Tiny;
use Git::Repository; use Git::Repository;
has changelog => ( is => 'lazy' ); with 'App::Changelord::Role::Changelog';
sub _build_changelog ($self) { $self->parent_command->changelog }
with 'App::Changelord::Role::Versions'; with 'App::Changelord::Role::Versions';
with 'App::Changelord::Role::ChangeTypes'; with 'App::Changelord::Role::ChangeTypes';
@ -69,7 +66,7 @@ sub _build_commit_regex($self) {
sub lower_bound($self) { sub lower_bound($self) {
# either the most recent commit in the current release # either the most recent commit in the current release
my @sha1s = grep { $_ } map { $_->{commit} } $self->next_release->{changes}->@*; my @sha1s = grep { $_ } map { $_->{commit} } grep { ref } $self->next_release->{changes}->@*;
return pop @sha1s if @sha1s; return pop @sha1s if @sha1s;
@ -92,7 +89,7 @@ sub munge_message($self,$message) {
} }
sub save_changelog($self) { sub save_changelog($self) {
my $src = $self->parent_command->source; my $src = $self->source;
path($src)->spew( App::Changelord::Command::Init::serialize_changelog($self) ); path($src)->spew( App::Changelord::Command::Init::serialize_changelog($self) );
} }
@ -104,7 +101,7 @@ sub run ($self) {
# figure out lower bound # figure out lower bound
my $from = $self->lower_bound; my $from = $self->lower_bound;
say "checking from ", ( $from || 'the dawn of time' ), " on"; say "checking since ", ( $from || 'the dawn of time' );
my @messages = map { $self->munge_message($_) } $self->get_commits($from); my @messages = map { $self->munge_message($_) } $self->get_commits($from);
@ -121,7 +118,7 @@ sub run ($self) {
$self->save_changelog; $self->save_changelog;
say $self->parent_command->source, " updated"; say $self->source, " updated";
} }
1; 1;