Method: Match::ChangePassword.ask_password

Defined in:
lib/match/change_password.rb

.ask_password(message: "Passphrase for Git Repo: ", confirm: true) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/match/change_password.rb', line 15

def self.ask_password(message: "Passphrase for Git Repo: ", confirm: true)
  loop do
    password = ask(message.yellow) { |q| q.echo = "*" }
    if confirm
      password2 = ask("Type passphrase again: ".yellow) { |q| q.echo = "*" }
      if password == password2
        return password
      end
    else
      return password
    end
    UI.error("Passhprases differ. Try again")
  end
end