NAME
Footprintless::Mixins - A utility package for mixins for standard object
VERSION
version 1.13
DESCRIPTION
This class is NOT to be used directly. It can be used by any class which has at minimum:
$self->{coordinate}
$self->{factory}
The including class should:
use Exporter qw(
_sub_coordinate
_deployment
...
);
EXPORT_OK
_command_options([$sub_coordinate])
Returns command_options
. If $sub_coordinate
is supplied, it will be used as the base spec, otherwise, this $self-<{coordinate}
will be used.
_deployment($sub_coordinate, [$name])
Returns a deployment
from the factory. If $name
is supplied, the deployment
will be a singleton stored at $self-
{$name}>.
_download($resource, [$to])
Downloads $resource
and returns the path to the downloaded file. If $to
is specified, the file will be downloaded to $to
.
_entity($coordinate, [$required])
Returns the entity located at $coordinate
. If $required
is truthy, and the entity does not exist, an InvalidEntityException is thrown.
_is_local($hostname_sub_coordinate)
Returns a truthy value if the value at $hostname_sub_coordinate
is an alias for the local system.
_local_template(\&local_work, [%options])
Will check if the entity at $self->{coordinate}
has a hostname
that is local, and if not, it will create a temp directory, call &local_work
with that directory, and call "_push_to_destination($source, $destination, [%options])" in _push_to_destination with the temp directory as the source, and to_dir
as the destination when complete. If hostname
is not local, then &local_work
is called with to_dir
.
_overlay($sub_coordinate, [$name])
Returns a overlay
from the factory. If $name
is supplied, the overlay
will be a singleton stored at $self-
{$name}>.
_push_resource_to_destination($source, $destination, [%options])
Pushes $source
to $destination
. Supported options are:
- extract
-
If truthy, then the resource will be extracted using extract before getting pushed to
$destination
. - status
-
If truthy, then a status indicator will be printed to
STDERR
(uses thepv
command).
_push_to_destination($source, $destination, [%options])
Pushes $source
to $destination
. Supported options are:
- status
-
If truthy, then a status indicator will be printed to
STDERR
(uses thepv
command).
_resolve($resource)
Resolves $resource
.
_service($sub_coordinate, [$name])
Returns a service
from the factory. If $name
is supplied, the service
will be a singleton stored at $self-
{$name}>.
_sub_coordinate($sub_coordinate)
Returns the coordinate of the descendent at $sub_coordinate
.
_sub_entity($sub_coordinate, [$required])
Returns the descendent entity located at $sub_coordinate
. If $required
is truthy, and the entity does not exist, an InvalidEntityException is thrown.
_verify_required_entities(@sub_coordinates)
Will throw an InvalidEntityException if any of @sub_coordinates
refer to entities that do not exist.
AUTHOR
Lucas Theisen <lucastheisen@pastdev.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2016 by Lucas Theisen.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
SEE ALSO
Please see those modules/websites for more information related to this module.