Module: Capistrano::Postgresql::PasswordHelpers

Defined in:
lib/capistrano/postgresql/password_helpers.rb

Instance Method Summary collapse

Instance Method Details

#generate_random_passwordObject



7
8
9
# File 'lib/capistrano/postgresql/password_helpers.rb', line 7

def generate_random_password
  SecureRandom.hex(10)
end

#pg_password_generateObject



11
12
13
14
15
16
17
18
19
# File 'lib/capistrano/postgresql/password_helpers.rb', line 11

def pg_password_generate
  if fetch(:pg_ask_for_password)
    ask :pg_password, "Postgresql database password for the app: "
  elsif fetch(:pg_generate_random_password)
    set :pg_password, generate_random_password
  else
    set :pg_password, nil # Necessary for pg_template
  end
end