Top Level Namespace
Defined Under Namespace
Modules: Capistrano
Instance Method Summary collapse
- #_cset(name, *args, &block) ⇒ Object
-
#depend(location, type, *args) ⇒ Object
Auxiliary helper method for the ‘deploy:check’ task.
-
#with_env(name, value) ⇒ Object
Temporarily sets an environment variable, yields to a block, and restores the value when it is done.
Instance Method Details
#_cset(name, *args, &block) ⇒ Object
5 6 7 8 9 |
# File 'lib/capistrano/recipes/deploy.rb', line 5 def _cset(name, *args, &block) unless exists?(name) set(name, *args, &block) end end |
#depend(location, type, *args) ⇒ Object
Auxiliary helper method for the ‘deploy:check’ task. Lets you set up your own dependencies.
75 76 77 78 79 80 81 |
# File 'lib/capistrano/recipes/deploy.rb', line 75 def depend(location, type, *args) deps = fetch(:dependencies, {}) deps[location] ||= {} deps[location][type] ||= [] deps[location][type] << args set :dependencies, deps end |
#with_env(name, value) ⇒ Object
Temporarily sets an environment variable, yields to a block, and restores the value when it is done.
85 86 87 88 89 90 |
# File 'lib/capistrano/recipes/deploy.rb', line 85 def with_env(name, value) saved, ENV[name] = ENV[name], value yield ensure ENV[name] = saved end |