Sha256: 5d59938185c54efd0d5c211fd48ff694e87c41a7322b9f372942ee1d79b5fb89

Contents?: true

Size: 1.03 KB

Versions: 3

Compression:

Stored size: 1.03 KB

Contents

# puts "Nombre de base de #{ARGV[0]}"
# result = gets.chomp

puts "----------------------------------------------------------"
puts "Database name"
puts "----------------------------------------------------------"
db_name = STDIN.gets.chomp
puts "----------------------------------------------------------"
puts "Database username"
puts "----------------------------------------------------------"
db_username = STDIN.gets.chomp
puts "----------------------------------------------------------"
puts "Database password"
puts "----------------------------------------------------------"
db_password = STDIN.gets.chomp


db_conf = File.readlines("config/secrets.yml")
new_file = []
db_conf.each do |line|
	if line.eql?("    :name: database\n")
		line = "    :name: #{db_name}\n"
	elsif line.eql?("    :username: username\n")
		line = "    :username: #{db_username}\n"
	elsif line.eql?("    :password: password\n")
		line = "    :password: #{db_password}\n"
	end
	new_file.push(line)
end
new_file = new_file.join("")
File.write("config/secrets.yml", new_file)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
keppler-2.0.2 installer/lib/conf.rb
keppler-2.0.1 installer/lib/conf.rb
keppler-2.0.0 installer/lib/conf.rb