Build::Hopen::G::Runnable - parent class for runnable things in a hopen graph
Anything with "run" inherits from this. TODO should this be a role?
Inputs this Runnable requires. A Build::Hopen::Util::NameSet, with the restriction that need may not contain regexes. ("Sorry, I can't run unless you give me every variable in the world that starts with Q." I don't think so!)
need
If defined, a Build::Hopen::Scope that will have the final say on the data used by "run". This is the basis of the fine-grained override mechanism in hopen.
Inputs this Runnable accepts but does not require. A Build::Hopen::Util::NameSet, which may include regexes.
Run the operation, whatever that means. Returns a new hashref. Usage:
my $hrOutputs = $op->run([options])
Options are:
A Build::Hopen::Scope or subclass including the inputs the caller wants to pass to the Runnable. The "scope" of the Runnable itself may override values in the context.
context
If given, the phase that is currently under way in a build-system run.
If given, the Build::Hopen::Gen instance in use for the current build-system run.
If -nocontext=>1 is specified, don't link a context scope into this one. May not be specified together with -context.
-nocontext=>1
-context
See the source for this function, which contains as an example of setting the scope.
The internal method that implements "run". Must be implemented by subclasses. When _run is called, $self->scope has been hooked to the context scope, if any.
_run
$self->scope
Parameters are -phase and -generator. _run is always called in scalar context, and must return a new hashref.
-phase
-generator
Returns a new hashref of this Runnable's local values, as defined by "local" in Build::Hopen::Scope. Usage:
my $hashref = $runnable->passthrough([-context => $outer_scope]); # To use $outer_scope as the context my $hashref = $runnable->passthrough(-nocontext => 1); # To leave the context untouched
Other valid options include -levels.
To install Build::Hopen, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Build::Hopen
CPAN shell
perl -MCPAN -e shell install Build::Hopen
For more information on module installation, please visit the detailed CPAN module installation guide.