NAME
Parrot::Configure - Conducts the execution of Configuration Steps
SYNOPSIS
use Parrot::Configure;
my $conf = Parrot::Configure->new;
my $data = $conf->data;
my $options = $conf->options;
my @steps = $conf->steps;
$conf->add_steps(@steps);
$conf->runsteps;
DESCRIPTION
This module provides provides a means for registering, executing, and coordinating one or more configuration steps. Please see docs/configuration.pod for further details about the configuration framework.
USAGE
Import Parameters
This module accepts no arguments to its import
method and exports no symbols.
Methods
Constructor
new()
Basic constructor.
Accepts no arguments and returns a Parrot::Configure object.
Object Methods
data()
Provides access to a Parrot::Configure::Data object intended to contain initial and discovered configuration data.
Accepts no arguments and returns a Parrot::Configure::Data object.
options()
Provides access to a Parrot::Configure::Data object intended to contain CLI option data.
Accepts no arguments and returns a Parrot::Configure::Data object.
steps()
Provides a list of registered steps, where each step is represented by an Parrot::Configure::Task object. Steps are returned in the order in which they were registered.
Accepts no arguments and returns a list in list context or an arrayref in scalar context.
get_list_of_steps()
Provides a list of the names of registered steps.
steps()
, in contrast, provides a list of registered step objects, of which the step name is just a small part. Step names are returned in the order in which their corresponding step objects were registered.Accepts no arguments and returns a list in list context or an arrayref in scalar context.
Note: The list of step names returned by
get_list_of_steps()
will be the same as that in the second argument returned byParrot::Configure::Options::process_options()
provided that you have not usedadd_step()
oradd_steps()
to add any configuration steps.add_step()
Registers a new step and any parameters that should be passed to it. The first parameter passed is the class name of the step being registered. All other parameters are saved and passed to the registered class's
runstep()
method.Accepts a list and modifies the data structure within the Parrot::Configure object.
add_steps()
Registers new steps to be run at the end of the execution queue.
Accepts a list of new steps and modifies the data structure within the Parrot::Configure object.
runsteps()
Sequentially executes steps in the order they were registered. The invoking Parrot::Configure object is passed as the first argument to each step's
runstep()
method, followed by any parameters that were registered for that step.Accepts no arguments and modifies the data structure within the Parrot::Configure object.
run_single_step()
The invoking Parrot::Configure object is passed as the first argument to each step's
runstep()
method, followed by any parameters that were registered for that step.Accepts no arguments and modifies the data structure within the Parrot::Configure object.
Note: Currently used only in tools/dev/reconfigure.pl; not used in Configure.pl.
option_or_data($arg)
Are you tired of this construction all over the place?
my $opt = $conf->options->get( $arg ); $opt = $conf->data->get( $arg ) unless defined $opt;
It gives you the user-specified option for $arg, and if there isn't one, it gets it from the created data. You do it all the time, but oh! the wear and tear on your fingers!
Toil no more! Use this simple construction:
my $opt = $conf->option_or_data($arg);
and save your fingers for some real work!
CREDITS
The "runsteps()" method is largely based on code written by Brent Royal-Gordon brent@brentdax.com
.
AUTHOR
Joshua Hoblitt jhoblitt@cpan.org
SEE ALSO
docs/configuration.pod, Parrot::Configure::Data, Parrot::Configure::Utils, Parrot::Configure::Step