daddy 0.9.17 → 0.9.18

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: 16b6d0ee819d9a4ea56297e4fd52f2ab9fa091eb5122f5402160e95599e93bcd
4
- data.tar.gz: 2d647c14595a3a42b36863b7fe3b272a64e6efb9bce19761255e618baf67cfb1
3
+ metadata.gz: 3e862e37efacb02975df4d1b10c057e38300b96af772d36105af1b987aaf3c33
4
+ data.tar.gz: 37862ad7abc3bd741486ec24abecf8a49560ca801210249378bb8c7c77070a23
5
5
  SHA512:
6
- metadata.gz: 6104f6985d62771b44c0a45d0e21f7d940b7cacc5c88432dbc6d6eaca26f0f2cfd55875027f9d4f82ee832471bd388614e356c4cf5abae3f8595c24b87934811
7
- data.tar.gz: 73b78f59158b82056e5bd57e12733d2e62825dd145a5bd6f86a5eb33ef232ed2fe85f804ca25ba03c324c76777f5ce52b58dadd58ea6d71ca32812f2d656a2cb
6
+ metadata.gz: e74c5c181caac4dc3f77c2b032a6b6776c0b86402e8f204c50e34ca1c485da95a8c2a92e569c84d782f26587dc04ab2647f06b7c5e1a24285dff099123b09706
7
+ data.tar.gz: 3bea0cc1bf10b09cb6e660512f5cd51c8f30cf93e6834a65d938e373d0908d8e7cacc78e9d4c2a76eb8b52e7fbcf191d1b08ec2f53a069ea24a2c9107efb460f
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 = '17'
5
+ VERSION_REVISION = '18'
6
6
  ].join('.')
7
7
  end
@@ -10,12 +10,14 @@ namespace :dad do
10
10
  FileUtils.mkdir_p("tmp")
11
11
  system("echo '# mysql ddl' > tmp/create_databases.sql")
12
12
 
13
- user = nil
13
+ user = host = port = nil
14
14
  config.each do |env, props|
15
15
  next if env == 'default'
16
16
  next if props['username'] == user
17
17
 
18
18
  user = props['username']
19
+ host = props['host']
20
+ port = props['port']
19
21
  system("echo 'drop user if exists \"#{user}\"@\"%\";' >> tmp/create_databases.sql")
20
22
  system("echo 'create user \"#{user}\"@\"%\" IDENTIFIED BY \"#{props['password']}\";' >> tmp/create_databases.sql")
21
23
  end
@@ -38,11 +40,22 @@ namespace :dad do
38
40
  system("echo 'flush privileges;' >> tmp/create_databases.sql")
39
41
  system("echo >> tmp/create_databases.sql")
40
42
 
43
+ options = []
44
+ if host
45
+ port ||= 3306 if host != 'localhost'
46
+ options << "-h #{host}"
47
+ options << "-P #{port}" if port
48
+ end
41
49
  if ENV['MYSQL_NO_ROOT_PASSWORD']
42
- fail unless system("mysql -u root < tmp/create_databases.sql")
50
+ options << '-u root'
43
51
  else
44
- fail unless system("mysql -u #{ENV['MYSQL_ROOT'] || 'root'} -p < tmp/create_databases.sql")
52
+ options << "-u #{ENV['MYSQL_ROOT'] || 'root'}"
53
+ options << '-p'
45
54
  end
55
+
56
+ command = "mysql #{options.join(' ')} < tmp/create_databases.sql"
57
+ puts command
58
+ fail unless system(command)
46
59
  end
47
60
  end
48
61
  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.17
4
+ version: 0.9.18
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-11 00:00:00.000000000 Z
11
+ date: 2025-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docker-api