Dist::Zilla::Role::Stash::Plugins - A Stash that stores arguments for plugins
version 1.002005
This is a role for a Stash that stores arguments for other plugins.
Stashes performing this role must define expand_package.
A regular expression that will capture the package name in $1 and the attribute name in $2.
$1
$2
Defaults to ^(.+?)\W+(\w+)$ which means the package variable and the attribute will be separated by non-word characters (which assumes the attributes will be only word characters/valid perl identifiers).
^(.+?)\W+(\w+)$
You will need to set this attribute in your stash if you need to assign to an attribute in a package that contains non-word characters. This is an example (taken from the tests in t/ini-sep).
# dist.ini [%Example] argument_separator = ^([^|]+)\|([^|]+)$ -PlugName|Attr::Name = oops +Mod::Name|!goo-ber = nuts
Contains the dynamic options.
Inherited from Dist::Zilla::Role::DynamicConfig.
Rather than accessing this directly, consider "get_stashed_config" or "merge_stashed_config".
Return a hashref of the config arguments for the plugin determined by ref($plugin).
ref($plugin)
This is a slice of the _config attribute appropriate for the plugin passed to the method.
# with a stash of: # _config => { # 'APlug:attr1' => 'value1', # 'APlug:second' => '2nd', # 'OtherPlug:attr => '0' # } # from inside Dist::Zilla::Plugin::APlug if( my $stash = $self->zilla->stash_named('%Example') ){ my $stashed = $stash->get_stashed_config($self); } # $stashed => { # 'attr1' => 'value1', # 'second' => '2nd' # }
$stash->merge_stashed_config($plugin, \%opts);
Get the stashed config (see "get_stashed_config"), then attempt to merge it into the plugin.
This require the plugin's attributes to be writable ('rw').
'rw'
It will attempt to push onto array references and concatenate onto existing strings (joined by a space). It will overwrite any other types.
Possible options:
stashed
A hashref like that returned from "get_stashed_config". If not present, "get_stashed_config" will be called.
Removes any hash keys that are only word characters (valid perl identifiers (including "argument_separator")) because the dynamic keys intended for other plugins will all contain non-word characters.
Overwrite this if necessary.
You can find documentation for this module with the perldoc command.
perldoc Dist::Zilla::Role::Stash::Plugins
Search CPAN
http://search.cpan.org/dist/Dist-Zilla-Role-Stash-Plugins
RT: CPAN's Bug Tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Dist-Zilla-Role-Stash-Plugins
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Dist-Zilla-Role-Stash-Plugins
CPAN Ratings
http://cpanratings.perl.org/d/Dist-Zilla-Role-Stash-Plugins
CPAN Forum
http://cpanforum.com/dist/Dist-Zilla-Role-Stash-Plugins
CPANTS Kwalitee
http://cpants.perl.org/dist/overview/Dist-Zilla-Role-Stash-Plugins
CPAN Testers Results
http://cpantesters.org/distro/D/Dist-Zilla-Role-Stash-Plugins.html
CPAN Testers Matrix
http://matrix.cpantesters.org/?dist=Dist-Zilla-Role-Stash-Plugins
Please report any bugs or feature requests to bug-dist-zilla-role-stash-plugins at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Dist-Zilla-Role-Stash-Plugins. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-dist-zilla-role-stash-plugins at rt.cpan.org
http://github.com/magnificent-tears/Dist-Zilla-Role-Stash-Plugins/tree
git clone git://github.com/magnificent-tears/Dist-Zilla-Role-Stash-Plugins.git
Randy Stauner <rwstauner@cpan.org>
This software is copyright (c) 2010 by Randy Stauner.
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::Role::Stash::Plugins, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dist::Zilla::Role::Stash::Plugins
CPAN shell
perl -MCPAN -e shell install Dist::Zilla::Role::Stash::Plugins
For more information on module installation, please visit the detailed CPAN module installation guide.