daddy 0.9.16 → 0.9.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54b50f10c353ee074f29bc7851e0c5ee33e82a1cf325f2b1178a27565f6b649f
4
- data.tar.gz: 7f05b4291c47f44960853430ac699c4919668898f5aba8d62708c9ac27ed66bd
3
+ metadata.gz: 16b6d0ee819d9a4ea56297e4fd52f2ab9fa091eb5122f5402160e95599e93bcd
4
+ data.tar.gz: 2d647c14595a3a42b36863b7fe3b272a64e6efb9bce19761255e618baf67cfb1
5
5
  SHA512:
6
- metadata.gz: 1430690d24611de760e956483befbb9c1b890570f3314c5589e2f66806ee736b5e05a42b287d4bcf9e6df089b7c777f9a570eb7771ae77f3a25fcde0ccc8acbd
7
- data.tar.gz: 6eb971434b89d35e37f405470157bad91a3e175db8d69a96e4b83038aef4e8b7df01d5778ea43242af1c2fd9a736643116017b84512872b95563fe9dc51a4594
6
+ metadata.gz: 6104f6985d62771b44c0a45d0e21f7d940b7cacc5c88432dbc6d6eaca26f0f2cfd55875027f9d4f82ee832471bd388614e356c4cf5abae3f8595c24b87934811
7
+ data.tar.gz: 73b78f59158b82056e5bd57e12733d2e62825dd145a5bd6f86a5eb33ef232ed2fe85f804ca25ba03c324c76777f5ce52b58dadd58ea6d71ca32812f2d656a2cb
data/lib/daddy/version.rb CHANGED
@@ -2,6 +2,6 @@ module Daddy
2
2
  VERSION = [
3
3
  VERSION_MAJOR = '0',
4
4
  VERSION_MINOR = '9',
5
- VERSION_REVISION = '16'
5
+ VERSION_REVISION = '17'
6
6
  ].join('.')
7
7
  end
@@ -10,19 +10,27 @@ namespace :dad do
10
10
  FileUtils.mkdir_p("tmp")
11
11
  system("echo '# mysql ddl' > tmp/create_databases.sql")
12
12
 
13
+ user = nil
14
+ config.each do |env, props|
15
+ next if env == 'default'
16
+ next if props['username'] == user
17
+
18
+ user = props['username']
19
+ system("echo 'drop user if exists \"#{user}\"@\"%\";' >> tmp/create_databases.sql")
20
+ system("echo 'create user \"#{user}\"@\"%\" IDENTIFIED BY \"#{props['password']}\";' >> tmp/create_databases.sql")
21
+ end
22
+
13
23
  config.each do |env, props|
14
24
  next if env == 'default'
15
25
  next if ENV['RAILS_ENV'] and ENV['RAILS_ENV'] != env
16
26
 
17
27
  system("echo 'drop database if exists #{props['database']};' >> tmp/create_databases.sql")
18
28
  system("echo 'create database #{props['database']};' >> tmp/create_databases.sql")
19
- system("echo 'drop user if exists \"#{props['username']}\"@\"%\";' >> tmp/create_databases.sql")
20
- system("echo 'create user \"#{props['username']}\"@\"%\" IDENTIFIED BY \"#{props['password']}\";' >> tmp/create_databases.sql")
21
- system("echo 'grant all on #{props['database']}.* to #{props['username']} identified by \"#{props['password']}\";' >> tmp/create_databases.sql")
29
+ system("echo 'grant all on #{props['database']}.* to #{user};' >> tmp/create_databases.sql")
22
30
 
23
31
  if ENV['FILE']
24
- system("echo 'grant all on #{props['database']}.* to #{props['username']}@localhost identified by \"#{props['password']}\";' >> tmp/create_databases.sql")
25
- system("echo 'grant file on *.* to #{props['username']}@localhost;' >> tmp/create_databases.sql")
32
+ system("echo 'grant all on #{props['database']}.* to #{user}@localhost;' >> tmp/create_databases.sql")
33
+ system("echo 'grant file on *.* to #{user}@localhost;' >> tmp/create_databases.sql")
26
34
  end
27
35
  puts "database for environment #{env} written to tmp/create_databases.sql"
28
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daddy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.16
4
+ version: 0.9.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - ichy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-02-09 00:00:00.000000000 Z
11
+ date: 2025-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docker-api