Module: Cape::DSLDeprecated Private
- Included in:
- Cape
- Defined in:
- lib/cape/dsl_deprecated.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Implements deprecated methods of DSL.
Instance Method Summary collapse
-
#deprecation ⇒ Deprecation::Base
private
The stream to which deprecation messages are printed.
-
#mirror_rake_tasks(*arguments, &block) ⇒ Object
Defines Rake tasks as Capistrano recipes.
Instance Method Details
#deprecation ⇒ Deprecation::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 stream to which deprecation messages are printed.
15 16 17 |
# File 'lib/cape/dsl_deprecated.rb', line 15 def deprecation @deprecation ||= Deprecation::DSLDeprecatedMirrorRakeTasks.new end |
#mirror_rake_tasks(task_expression = nil) {|env| ... } ⇒ DSLDeprecated #mirror_rake_tasks(capistrano_task_options = {}) {|env| ... } ⇒ DSLDeprecated #mirror_rake_tasks(task_expression, capistrano_task_options = {}) {|env| ... } ⇒ DSLDeprecated
Note:
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.
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/cape/dsl_deprecated.rb', line 124 def mirror_rake_tasks(*arguments, &block) arguments_count = arguments.length = arguments.last.is_a?(::Hash) ? arguments.pop.dup : {} deprecation.task_expression = arguments.first deprecation. = .dup unless arguments.length <= 1 raise ::ArgumentError, ("wrong number of arguments (#{arguments_count} for 0 or 1, " + 'plus an options hash)') end task_expression = arguments.first [:binding] = binding rake.each_task task_expression do |t| deployment_library.define_rake_wrapper(t, , &block) end deployment_library.deprecation.env.each do |name, value| deprecation.env[name] = value end unless deprecation..empty? && deprecation.env.empty? deprecation. end self end |