Class: Cape::Capistrano
- Inherits:
-
Object
- Object
- Cape::Capistrano
- Defined in:
- lib/cape/capistrano.rb
Overview
An abstraction of the Capistrano installation.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#rake ⇒ Object
A Cape abstraction of the Rake installation.
Instance Method Summary collapse
-
#define_rake_wrapper(task, named_arguments) {|recipes| ... } ⇒ Capistrano
Defines a wrapper in Capistrano around the specified Rake task.
-
#initialize(attributes = {}) ⇒ Capistrano
constructor
Constructs a new Capistrano object with the specified attributes.
Constructor Details
#initialize(attributes = {}) ⇒ Capistrano
Constructs a new Capistrano object with the specified attributes.
17 18 19 20 21 22 |
# File 'lib/cape/capistrano.rb', line 17 def initialize(attributes={}) attributes.each do |name, value| send "#{name}=", value end self.rake ||= new_rake end |
Instance Attribute Details
#rake ⇒ Object
A Cape abstraction of the Rake installation.
12 13 14 |
# File 'lib/cape/capistrano.rb', line 12 def rake @rake end |
Instance Method Details
#define_rake_wrapper(task, named_arguments) {|recipes| ... } ⇒ Capistrano
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.
49 50 51 52 53 54 55 56 57 |
# File 'lib/cape/capistrano.rb', line 49 def define_rake_wrapper(task, named_arguments, &block) unless (binding = named_arguments[:binding]) raise ::ArgumentError, ':binding named argument is required' end capistrano_context = binding.eval('self', __FILE__, __LINE__) describe task, capistrano_context implement(task, capistrano_context, &block) end |