Class: Mayfly::Utils::Cli

Inherits:
Object
  • Object
show all
Defined in:
lib/mayfly/utils.rb

Overview

Some helpers for the cli

Class Method Summary collapse

Class Method Details

.get_passwdObject



38
39
40
41
42
43
44
45
46
# File 'lib/mayfly/utils.rb', line 38

def self.get_passwd  
  passwd = ask('Password, leave blank for none: ') {|q| q.echo = false}
  return nil if passwd == ''
  if (passwd != ask('Confirm password: ') {|q| q.echo = false})
    puts 'Passwords do not match, exiting'
    exit 1
  end
  passwd
end