Class: Capistrano::Nginx::PasswdInteractionHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/capistrano/nginx.rb

Instance Method Summary collapse

Instance Method Details

#on_data(command, stream_name, data, channel) ⇒ Object


43
44
45
46
47
48
49
50
51
52
# 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