Sha256: 887fad629bc5533470f6a7a8b15fcb1878efc8061f025a02227012b3596f2592
Contents?: true
Size: 436 Bytes
Versions: 10
Compression:
Stored size: 436 Bytes
Contents
def sudo(command) sh "sudo #{command}" end def ssh(host, command, options = {}) target = [ options.delete(:user), host ].compact.join('@') arguments = [] arguments << "-p #{options.delete(:port)}" if options[:port] arguments = arguments + options.collect do |key, value| formatted_key = key.to_s.gsub('_','') "-o '#{formatted_key} #{value}'" end sh "ssh -t #{arguments.join(' ')} #{target} '#{command}'" end
Version data entries
10 entries across 10 versions & 2 rubygems