-
-
10 Jan 2021 00:52:16 UTC
- Distribution: Config-MVP
- Module version: 2.200012
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (7)
- Testers (63 / 0 / 0)
- Kwalitee
Bus factor: 1- 85.90% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (33.43KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
++ed by:1 non-PAUSE userand 6 contributors-
Alexandr Ciornii
-
George Hartzell
-
Karen Etheridge
-
Kent Fredric
-
Philippe Bruhat (BooK)
-
Sven Kirmess
- Dependencies
- Class::Load
- Cwd
- File::Spec
- Module::Pluggable::Object
- Moose
- Moose::Role
- Moose::Util::TypeConstraints
- MooseX::OneArgNew
- Params::Util
- Role::HasMessage
- Role::Identifiable::HasIdent
- StackTrace::Auto
- Test::More
- Throwable
- Tie::IxHash
- Try::Tiny
- overload
- strict
- warnings
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Config::MVP::Assembler::WithBundles - a role to make assemblers expand bundles
VERSION
version 2.200012
DESCRIPTION
Config::MVP::Assembler::WithBundles is a role to be composed into a Config::MVP::Assembler subclass. It allows some sections of configuration to be treated as bundles. When any section is ended, if that section represented a bundle, its bundle contents will be unrolled and will replace it in the sequence.
A package is considered a bundle if
package_bundle_method
returns a defined value (which is the name of a method that will be called on that package to retrieve its bundle config).my $method = $assembler->package_bundle_method($package);
The default implementation looks for a method called
mvp_bundle_config
, butpackage_bundle_method
can be replaced with one that returns the name of a different bundle-identifying method-name.Bundles are expanded by a call to the assembler's
replace_bundle_with_contents
method, like this:$assembler->replace_bundle_with_contents($section, $method);
replace_bundle_with_contents
The default
replace_bundle_with_contents
method deletes the section from the sequence. It then gets a description of the new sections to introduce, like this:my @new_config = $bundle_section->package->$method({ name => $bundle_section->name, package => $bundle_section->package, payload => $bundle_section->payload, });
(We pass a hashref rather than a section so that bundles can be expanded synthetically without having to laboriously create a new Section.)
The returned
@new_config
is a list of arrayrefs, each of which has three entries:[ $name, $package, $payload ]
Each arrayref is converted into a section in the sequence. The
$payload
should be an arrayref of name/value pairs to be added to the created section.AUTHOR
Ricardo Signes <rjbs@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2021 by Ricardo Signes.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install Config::MVP, copy and paste the appropriate command in to your terminal.
cpanm Config::MVP
perl -MCPAN -e shell install Config::MVP
For more information on module installation, please visit the detailed CPAN module installation guide.