module Dk::Remote

Constants

NoHostsError

Public Class Methods

ssh_cmd_str(cmd_str, host, args, host_args) click to toggle source
# File lib/dk/remote.rb, line 7
def self.ssh_cmd_str(cmd_str, host, args, host_args)
  host_args = host_args[host.to_s] if !host.nil?
  val = "\"#{cmd_str.gsub(/\s+/, ' ')}\"".gsub("\\", "\\\\\\").gsub('"', '\"')
  "ssh #{args} #{host_args} #{host} -- \"sh -c #{val}\""
end