Module: Dk::Remote

Defined in:
lib/dk/remote.rb

Defined Under Namespace

Classes: BaseCmd, Cmd, CmdSpy

Constant Summary collapse

NoHostsError =
Class.new(ArgumentError)

Class Method Summary collapse

Class Method Details

.ssh_cmd_str(cmd_str, host, args, host_args) ⇒ Object



7
8
9
10
11
# 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