daddy 0.9.17 → 0.9.19

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: 8afdb5ea89039780e28fddb7b0f9207319e68d3e42fbbda575ec00dceafffd65
4
+ data.tar.gz: ddad8d477dcd8c2c1773222fe83f0df6c25d7c2d647ba369b4e3e0eb50d93898
5
5
  SHA512:
6
- metadata.gz: 6104f6985d62771b44c0a45d0e21f7d940b7cacc5c88432dbc6d6eaca26f0f2cfd55875027f9d4f82ee832471bd388614e356c4cf5abae3f8595c24b87934811
7
- data.tar.gz: 73b78f59158b82056e5bd57e12733d2e62825dd145a5bd6f86a5eb33ef232ed2fe85f804ca25ba03c324c76777f5ce52b58dadd58ea6d71ca32812f2d656a2cb
6
+ metadata.gz: 5e8b43e70d3fa666747e0d327d37c6e5a3f2e9cd71e70e276759f2845cf9c3881413a9085f9d5c553e2c7af69918621fec72a8534df7683ff224edc0a5233637
7
+ data.tar.gz: 64214417f6bf850eedccde4c1fecca0fb08ba8a2cd384e3ff2591ffac9987ca711e54273051c1748f415e0a418eb2c6d6575b0987bf4452c1feab92ede0dcc68
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 = '19'
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,20 @@ namespace :dad do
38
40
  system("echo 'flush privileges;' >> tmp/create_databases.sql")
39
41
  system("echo >> tmp/create_databases.sql")
40
42
 
41
- if ENV['MYSQL_NO_ROOT_PASSWORD']
42
- fail unless system("mysql -u root < tmp/create_databases.sql")
43
- else
44
- fail unless system("mysql -u #{ENV['MYSQL_ROOT'] || 'root'} -p < tmp/create_databases.sql")
43
+ options = []
44
+ if host
45
+ port ||= 3306 if host != 'localhost'
46
+ options << "-h #{host}"
47
+ options << "-P #{port}" if port
45
48
  end
49
+ options << "-u #{ENV['MYSQL_ROOT'] || 'root'}"
50
+ unless ENV['MYSQL_ALLOW_EMPTY_PASSWORD']
51
+ options << '-p'
52
+ end
53
+
54
+ command = "mysql #{options.join(' ')} < tmp/create_databases.sql"
55
+ puts command
56
+ fail unless system(command)
46
57
  end
47
58
  end
48
59
  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.19
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