Class: Stable::Utils::Prompts

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

Class Method Summary collapse

Class Method Details

.mysql_root_credentialsObject



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/stable/utils/prompts.rb', line 8

def self.mysql_root_credentials
  print 'Enter MySQL root username (default: root): '
  user = $stdin.gets.strip
  user = 'root' if user.empty?

  print 'Enter MySQL root password (leave blank if none): '
  password = $stdin.noecho(&:gets).chomp
  puts

  { user: user, password: password }
end