NAME

Pake::Task 

SYNOPSIS

use Pake::Task;
$task = Pake::Task->new($code,$name,$dependency_array_ref);
$task->invoke();

Description

Task is highly coupled with Pake::Application. The constructor registers new blessed Task variable in the Pake::Application. Task is a starting point to add new functionality to pake. You should extend it, and call the super constructor or manually add task in Pake::Application. Refer to source.

Methods

new

Task constructor.

First parameter is a block of code, executed when the task is invoked. Second parameter is name of the task (you specify it during pake usage, pake task1) pointing to the table with dependendant tasks

task {
} "name" => ["deps"];

execute

$task->execute();

It runs the code block passed in the constructor

invoke

$task->invoke();

The method invokes all dependant tasks, checks if the file changed and eventually executes the task

invoke_prerequisites

$task->invoke_prerequisites();

invoke all task dependencies.

needed

check if exection of task is needed: default 1.

Override it for special behaviour.

timestamp

This method should return the file stamp if the task is a file abstraction. Right now it checks if file is newer then dependencies. If yes then it executes. Can be chaned to some hash checking or some other fancy idea.

desc

Set/Get method for task description

name

Set/Get method for task name

code

Set/Get method for task code