phenix 0.7.0 → 1.0.1
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 +4 -4
- data/lib/phenix/version.rb +1 -1
- data/lib/phenix.rb +16 -9
- metadata +9 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e08178e36e4d3383fa93d7410ef0b870dd5549e50d69a79c8cf74b7e74d5110
|
4
|
+
data.tar.gz: 2387284ebdf301559fb301579254c31f40d279060b14ddb4daf279602656243e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c56dda05491a697ba6fd0444eacf0b19bbc69e18af43a05d731a5a4d30e41bb21759ab38be6ac23e7cd47e31a04be8cb3cd64d121a36affb1610b691ce2fb3d
|
7
|
+
data.tar.gz: 64d70cf6691b14b5b8ccdbcea277f9752daaa08f1652081f72dcc23db0d871d26c5395cd019d62f091b7304b5ce69854a6787eedf01c09892cf771e1fd53931c
|
data/lib/phenix/version.rb
CHANGED
data/lib/phenix.rb
CHANGED
@@ -42,9 +42,15 @@ module Phenix
|
|
42
42
|
private
|
43
43
|
|
44
44
|
def create_databases(with_schema)
|
45
|
+
# Ensure we've created _every_ database before attempting to populte them
|
46
|
+
# This avoids ActiveRecord caching issues if the cache maintains references
|
47
|
+
# to stale databases
|
45
48
|
for_each_database do |name, conf|
|
46
49
|
run_mysql_command(conf, "CREATE DATABASE IF NOT EXISTS #{conf['database']}")
|
47
|
-
|
50
|
+
end
|
51
|
+
|
52
|
+
for_each_database do |name, conf|
|
53
|
+
ActiveRecord::Base.establish_connection(conf)
|
48
54
|
populate_database if with_schema
|
49
55
|
end
|
50
56
|
end
|
@@ -64,7 +70,15 @@ module Phenix
|
|
64
70
|
end
|
65
71
|
|
66
72
|
def for_each_database
|
67
|
-
|
73
|
+
parse_configuration_hashes.each do |name, conf|
|
74
|
+
next if conf['database'].nil?
|
75
|
+
next if Phenix.skip_database.call(name, conf)
|
76
|
+
yield(name, conf)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
def parse_configuration_hashes
|
81
|
+
if ActiveRecord::VERSION::STRING < '6.1'
|
68
82
|
ActiveRecord::Base.configurations.to_h
|
69
83
|
else
|
70
84
|
# We need to get all the configurations and put them back into a hash
|
@@ -72,13 +86,6 @@ module Phenix
|
|
72
86
|
ActiveRecord::Base.configurations
|
73
87
|
.configurations
|
74
88
|
.map { |c| [c.env_name, c.configuration_hash.with_indifferent_access] }
|
75
|
-
.to_h
|
76
|
-
end
|
77
|
-
|
78
|
-
configuration_hashes.each do |name, conf|
|
79
|
-
next if conf['database'].nil?
|
80
|
-
next if Phenix.skip_database.call(name, conf)
|
81
|
-
yield(name, conf)
|
82
89
|
end
|
83
90
|
end
|
84
91
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phenix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pierre Schambacher
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
version: '4.2'
|
34
34
|
- - "<"
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: '
|
36
|
+
version: '7.1'
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '4.2'
|
44
44
|
- - "<"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
46
|
+
version: '7.1'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rake
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,20 +72,6 @@ dependencies:
|
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '3.4'
|
75
|
-
- !ruby/object:Gem::Dependency
|
76
|
-
name: wwtd
|
77
|
-
requirement: !ruby/object:Gem::Requirement
|
78
|
-
requirements:
|
79
|
-
- - ">="
|
80
|
-
- !ruby/object:Gem::Version
|
81
|
-
version: '0'
|
82
|
-
type: :development
|
83
|
-
prerelease: false
|
84
|
-
version_requirements: !ruby/object:Gem::Requirement
|
85
|
-
requirements:
|
86
|
-
- - ">="
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
version: '0'
|
89
75
|
- !ruby/object:Gem::Dependency
|
90
76
|
name: bump
|
91
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,7 +114,7 @@ dependencies:
|
|
128
114
|
- - ">="
|
129
115
|
- !ruby/object:Gem::Version
|
130
116
|
version: '0'
|
131
|
-
description:
|
117
|
+
description:
|
132
118
|
email:
|
133
119
|
- pschambacher@zendesk.com
|
134
120
|
executables: []
|
@@ -140,7 +126,7 @@ files:
|
|
140
126
|
homepage: https://github.com/zendesk/phenix
|
141
127
|
licenses: []
|
142
128
|
metadata: {}
|
143
|
-
post_install_message:
|
129
|
+
post_install_message:
|
144
130
|
rdoc_options: []
|
145
131
|
require_paths:
|
146
132
|
- lib
|
@@ -155,8 +141,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
141
|
- !ruby/object:Gem::Version
|
156
142
|
version: '0'
|
157
143
|
requirements: []
|
158
|
-
rubygems_version: 3.1.
|
159
|
-
signing_key:
|
144
|
+
rubygems_version: 3.1.6
|
145
|
+
signing_key:
|
160
146
|
specification_version: 4
|
161
147
|
summary: Read a dynamic database.yml file and allow you to drop/create the database
|
162
148
|
on demand.
|