Rsync::Config::Module
2.1
A module is a module entry from a rsync configuration file. Ex: [cpan] path = /var/ftp/pub/mirrors/ftp.cpan.org/ comment = CPAN mirror
Rsync::Config::Module is used to create a module who can be later used in generating a rsync configuration file. Each module is made by atoms (Rsync::Config::Atom).
use Rsync::Config::Module; sub main { my $mod_cpan; $mod_cpan = new Rsync::Config::Module(name => 'cpan'); $mod_cpan->add_atom(name => 'path', value => '/var/ftp/pub/mirrors/ftp.cpan.org/'); $mod_cpan->add_atom(name => 'comment', value => 'CPAN mirror'); }
The class contructor. %opt must contain at least a key named name with the name of the module.
Adds a blank atom to this module. Returns the object. This method internally calles Rsync::Config::Atom constructor.
Adds a comment atom to this module. Returns the object. This method internally calles Rsync::Config::Atom constructor with $comment parameter. Please read Rsync::Config::Atom contructor documentation to see if any exceptions are throwned.
Adds a new atom to this module. This method internally calles Rsync::Config::Atom constructor with $name and $value parameters. Please read Rsync::Config::Atom contructor documentation to see if any exceptions are throwned.
Adds a previsiously created atom object to the list of current atoms. If $atom_obj is not a instance of Rsync::Config::Atom REX::Param::Invalid exception is throwned.
Returns the number of current atoms.
In scalar context returns a array reference to the list of current atoms. In array content returns a array of current atoms.
Returns the string representation of the current module. If indent is true, a best of effort is made to indent the module.
my $current_indent_step = $module->indent_step; $module->indent_step(2);
Both accessor and mutator, indent_step can be used to get the current indentation level step or to change it.
Both accessor and mutator, name can be used to get the name of the module or change it.
Rsync::Config::Module uses the following modules:
All tests are located in the t directory .
This module is perl critic level 1 compliant.
This module does not use any configuration files or environment variables. The used modules however may use such things. Please refer to each module man page for more information.
None known to the author
Rsync::Config::Exceptions Rsync::Config::Atom Rsync::Config Rsync::Config::Renderer
Manuel SUBREDU <diablo@packages.ro>.
<diablo@packages.ro>
Copyright (c) 2006, Manuel SUBREDU <diablo@packages.ro>. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
To install Rsync::Config, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Rsync::Config
CPAN shell
perl -MCPAN -e shell install Rsync::Config
For more information on module installation, please visit the detailed CPAN module installation guide.