Module: Capistrano::CLI::UI::ClassMethods

Defined in:
lib/capistrano/cli/ui.rb

Instance Method Summary collapse

Instance Method Details

#debug_prompt(cmd) ⇒ Object

Debug mode prompt



27
28
29
30
31
32
33
34
35
36
# File 'lib/capistrano/cli/ui.rb', line 27

def debug_prompt(cmd)
  ui.say("Preparing to execute command: #{cmd}")
  prompt = "Execute ([Yes], No, Abort) "
  ui.ask("#{prompt}?  ") do |q|
    q.overwrite = false
    q.default = 'y'
    q.validate = /(y(es)?)|(no?)|(a(bort)?|\n)/i
    q.responses[:not_valid] = prompt
  end
end

#password_prompt(prompt = "Password: ") ⇒ Object

Prompt for a password using echo suppression.



22
23
24
# File 'lib/capistrano/cli/ui.rb', line 22

def password_prompt(prompt="Password: ")
  ui.ask(prompt) { |q| q.echo = false }
end

#uiObject

Return the object that provides UI-specific methods, such as prompts and more.



17
18
19
# File 'lib/capistrano/cli/ui.rb', line 17

def ui
  @ui ||= HighLine.new
end