Top Level Namespace
Defined Under Namespace
Modules: Aptitude, Bluepill, Upstart
Instance Method Summary collapse
- #execute_script(name, params = "") ⇒ Object
- #set_default(name, *args, &block) ⇒ Object
-
#template(from, to) ⇒ Object
Place all custom helper methods used in capistrano tasks here This file is loaded before the tasks.
Instance Method Details
#execute_script(name, params = "") ⇒ Object
15 16 17 18 19 20 |
# File 'lib/capistrano/helpers.rb', line 15 def execute_script(name, params = "") upload! File.("../scripts/#{name}", __FILE__), "#{name}" execute "chmod 755 #{name}" execute "./#{name} #{params}" execute "rm #{name}" end |
#set_default(name, *args, &block) ⇒ Object
11 12 13 |
# File 'lib/capistrano/helpers.rb', line 11 def set_default(name, *args, &block) set(name, *args, &block) if fetch(name).nil? end |
#template(from, to) ⇒ Object
Place all custom helper methods used in capistrano tasks here This file is loaded before the tasks
4 5 6 7 8 9 |
# File 'lib/capistrano/helpers.rb', line 4 def template(from, to) erb = File.read(File.("../configs/#{from}", __FILE__)) compiled = ERB.new(erb).result(binding) io = StringIO.new(compiled) upload! io, to end |