class Object
Public Instance Methods
capture_remote_file(path)
click to toggle source
# File lib/underglow/capistrano/helpers.rb, line 10 def capture_remote_file(path) return unless remote_file_exists?(path) capture(:cat, path).strip end
execute_with_tty(*args)
click to toggle source
SSH with pseudo-tty
# File lib/underglow/capistrano/helpers.rb, line 17 def execute_with_tty(*args) exec "ssh #{host.user}@#{host.hostname} -t '#{command(*args).to_command}'" end
kill_process(process, signal)
click to toggle source
Sends kill signal to process is running
# File lib/underglow/capistrano/helpers.rb, line 22 def kill_process(process, signal) within "#{shared_path}/pids" do pid = capture_remote_file("#{process}.pid") execute :kill, "-#{signal}", pid, raise_on_non_zero_exit: false unless pid.blank? end end
remote_file_exists?(path)
click to toggle source
# File lib/underglow/capistrano/helpers.rb, line 6 def remote_file_exists?(path) test("[ -e #{command.options[:in]}/#{path} ]") end