Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

config::mvp::assembler::withbundles(3pm) [debian man page]

Config::MVP::Assembler::WithBundles(3pm)		User Contributed Perl Documentation		  Config::MVP::Assembler::WithBundles(3pm)

NAME
Config::MVP::Assembler::WithBundles - a role to make assemblers expand bundles VERSION
version 2.200002 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 the this returns a defined method: my $method = $assembler->package_bundle_method($package); The default implementation looks for a method callde "mvp_bundle_config", but "package_bundle_method" can be replaced to allow for other bundle-identifying information. 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) 2012 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. perl v5.14.2 2012-03-16 Config::MVP::Assembler::WithBundles(3pm)

Check Out this Related Man Page

Config::MVP::Section(3pm)				User Contributed Perl Documentation				 Config::MVP::Section(3pm)

NAME
Config::MVP::Section - one section of an MVP configuration sequence VERSION
version 2.200002 DESCRIPTION
For the most part, you can just consult Config::MVP to understand what this class is and how it's used. ATTRIBUTES
name This is the section's name. It's a string, and it must be provided. package This is the (Perl) package with which the section is associated. It is optional. When the section is instantiated, it will ensure that this package is loaded. multivalue_args This attribute is an arrayref of value names that should be considered multivalue properties in the section. When added to the section, they will always be wrapped in an arrayref, and they may be added to the section more than once. If this attribute is not given during construction, it will default to the result of calling section's package's "mvp_multivalue_args" method. If the section has no associated package or if the package doesn't provide that method, it default to an empty arrayref. aliases This attribute is a hashref of name remappings. For example, if it contains this hashref: { file => 'files', path => 'files', } Then attempting to set either the "file" or "path" setting for the section would actually set the "files" setting. If this attribute is not given during construction, it will default to the result of calling section's package's "mvp_aliases" method. If the section has no associated package or if the package doesn't provide that method, it default to an empty hashref. payload This is the storage into which properties are set. It is a hashref of names and values. You should probably not alter the contents of the payload, and should read its contents only. is_finalized This attribute is true if the section has been marked finalized, which will prevent any new values from being added to it. It can be set with the "finalize" method. sequence This attributes points to the sequence into which the section has been assembled. It may be unset if the section has been created but not yet placed in a sequence. METHODS
add_value $section->add_value( $name => $value ); This method sets the value for the named property to the given value. If the property is a multivalue property, the new value will be pushed onto the end of an arrayref that will store all values for that property. Attempting to add a value for a non-multivalue property whose value was already added will result in an exception. load_package $section->load_package($package, $plugin); This method is used to ensure that the given $package is loaded, and is called whenever a section with a package is created. By default, it delegates to Class::Load. If the package can't be found, it calls the missing_package method. Errors in compilation are not suppressed. missing_package $section->missing_package($package, $plugin); This method is called when "load_package" encounters a package that is not installed. By default, it throws an exception. AUTHOR
Ricardo Signes <rjbs@cpan.org> COPYRIGHT AND LICENSE
This software is copyright (c) 2012 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. perl v5.14.2 2012-03-16 Config::MVP::Section(3pm)
Man Page