class Capistrano::Nginx::PasswdInteractionHandler

Public Instance Methods

on_data(command, stream_name, data, channel) click to toggle source
# File lib/capistrano/nginx.rb, line 43
def on_data(command, stream_name, data, channel)
  if data.include?("[sudo]")
    ask(:password, 'sudo', echo: false)
    channel.send_data("#{fetch(:password)}\n")
  elsif data.include?("UNIX password")
    ask(:password, 'UNIX', echo: false)
    channel.send_data("#{fetch(:password)}\n")
  else
  end
end