Sha256: 15acbf5a47e3bd5b5f933971d4f05aa6259b5b9a3697bbc3b22a27f7db68281b
Contents?: true
Size: 470 Bytes
Versions: 12
Compression:
Stored size: 470 Bytes
Contents
class Net::SSH::Connection::Channel PROMPT_REGEXP = Regexp.compile('^' + Regexp.escape(SSHKit::Backend::Netssh::SUDO_PROMPT) + '\b') alias on_data_orig on_data def on_data(&block) on_data_orig do |ch, data| sudo_password = Thread.current[SSHKit::Backend::Netssh::SUDO_PASSWORD_KEY] if sudo_password and data =~ PROMPT_REGEXP ch.send_data(sudo_password + "\n") else block.call(ch, data) if block end end end end
Version data entries
12 entries across 12 versions & 1 rubygems