4
# Attempts to find the task at the given fully-qualified path, and
5
# alias it. If arguments don't have correct task names, an ArgumentError
6
# wil be raised. If no such task exists, a Capistrano::NoSuchTaskError
11
# alias_task :original_deploy, :deploy
13
def alias_task(new_name, old_name)
14
if !new_name.respond_to?(:to_sym) or !old_name.respond_to?(:to_sym)
15
raise ArgumentError, "expected a valid task name"
18
original_task = find_task(old_name) or raise NoSuchTaskError, "the task `#{old_name}' does not exist"
19
task = original_task.dup # Dup. task to avoid modify original task