Module: Capistrano::Configuration::Execution

Module | Capistrano::Configuration::Execution
In: | lib/capistrano/configuration/execution.rb

### Methods

current_task execute_task find_and_execute_task invoke_task_directly on_rollback pop_task_call_frame push_task_call_frame rollback! rollback_requests rollback_requests= task_call_frames transaction transaction?

### Constants

TaskCallFrame | = | Struct.new(:task, :rollback) |  | A struct for representing a single instance of an invoked task.

### Public Instance methods

current_task()

Returns the TaskDefinition object for the currently executing task. It returns nil if there is no task being executed.

execute_task(task)

Executes the task with the given name, without invoking any associated callbacks.

find_and_execute_task(path, hooks={})

Attempts to locate the task at the given fully-qualified path, and execute it. If no such task exists, a Capistrano::NoSuchTaskError will be raised.

on_rollback(&block)

Specifies an on_rollback hook for the currently executing task. If this or any subsequent task then fails, and a transaction is active, this hook will be executed.

rollback_requests()

The stack of tasks that have registered rollback handlers within the current transaction. If this is nil, then there is no transaction that is currently active.

rollback_requests=(rollback_requests)
task_call_frames()

The call stack of the tasks. The currently executing task may inspect this to see who its caller was. The current task is always the last element of this stack.

transaction() {|if transaction?| ...}

Invoke a set of tasks in a transaction. If any task fails (raises an exception), all tasks executed within the transaction are inspected to see if they have an associated on_rollback hook, and if so, that hook is called.

transaction?()

Returns true if there is a transaction currently active.

### Protected Instance methods

invoke_task_directly(task)

Invokes the task‘s body directly, without setting up the call frame.

pop_task_call_frame()
push_task_call_frame(task)
rollback!()

[Validate]