lib/gumboot/strap.rb in aaf-gumboot-2.1.3 vs lib/gumboot/strap.rb in aaf-gumboot-2.1.4
- old
+ new
@@ -40,13 +40,18 @@
Rails.logger.info(
"Ensuring access to `#{database}` for #{username} user is granted"
)
+ create_and_grant_user(client, database, username, password)
+ end
+
+ def create_and_grant_user(client, database, username, password)
+ client.query("CREATE USER IF NOT EXISTS '#{client.escape(username)}'" \
+ "@'localhost' IDENTIFIED BY '#{client.escape(password)}';")
client.query("GRANT ALL PRIVILEGES ON `#{database}`.* " \
- "TO '#{client.escape(username)}'@'localhost' " \
- "IDENTIFIED BY '#{client.escape(password)}'")
+ "TO '#{client.escape(username)}'@'localhost'")
end
def maintain_activerecord_schema
message 'Loading database schema'
@@ -80,10 +85,11 @@
src = File.expand_path("~/.aaf/#{file}")
raise("Missing global config file: #{src}") unless File.exist?(src)
dest = "config/#{file}"
next if File.exist?(dest)
+
FileUtils.ln_s(src, dest)
end
end
def update_local_configuration(files)
@@ -102,9 +108,10 @@
dest = "config/#{file}"
raise("Missing dist config file: #{src}") unless File.exist?(src)
next if File.exist?(dest)
+
FileUtils.copy(src, dest)
end
end
private