Class: Cape::Capistrano
- Inherits:
-
Object
- Object
- Cape::Capistrano
- Defined in:
- lib/cape/capistrano.rb
Overview
An abstraction of the Capistrano installation.
Instance Attribute Summary (collapse)
-
- (Object) rake
A Cape abstraction of the Rake installation.
Instance Method Summary (collapse)
-
- (Capistrano) define_rake_wrapper(task, named_arguments) {|recipes| ... }
Defines a wrapper in Capistrano around the specified Rake task.
-
- (Capistrano) initialize(attributes = {})
constructor
Constructs a new Capistrano object with the specified attributes.
Constructor Details
- (Capistrano) initialize(attributes = {})
Constructs a new Capistrano object with the specified attributes.
16 17 18 19 20 21 |
# File 'lib/cape/capistrano.rb', line 16 def initialize(attributes={}) attributes.each do |name, value| send "#{name}=", value end self.rake ||= new_rake end |
Instance Attribute Details
- (Object) rake
A Cape abstraction of the Rake installation.
11 12 13 |
# File 'lib/cape/capistrano.rb', line 11 def rake @rake end |
Instance Method Details
- (Capistrano) define_rake_wrapper(task, named_arguments) {|recipes| ... }
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.
48 49 50 51 52 53 54 55 56 |
# File 'lib/cape/capistrano.rb', line 48 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 |