schema_dev 3.10.1 → 3.12.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 +5 -5
- data/.travis.yml +0 -1
- data/README.md +5 -1
- data/lib/schema_dev/config.rb +7 -2
- data/lib/schema_dev/gemfiles.rb +1 -0
- data/lib/schema_dev/travis.rb +59 -5
- data/lib/schema_dev/version.rb +1 -1
- data/schema_dev.gemspec +1 -1
- data/spec/travis_spec.rb +257 -7
- data/templates/gem/Gemfile.erb +2 -1
- data/templates/gemfiles/activerecord-3.2/Gemfile.postgresql.erb +1 -1
- data/templates/gemfiles/activerecord-4.0/Gemfile.postgresql.erb +1 -1
- data/templates/gemfiles/activerecord-4.1/Gemfile.postgresql.erb +1 -1
- data/templates/gemfiles/activerecord-4.2.0/Gemfile.postgresql.erb +2 -2
- data/templates/gemfiles/activerecord-4.2.1/Gemfile.postgresql.erb +2 -2
- data/templates/gemfiles/activerecord-4.2.6/Gemfile.postgresql.erb +2 -2
- data/templates/gemfiles/activerecord-4.2/Gemfile.postgresql.erb +2 -2
- data/templates/gemfiles/activerecord-5.0.0/Gemfile.postgresql.erb +2 -2
- data/templates/gemfiles/activerecord-5.0.1/Gemfile.postgresql.erb +2 -2
- data/templates/gemfiles/activerecord-5.0.2/Gemfile.postgresql.erb +2 -2
- data/templates/gemfiles/activerecord-5.0.3/Gemfile.postgresql.erb +2 -2
- data/templates/gemfiles/activerecord-5.0/Gemfile.postgresql.erb +2 -2
- data/templates/gemfiles/activerecord-5.1.0/Gemfile.postgresql.erb +2 -2
- data/templates/gemfiles/activerecord-5.1.1/Gemfile.postgresql.erb +2 -2
- data/templates/gemfiles/activerecord-5.1/Gemfile.postgresql.erb +2 -2
- data/templates/gemfiles/activerecord-5.2/Gemfile.base.erb +3 -0
- data/templates/gemfiles/activerecord-5.2/Gemfile.mysql2.erb +10 -0
- data/templates/gemfiles/activerecord-5.2/Gemfile.postgresql.erb +10 -0
- data/templates/gemfiles/activerecord-5.2/Gemfile.sqlite3.erb +10 -0
- metadata +14 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 362bd5d5931c122827ecda97c7355d4df0d61e63b77f8f86acdb55d964b4f674
|
4
|
+
data.tar.gz: 24c7a1ebedfe28d0095a4884a0e183613319b3d56cda0940326d4fb82584bfcc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcaee40f224178a31816f74e5d35f8fee96b968026b8ad84c6131301cbd36c08bac6378143e52ba3371d77d9a81ded844ee0660c1df63193bce90c7fe539b5d0
|
7
|
+
data.tar.gz: 134ad4046ed2aebb0fac48094a5fa2a40808c8ddb7d77cd961ee89a89334b6fbc6aacf988a7b919a63bf8bc92aa9ed5b86c6e9fa7892453fa1ca56850db9af41
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -137,6 +137,11 @@ Which defines the rake task `create_databases` and also a task for travis-ci
|
|
137
137
|
|
138
138
|
Release notes for schema_dev versions:
|
139
139
|
|
140
|
+
* **3.12.1** - fix simple case when only one postgresql version
|
141
|
+
* **3.12.0** - support testing against multiple postgresql versions
|
142
|
+
* **3.11.2** - require tmpdir for access to mktmpdir
|
143
|
+
* **3.11.1** - Lock pg version for older AR versions
|
144
|
+
* **3.11.0** - Add support for AR 5.2
|
140
145
|
* **3.10.1** - Bug fix in rspec db connection; loosen dependency to 5.\*
|
141
146
|
* **3.10.0** - Add support for 5.1 (i.e. 5.1.\*) and lock down dependencies on *.*
|
142
147
|
* **3.9.0** - Add support for AR 5.0.2, 5.0.3, 5.1.0 and 5.1.1. Thanks to [@aliuk2012](https://github.com/aliuk2012)
|
@@ -147,5 +152,4 @@ Release notes for schema_dev versions:
|
|
147
152
|
* **3.6.2** - Fix README template error introduced in 3.6.0
|
148
153
|
* **3.6.1** - Further fix mysql2 dependencies.
|
149
154
|
* **3.6.0** - Add support for AR 4.2.6; fix mysql2 dependencies; internal improvements and bug fixes. Thanks to [@dmeranda](https://github.com/SchemaPlus/schema_dev/issues?q=is%3Apr+is%3Aopen+author%3Admeranda) and [@dholdren](https://github.com/SchemaPlus/schema_dev/issues?q=is%3Apr+is%3Aopen+author%3Adholdren)
|
150
|
-
G
|
151
155
|
|
data/lib/schema_dev/config.rb
CHANGED
@@ -12,7 +12,7 @@ module SchemaDev
|
|
12
12
|
|
13
13
|
class Config
|
14
14
|
|
15
|
-
attr_accessor :quick, :db, :ruby, :activerecord, :notify, :exclude
|
15
|
+
attr_accessor :quick, :db, :dbversions, :ruby, :activerecord, :notify, :exclude
|
16
16
|
|
17
17
|
def self._reset ; @@config = nil end # for use by rspec
|
18
18
|
|
@@ -25,10 +25,11 @@ module SchemaDev
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def initialize(opts={}) # once we no longer support ruby 1.9.3, can switch to native keyword args
|
28
|
-
opts = opts.keyword_args(ruby: :required, activerecord: :required, db: :required, exclude: nil, notify: nil, quick: nil)
|
28
|
+
opts = opts.keyword_args(ruby: :required, activerecord: :required, db: :required, dbversions: nil, exclude: nil, notify: nil, quick: nil)
|
29
29
|
@ruby = Array.wrap(opts.ruby)
|
30
30
|
@activerecord = Array.wrap(opts.activerecord)
|
31
31
|
@db = Array.wrap(opts.db)
|
32
|
+
@dbversions = (opts.dbversions || {}).symbolize_keys
|
32
33
|
@exclude = Array.wrap(opts.exclude).map(&:symbolize_keys).map {|tuple| Tuple.new(tuple)}
|
33
34
|
@notify = Array.wrap(opts.notify)
|
34
35
|
@quick = Array.wrap(opts.quick || {ruby: @ruby.last, activerecord: @activerecord.last, db: @db.last})
|
@@ -38,6 +39,10 @@ module SchemaDev
|
|
38
39
|
@dbms ||= [:postgresql, :mysql].select{|dbm| @db.grep(/^#{dbm}/).any?}
|
39
40
|
end
|
40
41
|
|
42
|
+
def dbms_versions_for(db, default = [])
|
43
|
+
@dbversions.fetch(db, default)
|
44
|
+
end
|
45
|
+
|
41
46
|
def matrix(opts={}) # once we no longer support ruby 1.9.3, can switch to native keyword args
|
42
47
|
opts = opts.keyword_args(quick: false, ruby: nil, activerecord: nil, db: nil, excluded: nil)
|
43
48
|
use_ruby = @ruby
|
data/lib/schema_dev/gemfiles.rb
CHANGED
data/lib/schema_dev/travis.rb
CHANGED
@@ -9,12 +9,63 @@ module SchemaDev
|
|
9
9
|
|
10
10
|
TRAVIS_FILE = ".travis.yml"
|
11
11
|
|
12
|
+
CONFIG_TEMPLATES = {
|
13
|
+
postgresql: {
|
14
|
+
default: {
|
15
|
+
env: 'POSTGRESQL_DB_USER=postgres'
|
16
|
+
},
|
17
|
+
'10' => {
|
18
|
+
addons: { apt: { packages: %w[postgresql-10 postgresql-client-10] } },
|
19
|
+
env: 'POSTGRESQL_DB_USER=postgres'
|
20
|
+
},
|
21
|
+
'11' => {
|
22
|
+
addons: { apt: { packages: %w[postgresql-11 postgresql-client-11] } },
|
23
|
+
env: 'POSTGRESQL_DB_USER=travis PGPORT=5433'
|
24
|
+
},
|
25
|
+
'12' => {
|
26
|
+
addons: { apt: { packages: %w[postgresql-12 postgresql-client-12] } },
|
27
|
+
env: 'POSTGRESQL_DB_USER=travis PGPORT=5433'
|
28
|
+
},
|
29
|
+
}
|
30
|
+
}.freeze
|
31
|
+
|
32
|
+
def template_for_db(db, version)
|
33
|
+
{
|
34
|
+
addons: {
|
35
|
+
db => version
|
36
|
+
}
|
37
|
+
}.deep_merge(CONFIG_TEMPLATES[db][version] || CONFIG_TEMPLATES[db][:default])
|
38
|
+
.deep_stringify_keys
|
39
|
+
end
|
40
|
+
|
12
41
|
def build(config)
|
13
42
|
env = []
|
43
|
+
include = []
|
14
44
|
addons = {}
|
15
45
|
if config.dbms.include?(:postgresql)
|
16
|
-
|
17
|
-
|
46
|
+
versions = config.dbms_versions_for(:postgresql, ['9.4'])
|
47
|
+
if config.dbms.count == 1
|
48
|
+
if versions.count == 1
|
49
|
+
# only PG and only 1 DB do it globally
|
50
|
+
template = template_for_db(:postgresql, versions.first)
|
51
|
+
env << template['env']
|
52
|
+
addons.merge!(template['addons'])
|
53
|
+
else
|
54
|
+
# we only have one DB so we can greatly simplify our include matrix
|
55
|
+
include.concat versions.map {|version|
|
56
|
+
{}.merge(template_for_db(:postgresql, version))
|
57
|
+
}
|
58
|
+
end
|
59
|
+
else
|
60
|
+
# we need to include against the various gemfiles so we only use PG for PG tests (and not other DBs)
|
61
|
+
config.matrix(db: 'postgresql', ruby: 'ignore').map { |entry|
|
62
|
+
include.concat versions.map {|version|
|
63
|
+
{
|
64
|
+
"gemfile" => GemfileSelector.gemfile(entry.slice(:activerecord, :db)).to_s,
|
65
|
+
}.merge(template_for_db(:postgresql, version))
|
66
|
+
}
|
67
|
+
}
|
68
|
+
end
|
18
69
|
end
|
19
70
|
if config.dbms.include?(:mysql)
|
20
71
|
env << 'MYSQL_DB_USER=travis'
|
@@ -26,11 +77,9 @@ module SchemaDev
|
|
26
77
|
exclude = config.matrix(excluded: :only).map { |entry| {}.tap {|ex|
|
27
78
|
ex["rvm"] = entry[:ruby]
|
28
79
|
ex["gemfile"] = GemfileSelector.gemfile(entry.slice(:activerecord, :db)).to_s
|
29
|
-
ex["env"] = env unless env.empty?
|
30
80
|
}}.reject{|ex| not gemfiles.include? ex["gemfile"]}
|
31
81
|
|
32
82
|
{}.tap { |travis|
|
33
|
-
travis["sudo"] = false
|
34
83
|
travis["rvm"] = config.ruby.sort
|
35
84
|
travis["gemfile"] = gemfiles.sort
|
36
85
|
travis["env"] = env unless env.empty?
|
@@ -41,7 +90,12 @@ module SchemaDev
|
|
41
90
|
end
|
42
91
|
travis["script"] = "bundle exec rake travis"
|
43
92
|
travis["notifications"] = { "email" => config.notify } if config.notify.any?
|
44
|
-
travis["
|
93
|
+
travis["jobs"] = {}
|
94
|
+
travis["jobs"]["exclude"] = exclude.sort_by{|ex| [ex["rvm"], ex["gemfile"]]} if exclude.any?
|
95
|
+
if include.any?
|
96
|
+
travis["jobs"]["include"] = include.sort_by{|ex| [ex["rvm"], ex["gemfile"]]}
|
97
|
+
end
|
98
|
+
travis.delete("jobs") if travis["jobs"].empty?
|
45
99
|
}
|
46
100
|
end
|
47
101
|
|
data/lib/schema_dev/version.rb
CHANGED
data/schema_dev.gemspec
CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |gem|
|
|
28
28
|
gem.add_dependency "thor", "~> 0.19"
|
29
29
|
gem.add_dependency "which_works", "~> 1.0"
|
30
30
|
|
31
|
-
gem.add_development_dependency "bundler"
|
31
|
+
gem.add_development_dependency "bundler"
|
32
32
|
gem.add_development_dependency "rake", "~> 10.0"
|
33
33
|
gem.add_development_dependency "rspec", "~> 3.0"
|
34
34
|
gem.add_development_dependency "rspec-given", "~> 3.8"
|
data/spec/travis_spec.rb
CHANGED
@@ -16,7 +16,6 @@ describe SchemaDev::Travis do
|
|
16
16
|
# Please do not edit this file; any changes will be overwritten next time
|
17
17
|
# schema_dev gets run.
|
18
18
|
---
|
19
|
-
sudo: false
|
20
19
|
rvm:
|
21
20
|
- 1.9.3
|
22
21
|
- 2.1.5
|
@@ -25,24 +24,275 @@ gemfile:
|
|
25
24
|
- gemfiles/activerecord-4.0/Gemfile.postgresql
|
26
25
|
- gemfiles/activerecord-4.1/Gemfile.mysql2
|
27
26
|
- gemfiles/activerecord-4.1/Gemfile.postgresql
|
28
|
-
env:
|
29
|
-
addons:
|
30
|
-
postgresql: '9.4'
|
27
|
+
env: MYSQL_DB_USER=travis
|
31
28
|
before_script: bundle exec rake create_databases
|
32
29
|
after_script: bundle exec rake drop_databases
|
33
30
|
script: bundle exec rake travis
|
34
31
|
notifications:
|
35
32
|
email:
|
36
33
|
- me@example.com
|
37
|
-
|
34
|
+
jobs:
|
35
|
+
exclude:
|
36
|
+
- rvm: 1.9.3
|
37
|
+
gemfile: gemfiles/activerecord-4.0/Gemfile.postgresql
|
38
|
+
- rvm: 1.9.3
|
39
|
+
gemfile: gemfiles/activerecord-4.1/Gemfile.postgresql
|
40
|
+
include:
|
41
|
+
- gemfile: gemfiles/activerecord-4.0/Gemfile.postgresql
|
42
|
+
addons:
|
43
|
+
postgresql: '9.4'
|
44
|
+
env: POSTGRESQL_DB_USER=postgres
|
45
|
+
- gemfile: gemfiles/activerecord-4.1/Gemfile.postgresql
|
46
|
+
addons:
|
47
|
+
postgresql: '9.4'
|
48
|
+
env: POSTGRESQL_DB_USER=postgres
|
49
|
+
ENDTRAVIS
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
context 'when only using postgresql and not overriding the version' do
|
54
|
+
it "creates travis file using the default PG version" do
|
55
|
+
config = get_config(ruby: %W[2.4.0],
|
56
|
+
activerecord: %W[4.1],
|
57
|
+
db: %W[postgresql])
|
58
|
+
in_tmpdir do
|
59
|
+
SchemaDev::Travis.update(config)
|
60
|
+
expect(Pathname.new(".travis.yml").read).to eq <<ENDTRAVIS
|
61
|
+
# This file was auto-generated by the schema_dev tool, based on the data in
|
62
|
+
# ./schema_dev.yml
|
63
|
+
# Please do not edit this file; any changes will be overwritten next time
|
64
|
+
# schema_dev gets run.
|
65
|
+
---
|
66
|
+
rvm:
|
67
|
+
- 2.4.0
|
68
|
+
gemfile:
|
69
|
+
- gemfiles/activerecord-4.1/Gemfile.postgresql
|
70
|
+
env: POSTGRESQL_DB_USER=postgres
|
71
|
+
addons:
|
72
|
+
postgresql: '9.4'
|
73
|
+
before_script: bundle exec rake create_databases
|
74
|
+
after_script: bundle exec rake drop_databases
|
75
|
+
script: bundle exec rake travis
|
76
|
+
ENDTRAVIS
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
context 'when specifying a single postgresql version' do
|
82
|
+
it "creates travis file using that as the PG version" do
|
83
|
+
config = get_config(ruby: %W[2.4.0],
|
84
|
+
activerecord: %W[4.1],
|
85
|
+
db: %W[mysql2 postgresql],
|
86
|
+
dbversions: {postgresql: %W[9.6]})
|
87
|
+
in_tmpdir do
|
88
|
+
SchemaDev::Travis.update(config)
|
89
|
+
expect(Pathname.new(".travis.yml").read).to eq <<ENDTRAVIS
|
90
|
+
# This file was auto-generated by the schema_dev tool, based on the data in
|
91
|
+
# ./schema_dev.yml
|
92
|
+
# Please do not edit this file; any changes will be overwritten next time
|
93
|
+
# schema_dev gets run.
|
94
|
+
---
|
95
|
+
rvm:
|
96
|
+
- 2.4.0
|
97
|
+
gemfile:
|
98
|
+
- gemfiles/activerecord-4.1/Gemfile.mysql2
|
99
|
+
- gemfiles/activerecord-4.1/Gemfile.postgresql
|
100
|
+
env: MYSQL_DB_USER=travis
|
101
|
+
before_script: bundle exec rake create_databases
|
102
|
+
after_script: bundle exec rake drop_databases
|
103
|
+
script: bundle exec rake travis
|
104
|
+
jobs:
|
105
|
+
include:
|
106
|
+
- gemfile: gemfiles/activerecord-4.1/Gemfile.postgresql
|
107
|
+
addons:
|
108
|
+
postgresql: '9.6'
|
109
|
+
env: POSTGRESQL_DB_USER=postgres
|
110
|
+
ENDTRAVIS
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
context 'when specifying multiple postgresql versions with excludes' do
|
116
|
+
it "creates travis file including those variants for postgresql versions" do
|
117
|
+
config = get_config(ruby: %W[1.9.3 2.1.5 2.4.0],
|
118
|
+
activerecord: %W[4.0 4.1],
|
119
|
+
db: %W[mysql2 postgresql],
|
120
|
+
dbversions: {postgresql: %W[9.6 10 11]},
|
121
|
+
exclude: [{ ruby: "1.9.3", db: "postgresql" }])
|
122
|
+
in_tmpdir do
|
123
|
+
SchemaDev::Travis.update(config)
|
124
|
+
expect(Pathname.new(".travis.yml").read).to eq <<ENDTRAVIS
|
125
|
+
# This file was auto-generated by the schema_dev tool, based on the data in
|
126
|
+
# ./schema_dev.yml
|
127
|
+
# Please do not edit this file; any changes will be overwritten next time
|
128
|
+
# schema_dev gets run.
|
129
|
+
---
|
130
|
+
rvm:
|
131
|
+
- 1.9.3
|
132
|
+
- 2.1.5
|
133
|
+
- 2.4.0
|
134
|
+
gemfile:
|
135
|
+
- gemfiles/activerecord-4.0/Gemfile.mysql2
|
136
|
+
- gemfiles/activerecord-4.0/Gemfile.postgresql
|
137
|
+
- gemfiles/activerecord-4.1/Gemfile.mysql2
|
138
|
+
- gemfiles/activerecord-4.1/Gemfile.postgresql
|
139
|
+
env: MYSQL_DB_USER=travis
|
140
|
+
before_script: bundle exec rake create_databases
|
141
|
+
after_script: bundle exec rake drop_databases
|
142
|
+
script: bundle exec rake travis
|
143
|
+
jobs:
|
38
144
|
exclude:
|
39
145
|
- rvm: 1.9.3
|
40
146
|
gemfile: gemfiles/activerecord-4.0/Gemfile.postgresql
|
41
|
-
env: POSTGRESQL_DB_USER=postgres MYSQL_DB_USER=travis
|
42
147
|
- rvm: 1.9.3
|
43
148
|
gemfile: gemfiles/activerecord-4.1/Gemfile.postgresql
|
44
|
-
|
149
|
+
include:
|
150
|
+
- gemfile: gemfiles/activerecord-4.0/Gemfile.postgresql
|
151
|
+
addons:
|
152
|
+
postgresql: '9.6'
|
153
|
+
env: POSTGRESQL_DB_USER=postgres
|
154
|
+
- gemfile: gemfiles/activerecord-4.0/Gemfile.postgresql
|
155
|
+
addons:
|
156
|
+
postgresql: '10'
|
157
|
+
apt:
|
158
|
+
packages:
|
159
|
+
- postgresql-10
|
160
|
+
- postgresql-client-10
|
161
|
+
env: POSTGRESQL_DB_USER=postgres
|
162
|
+
- gemfile: gemfiles/activerecord-4.0/Gemfile.postgresql
|
163
|
+
addons:
|
164
|
+
postgresql: '11'
|
165
|
+
apt:
|
166
|
+
packages:
|
167
|
+
- postgresql-11
|
168
|
+
- postgresql-client-11
|
169
|
+
env: POSTGRESQL_DB_USER=travis PGPORT=5433
|
170
|
+
- gemfile: gemfiles/activerecord-4.1/Gemfile.postgresql
|
171
|
+
addons:
|
172
|
+
postgresql: '9.6'
|
173
|
+
env: POSTGRESQL_DB_USER=postgres
|
174
|
+
- gemfile: gemfiles/activerecord-4.1/Gemfile.postgresql
|
175
|
+
addons:
|
176
|
+
postgresql: '10'
|
177
|
+
apt:
|
178
|
+
packages:
|
179
|
+
- postgresql-10
|
180
|
+
- postgresql-client-10
|
181
|
+
env: POSTGRESQL_DB_USER=postgres
|
182
|
+
- gemfile: gemfiles/activerecord-4.1/Gemfile.postgresql
|
183
|
+
addons:
|
184
|
+
postgresql: '11'
|
185
|
+
apt:
|
186
|
+
packages:
|
187
|
+
- postgresql-11
|
188
|
+
- postgresql-client-11
|
189
|
+
env: POSTGRESQL_DB_USER=travis PGPORT=5433
|
190
|
+
ENDTRAVIS
|
191
|
+
end
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
context 'when specifying only postgresql as the db with versions' do
|
196
|
+
it "creates travis file including only addon variants" do
|
197
|
+
config = get_config(ruby: %W[2.1.5 2.4.0],
|
198
|
+
activerecord: %W[4.0 4.1],
|
199
|
+
db: %W[postgresql],
|
200
|
+
dbversions: {postgresql: %W[9.6 10 11]})
|
201
|
+
in_tmpdir do
|
202
|
+
SchemaDev::Travis.update(config)
|
203
|
+
expect(Pathname.new(".travis.yml").read).to eq <<ENDTRAVIS
|
204
|
+
# This file was auto-generated by the schema_dev tool, based on the data in
|
205
|
+
# ./schema_dev.yml
|
206
|
+
# Please do not edit this file; any changes will be overwritten next time
|
207
|
+
# schema_dev gets run.
|
208
|
+
---
|
209
|
+
rvm:
|
210
|
+
- 2.1.5
|
211
|
+
- 2.4.0
|
212
|
+
gemfile:
|
213
|
+
- gemfiles/activerecord-4.0/Gemfile.postgresql
|
214
|
+
- gemfiles/activerecord-4.1/Gemfile.postgresql
|
215
|
+
before_script: bundle exec rake create_databases
|
216
|
+
after_script: bundle exec rake drop_databases
|
217
|
+
script: bundle exec rake travis
|
218
|
+
jobs:
|
219
|
+
include:
|
220
|
+
- addons:
|
221
|
+
postgresql: '9.6'
|
222
|
+
env: POSTGRESQL_DB_USER=postgres
|
223
|
+
- addons:
|
224
|
+
postgresql: '10'
|
225
|
+
apt:
|
226
|
+
packages:
|
227
|
+
- postgresql-10
|
228
|
+
- postgresql-client-10
|
229
|
+
env: POSTGRESQL_DB_USER=postgres
|
230
|
+
- addons:
|
231
|
+
postgresql: '11'
|
232
|
+
apt:
|
233
|
+
packages:
|
234
|
+
- postgresql-11
|
235
|
+
- postgresql-client-11
|
236
|
+
env: POSTGRESQL_DB_USER=travis PGPORT=5433
|
237
|
+
ENDTRAVIS
|
238
|
+
end
|
239
|
+
end
|
240
|
+
end
|
241
|
+
|
242
|
+
context 'when specifying multiple postgresql versions' do
|
243
|
+
it "creates travis file including those variants for postgresql versions" do
|
244
|
+
config = get_config(ruby: %W[2.1.5 2.4.0],
|
245
|
+
activerecord: %W[4.0 4.1],
|
246
|
+
db: %W[mysql2 postgresql],
|
247
|
+
dbversions: {postgresql: %W[9.6 10]})
|
248
|
+
in_tmpdir do
|
249
|
+
SchemaDev::Travis.update(config)
|
250
|
+
expect(Pathname.new(".travis.yml").read).to eq <<ENDTRAVIS
|
251
|
+
# This file was auto-generated by the schema_dev tool, based on the data in
|
252
|
+
# ./schema_dev.yml
|
253
|
+
# Please do not edit this file; any changes will be overwritten next time
|
254
|
+
# schema_dev gets run.
|
255
|
+
---
|
256
|
+
rvm:
|
257
|
+
- 2.1.5
|
258
|
+
- 2.4.0
|
259
|
+
gemfile:
|
260
|
+
- gemfiles/activerecord-4.0/Gemfile.mysql2
|
261
|
+
- gemfiles/activerecord-4.0/Gemfile.postgresql
|
262
|
+
- gemfiles/activerecord-4.1/Gemfile.mysql2
|
263
|
+
- gemfiles/activerecord-4.1/Gemfile.postgresql
|
264
|
+
env: MYSQL_DB_USER=travis
|
265
|
+
before_script: bundle exec rake create_databases
|
266
|
+
after_script: bundle exec rake drop_databases
|
267
|
+
script: bundle exec rake travis
|
268
|
+
jobs:
|
269
|
+
include:
|
270
|
+
- gemfile: gemfiles/activerecord-4.0/Gemfile.postgresql
|
271
|
+
addons:
|
272
|
+
postgresql: '9.6'
|
273
|
+
env: POSTGRESQL_DB_USER=postgres
|
274
|
+
- gemfile: gemfiles/activerecord-4.0/Gemfile.postgresql
|
275
|
+
addons:
|
276
|
+
postgresql: '10'
|
277
|
+
apt:
|
278
|
+
packages:
|
279
|
+
- postgresql-10
|
280
|
+
- postgresql-client-10
|
281
|
+
env: POSTGRESQL_DB_USER=postgres
|
282
|
+
- gemfile: gemfiles/activerecord-4.1/Gemfile.postgresql
|
283
|
+
addons:
|
284
|
+
postgresql: '9.6'
|
285
|
+
env: POSTGRESQL_DB_USER=postgres
|
286
|
+
- gemfile: gemfiles/activerecord-4.1/Gemfile.postgresql
|
287
|
+
addons:
|
288
|
+
postgresql: '10'
|
289
|
+
apt:
|
290
|
+
packages:
|
291
|
+
- postgresql-10
|
292
|
+
- postgresql-client-10
|
293
|
+
env: POSTGRESQL_DB_USER=postgres
|
45
294
|
ENDTRAVIS
|
295
|
+
end
|
46
296
|
end
|
47
297
|
end
|
48
298
|
end
|
data/templates/gem/Gemfile.erb
CHANGED
@@ -2,4 +2,5 @@ source "http://rubygems.org"
|
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
|
5
|
+
gemfile_local = File.expand_path '../Gemfile.local', __FILE__
|
6
|
+
eval File.read(gemfile_local), binding, gemfile_local if File.exist? gemfile_local
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: schema_dev
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ronen barzel
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -140,16 +140,16 @@ dependencies:
|
|
140
140
|
name: bundler
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- - "
|
143
|
+
- - ">="
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: '
|
145
|
+
version: '0'
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- - "
|
150
|
+
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: '
|
152
|
+
version: '0'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: rake
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -340,6 +340,10 @@ files:
|
|
340
340
|
- templates/gemfiles/activerecord-5.1/Gemfile.mysql2.erb
|
341
341
|
- templates/gemfiles/activerecord-5.1/Gemfile.postgresql.erb
|
342
342
|
- templates/gemfiles/activerecord-5.1/Gemfile.sqlite3.erb
|
343
|
+
- templates/gemfiles/activerecord-5.2/Gemfile.base.erb
|
344
|
+
- templates/gemfiles/activerecord-5.2/Gemfile.mysql2.erb
|
345
|
+
- templates/gemfiles/activerecord-5.2/Gemfile.postgresql.erb
|
346
|
+
- templates/gemfiles/activerecord-5.2/Gemfile.sqlite3.erb
|
343
347
|
- templates/gemfiles/activerecord-edge/Gemfile.base.erb
|
344
348
|
- templates/gemfiles/activerecord-edge/Gemfile.mysql2.erb
|
345
349
|
- templates/gemfiles/activerecord-edge/Gemfile.postgresql.erb
|
@@ -348,7 +352,7 @@ homepage: https://github.com/SchemaPlus/schema_dev
|
|
348
352
|
licenses:
|
349
353
|
- MIT
|
350
354
|
metadata: {}
|
351
|
-
post_install_message:
|
355
|
+
post_install_message:
|
352
356
|
rdoc_options: []
|
353
357
|
require_paths:
|
354
358
|
- lib
|
@@ -363,9 +367,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
363
367
|
- !ruby/object:Gem::Version
|
364
368
|
version: '0'
|
365
369
|
requirements: []
|
366
|
-
|
367
|
-
|
368
|
-
signing_key:
|
370
|
+
rubygems_version: 3.0.8
|
371
|
+
signing_key:
|
369
372
|
specification_version: 4
|
370
373
|
summary: SchemaPlus development tools
|
371
374
|
test_files:
|