NAME

App::PPBuild::Task - A basic task for PPBuilder, also the base class for new task types.

DESCRIPTION

All tasks for PPBuilder should be based on, or compatible with this class.

You will probably never need to create an object of this class yourself. Generally you should use the task(), file(), or group() functions from PPBuilder.pm. You would only need to create new instances of this object yourself if you are creating an extenstion to PPBuilder.

SYNOPSIS

App::PPBuild::Task->new(
    name => $name,
    code => $code,
    deps => [ qw/ ...deps... / ],
    flags => { %flags },
);

METHODS

new()

Create a new instance of a Task object.

Named parameters:

name   - Name of the task.
code   - coderef or string of shell commands.
deps   - Tasks this task depends on.
flags  - list of flags.
description - Task description.
run()

Run the task. If the task has been run it will not run again unless the 'again' flag is set, or a true value is passed to the run method. Will determine code type, run it, and then check to be sure the code ran succesfully.

deplist

Returns a list of tasks depended on by this task.

ran()

Returns the number of times this task has been run.

flag()

Returns the value of the specified flag.

flaglist()

Returns the list of flags.

code

Returns the code if present, will be a coderef, string.

name

Returns the name of the task.

Hook methods are available for use in subclasses.

hook_completed()

hook_completed is run at the end of the run() method. It is a method. The only parameter is a reference to the $exit string that run() will return. You can check or modify this as necessary.

The point of this hook is to verify that everything the task was supposed to do has been done. An example would be the File task, which uses this hook to verify a file with the name of the task has been created.

hook_proto()

hook_proto is used to add your own parameter parsing to new(). It is *not* a method. The parameters are everything passed to new() except the class. The hook should return a hash of properties to give the new instance of the object.

hook_run()

hook_run is used to run code of types other than coderef or string. It is a method. The 'code' from the task is the only parameter. Returns a string.

AUTHOR

Chad Granum <exodist7@gmail.com>

COPYRIGHT

Copyright 2009 Chad Granum

licensed under the GPL version 3. You should have received a copy of the GNU General Public License along with this. If not, see <http://www.gnu.org/licenses/>.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 184:

=back doesn't take any parameters, but you said =back =head1 HOOK METHODS AND FUNCTIONS