Dist::Zilla::Stash::Contributors - Stash containing list of contributors
version 0.1.1
my $contrib_stash = $self->zilla->stash_named('%Contributors'); unless ( $contrib_stash ) { $contrib_stash = Dist::Zilla::Stash::Contributors->new; $self->_register_stash('%Contributors', $contrib_stash ); }
$contrib_stash->add_contributors( 'Yanick Champoux <yanick@cpan.org>' );
If you are a Dist::Zilla user, avert your eyes and read no more: this module is not for general consumption but for authors of plugins dealing with contributors harvesting or processing.
Oh, you're one of those? Excellent. Well, here's the deal: this is a stash that is meant to carry the contributors' information between plugins. Plugins that gather contributors can populate the list with code looking like this:
sub before_build { my $self = shift; ...; # gather @collaborators, somehow my $contrib_stash = $self->zilla->stash_named('%Contributors'); unless ( $contrib_stash ) { $contrib_stash = Dist::Zilla::Stash::Contributors->new; $self->_register_stash('%Contributors', $contrib_stash ); } $contrib_stash->add_contributors( @contributors ); }
and plugin that use them:
# of course, make sure this is run *after* the gatherers did their job sub before_build { my $self = shift; my $contrib_stash = $self->zilla->stash_named('%Contributors') or return; my @contributors = $contrib_stash->all_contributors; }
And that's pretty much all you need to know beside that, internally, each contributor is represented by a Dist::Zilla::Stash::Contributors::Contributor object.
Returns all contributors as Dist::Zilla::Stash::Contributors::Contributor objects. The collaborators are sorted alphabetically.
Dist::Zilla::Stash::Contributors::Contributor
Returns the number of contributors.
Adds the @contributors to the stash. Duplicates are filtered out.
@contributors
Contributors can be Dist::Zilla::Stash::Contributors::Contributor objects or strings of the format 'Full Name <email@address.org>'.
Yanick Champoux <yanick@cpan.org>
This software is copyright (c) 2019, 2013 by Yanick Champoux.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Dist::Zilla::Stash::Contributors, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dist::Zilla::Stash::Contributors
CPAN shell
perl -MCPAN -e shell install Dist::Zilla::Stash::Contributors
For more information on module installation, please visit the detailed CPAN module installation guide.