Class: Cape::CapistranoDeprecated Private

Inherits:
Capistrano show all
Defined in:
lib/cape/capistrano_deprecated.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Implements Capistrano with deprecated methods.

Instance Attribute Summary

Attributes inherited from Capistrano

#rake

Instance Method Summary collapse

Methods inherited from Capistrano

#initialize

Constructor Details

This class inherits a constructor from Cape::Capistrano

Instance Method Details

#define_rake_wrapper(task, named_arguments) {|env| ... } ⇒ CapistranoDeprecated

Deprecated.
Note:

Any parameters that the Rake task has are integrated via environment variables, since Capistrano does not support recipe parameters per se.

Defines a wrapper in Capistrano around the specified Rake task.

Parameters:

  • task (Hash)

    metadata for a Rake task

  • named_arguments (Hash)

    named arguments, including options to pass to the Capistrano task method

Options Hash (task):

  • :name (String)

    the name of the Rake task

  • :parameters (Array of String, nil)

    the names of the Rake task’s parameters, if any

  • :description (String)

    documentation for the Rake task

Options Hash (named_arguments):

  • :binding (Binding)

    the Binding of your Capistrano recipes file

Yields:

  • (env)

    a block that defines environment variables for the Rake task; optional

Yield Parameters:

  • env (Hash)

    the environment variables to set before executing the Rake task

Returns:

Raises:

  • (ArgumentError)

    named_arguments[:binding] is missing

See Also:



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/cape/capistrano_deprecated.rb', line 45

def define_rake_wrapper(task, named_arguments, &block)
  unless (binding = named_arguments[:binding])
    raise ::ArgumentError, ':binding named argument is required'
  end

  deprecation.task            = task
  deprecation.named_arguments = named_arguments

  capistrano_context = binding.eval('self', __FILE__, __LINE__)
  options = named_arguments.reject do |key, value|
    key == :binding
  end
  describe  task, capistrano_context
  implement(task, capistrano_context, options, &block)
end

#deprecationDeprecation::Base

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The object in which deprecated API usage is recorded.

Returns:



64
65
66
# File 'lib/cape/capistrano_deprecated.rb', line 64

def deprecation
  @deprecation ||= Deprecation::CapistranoDeprecatedDefineRakeWrapper.new
end