Sha256: 8d68c10d2f40eca4847fa71bf29af51f497154d2b690dc30d3f28e0d26a51d1c
Contents?: true
Size: 462 Bytes
Versions: 13
Compression:
Stored size: 462 Bytes
Contents
module SshCommand require 'net/ssh' def SshCommand.run(connection, *commands) ENV['HOME'] = File.dirname(__FILE__) # fixes "non-absolute home" exceptions output = "" Net::SSH.start(connection[:host], connection[:username], :password => connection[:password]) do |session| commands.each do |cmd| output = session.exec!("source ~/.bash_profile && " + cmd) yield output if block_given? end end output end end
Version data entries
13 entries across 13 versions & 1 rubygems