Module: Cape::DSL
- Included in:
- Cape
- Defined in:
- lib/cape/dsl.rb
Overview
Provides methods for integrating Capistrano and Rake.
Instance Method Summary (collapse)
-
- (DSL) each_rake_task(task_expression = nil, &block) {|task| ... }
Enumerates Rake tasks.
-
- (String) local_rake_executable
The command used to run Rake on the local computer.
-
- (String) local_rake_executable=(value)
Sets the command used to run Rake on the local computer.
-
- (Object) method_missing(method, *args, &block)
Makes the use of a Cape block parameter optional by forwarding non-Cape method calls to the containing binding.
-
- (DSL) mirror_rake_tasks(task_expression = nil) {|recipes| ... }
Defines Rake tasks as Capistrano recipes.
-
- (Object) rake
protected
Returns an abstraction of the Rake installation and available tasks.
-
- (String) remote_rake_executable
The command used to run Rake on remote computers.
-
- (String) remote_rake_executable=(value)
Sets the command used to run Rake on remote computers.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
- (Object) method_missing(method, *args, &block)
Makes the use of a Cape block parameter optional by forwarding non-Cape method calls to the containing binding.
89 90 91 |
# File 'lib/cape/dsl.rb', line 89 def method_missing(method, *args, &block) @outer_self.send(method, *args, &block) end |
Instance Method Details
- (DSL) each_rake_task(task_expression = nil, &block) {|task| ... }
Enumerates Rake tasks.
49 50 51 52 |
# File 'lib/cape/dsl.rb', line 49 def each_rake_task(task_expression=nil, &block) rake.each_task(task_expression, &block) self end |
- (String) local_rake_executable
The command used to run Rake on the local computer.
59 60 61 |
# File 'lib/cape/dsl.rb', line 59 def local_rake_executable rake.local_executable end |
- (String) local_rake_executable=(value)
Sets the command used to run Rake on the local computer.
77 78 79 |
# File 'lib/cape/dsl.rb', line 77 def local_rake_executable=(value) rake.local_executable = value end |
- (DSL) mirror_rake_tasks(task_expression = nil) {|recipes| ... }
Any parameters that the Rake tasks have are integrated via environment variables, since Capistrano does not support recipe parameters per se.
Defines Rake tasks as Capistrano recipes.
181 182 183 184 185 186 |
# File 'lib/cape/dsl.rb', line 181 def mirror_rake_tasks(task_expression=nil, &block) rake.each_task task_expression do |t| deployment_library.define_rake_wrapper(t, :binding => binding, &block) end self end |
- (Object) rake (protected)
Returns an abstraction of the Rake installation and available tasks.
218 219 220 |
# File 'lib/cape/dsl.rb', line 218 def rake @rake ||= new_rake end |
- (String) remote_rake_executable
The command used to run Rake on remote computers.
193 194 195 |
# File 'lib/cape/dsl.rb', line 193 def remote_rake_executable rake.remote_executable end |
- (String) remote_rake_executable=(value)
Sets the command used to run Rake on remote computers.
211 212 213 |
# File 'lib/cape/dsl.rb', line 211 def remote_rake_executable=(value) rake.remote_executable = value end |