Module: Cape::DSL
- Included in:
- Cape
- Defined in:
- lib/cape/dsl.rb
Overview
Provides methods for integrating Capistrano and Rake.
Instance Method Summary collapse
-
#each_rake_task(task_expression = nil, &block) {|task| ... } ⇒ DSL
Enumerates Rake tasks.
-
#local_rake_executable ⇒ String
The command used to run Rake on the local computer.
-
#local_rake_executable=(value) ⇒ String
Sets the command used to run Rake on the local computer.
-
#method_missing(method, *args, &block) ⇒ Object
Makes the use of a Cape block parameter optional by forwarding non-Cape method calls to the containing binding.
-
#mirror_rake_tasks(task_expression = nil) {|recipes| ... } ⇒ DSL
Defines Rake tasks as Capistrano recipes.
-
#rake ⇒ Object
protected
Returns an abstraction of the Rake installation and available tasks.
-
#remote_rake_executable ⇒ String
The command used to run Rake on remote computers.
-
#remote_rake_executable=(value) ⇒ String
Sets the command used to run Rake on remote computers.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
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
#each_rake_task(task_expression = nil, &block) {|task| ... } ⇒ DSL
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 |
#local_rake_executable ⇒ String
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 |
#local_rake_executable=(value) ⇒ String
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 |
#mirror_rake_tasks(task_expression = nil) {|recipes| ... } ⇒ DSL
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 |
#rake ⇒ Object (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 |
#remote_rake_executable ⇒ String
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 |
#remote_rake_executable=(value) ⇒ String
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 |