schema_dev 3.13.0 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/prs.yml +49 -0
  3. data/.simplecov +20 -0
  4. data/Gemfile +2 -0
  5. data/README.md +12 -10
  6. data/Rakefile +3 -5
  7. data/bin/schema_dev +25 -21
  8. data/lib/schema_dev/config.rb +62 -44
  9. data/lib/schema_dev/executor.rb +9 -8
  10. data/lib/schema_dev/gem.rb +45 -37
  11. data/lib/schema_dev/gemfile_selector.rb +7 -7
  12. data/lib/schema_dev/gemfiles.rb +6 -5
  13. data/lib/schema_dev/github_actions.rb +266 -0
  14. data/lib/schema_dev/matrix_executor.rb +4 -2
  15. data/lib/schema_dev/readme.rb +17 -10
  16. data/lib/schema_dev/rspec/db.rb +44 -33
  17. data/lib/schema_dev/rspec.rb +4 -9
  18. data/lib/schema_dev/ruby_selector.rb +29 -14
  19. data/lib/schema_dev/runner.rb +14 -10
  20. data/lib/schema_dev/tasks/dbms.rb +34 -26
  21. data/lib/schema_dev/tasks.rb +2 -3
  22. data/lib/schema_dev/templates.rb +5 -5
  23. data/lib/schema_dev/version.rb +3 -1
  24. data/lib/schema_dev.rb +3 -1
  25. data/schema_dev.gemspec +24 -25
  26. data/spec/schema_dev/config_spec.rb +60 -0
  27. data/spec/schema_dev/gem_spec.rb +74 -0
  28. data/spec/schema_dev/gemfile_selector_spec.rb +11 -0
  29. data/spec/schema_dev/gemfiles_spec.rb +41 -0
  30. data/spec/schema_dev/github_actions_spec.rb +818 -0
  31. data/spec/schema_dev/runner_spec.rb +103 -0
  32. data/spec/spec_helper.rb +5 -6
  33. data/templates/README/uses.schema_dev.md.erb +1 -2
  34. data/templates/gem/GEM_NAME.gemspec.erb +15 -14
  35. data/templates/gem/Gemfile.erb +2 -0
  36. data/templates/gem/Gemfile.local.erb +2 -0
  37. data/templates/gem/README.md.erb +1 -2
  38. data/templates/gem/Rakefile.erb +2 -0
  39. data/templates/gem/schema_dev.yml.erb +5 -2
  40. data/templates/gem/simplecov.erb +20 -0
  41. data/templates/gemfiles/Gemfile.base.erb +1 -1
  42. data/templates/gemfiles/activerecord-5.2/Gemfile.base.erb +2 -1
  43. data/templates/gemfiles/activerecord-5.2/Gemfile.mysql2.erb +2 -2
  44. data/templates/gemfiles/activerecord-5.2/Gemfile.postgresql.erb +2 -2
  45. data/templates/gemfiles/activerecord-5.2/Gemfile.sqlite3.erb +3 -3
  46. data/templates/gemfiles/activerecord-6.0/Gemfile.base.erb +4 -0
  47. data/templates/gemfiles/activerecord-6.0/Gemfile.mysql2.erb +10 -0
  48. data/templates/gemfiles/activerecord-6.0/Gemfile.postgresql.erb +10 -0
  49. data/templates/gemfiles/{activerecord-3.2 → activerecord-6.0}/Gemfile.sqlite3.erb +2 -2
  50. data/templates/gemfiles/activerecord-6.1/Gemfile.base.erb +4 -0
  51. data/templates/gemfiles/activerecord-6.1/Gemfile.mysql2.erb +10 -0
  52. data/templates/gemfiles/activerecord-6.1/Gemfile.postgresql.erb +10 -0
  53. data/templates/gemfiles/{activerecord-4.0 → activerecord-6.1}/Gemfile.sqlite3.erb +2 -2
  54. metadata +56 -156
  55. data/.travis.yml +0 -4
  56. data/lib/schema_dev/tasks/coveralls.rb +0 -3
  57. data/lib/schema_dev/travis.rb +0 -118
  58. data/spec/config_spec.rb +0 -61
  59. data/spec/gem_spec.rb +0 -77
  60. data/spec/gemfile_sepector_spec.rb +0 -10
  61. data/spec/gemfiles_spec.rb +0 -43
  62. data/spec/runner_spec.rb +0 -106
  63. data/spec/travis_spec.rb +0 -298
  64. data/templates/gemfiles/activerecord-3.2/Gemfile.base.erb +0 -3
  65. data/templates/gemfiles/activerecord-3.2/Gemfile.mysql.erb +0 -10
  66. data/templates/gemfiles/activerecord-3.2/Gemfile.mysql2.erb +0 -10
  67. data/templates/gemfiles/activerecord-3.2/Gemfile.postgresql.erb +0 -10
  68. data/templates/gemfiles/activerecord-4.0/Gemfile.base.erb +0 -3
  69. data/templates/gemfiles/activerecord-4.0/Gemfile.mysql2.erb +0 -10
  70. data/templates/gemfiles/activerecord-4.0/Gemfile.postgresql.erb +0 -10
  71. data/templates/gemfiles/activerecord-4.1/Gemfile.base.erb +0 -3
  72. data/templates/gemfiles/activerecord-4.1/Gemfile.mysql2.erb +0 -10
  73. data/templates/gemfiles/activerecord-4.1/Gemfile.postgresql.erb +0 -10
  74. data/templates/gemfiles/activerecord-4.1/Gemfile.sqlite3.erb +0 -10
  75. data/templates/gemfiles/activerecord-4.2/Gemfile.base.erb +0 -3
  76. data/templates/gemfiles/activerecord-4.2/Gemfile.mysql2.erb +0 -10
  77. data/templates/gemfiles/activerecord-4.2/Gemfile.postgresql.erb +0 -10
  78. data/templates/gemfiles/activerecord-4.2/Gemfile.sqlite3.erb +0 -10
  79. data/templates/gemfiles/activerecord-4.2.0/Gemfile.base.erb +0 -3
  80. data/templates/gemfiles/activerecord-4.2.0/Gemfile.mysql2.erb +0 -10
  81. data/templates/gemfiles/activerecord-4.2.0/Gemfile.postgresql.erb +0 -10
  82. data/templates/gemfiles/activerecord-4.2.0/Gemfile.sqlite3.erb +0 -10
  83. data/templates/gemfiles/activerecord-4.2.1/Gemfile.base.erb +0 -3
  84. data/templates/gemfiles/activerecord-4.2.1/Gemfile.mysql2.erb +0 -10
  85. data/templates/gemfiles/activerecord-4.2.1/Gemfile.postgresql.erb +0 -10
  86. data/templates/gemfiles/activerecord-4.2.1/Gemfile.sqlite3.erb +0 -10
  87. data/templates/gemfiles/activerecord-4.2.6/Gemfile.base.erb +0 -3
  88. data/templates/gemfiles/activerecord-4.2.6/Gemfile.mysql2.erb +0 -10
  89. data/templates/gemfiles/activerecord-4.2.6/Gemfile.postgresql.erb +0 -10
  90. data/templates/gemfiles/activerecord-4.2.6/Gemfile.sqlite3.erb +0 -10
  91. data/templates/gemfiles/activerecord-5.0/Gemfile.base.erb +0 -3
  92. data/templates/gemfiles/activerecord-5.0/Gemfile.mysql2.erb +0 -10
  93. data/templates/gemfiles/activerecord-5.0/Gemfile.postgresql.erb +0 -10
  94. data/templates/gemfiles/activerecord-5.0/Gemfile.sqlite3.erb +0 -10
  95. data/templates/gemfiles/activerecord-5.0.0/Gemfile.base.erb +0 -3
  96. data/templates/gemfiles/activerecord-5.0.0/Gemfile.mysql2.erb +0 -10
  97. data/templates/gemfiles/activerecord-5.0.0/Gemfile.postgresql.erb +0 -10
  98. data/templates/gemfiles/activerecord-5.0.0/Gemfile.sqlite3.erb +0 -10
  99. data/templates/gemfiles/activerecord-5.0.1/Gemfile.base.erb +0 -3
  100. data/templates/gemfiles/activerecord-5.0.1/Gemfile.mysql2.erb +0 -10
  101. data/templates/gemfiles/activerecord-5.0.1/Gemfile.postgresql.erb +0 -10
  102. data/templates/gemfiles/activerecord-5.0.1/Gemfile.sqlite3.erb +0 -10
  103. data/templates/gemfiles/activerecord-5.0.2/Gemfile.base.erb +0 -3
  104. data/templates/gemfiles/activerecord-5.0.2/Gemfile.mysql2.erb +0 -10
  105. data/templates/gemfiles/activerecord-5.0.2/Gemfile.postgresql.erb +0 -10
  106. data/templates/gemfiles/activerecord-5.0.2/Gemfile.sqlite3.erb +0 -10
  107. data/templates/gemfiles/activerecord-5.0.3/Gemfile.base.erb +0 -3
  108. data/templates/gemfiles/activerecord-5.0.3/Gemfile.mysql2.erb +0 -10
  109. data/templates/gemfiles/activerecord-5.0.3/Gemfile.postgresql.erb +0 -10
  110. data/templates/gemfiles/activerecord-5.0.3/Gemfile.sqlite3.erb +0 -10
  111. data/templates/gemfiles/activerecord-5.1/Gemfile.base.erb +0 -3
  112. data/templates/gemfiles/activerecord-5.1/Gemfile.mysql2.erb +0 -10
  113. data/templates/gemfiles/activerecord-5.1/Gemfile.postgresql.erb +0 -10
  114. data/templates/gemfiles/activerecord-5.1/Gemfile.sqlite3.erb +0 -10
  115. data/templates/gemfiles/activerecord-5.1.0/Gemfile.base.erb +0 -3
  116. data/templates/gemfiles/activerecord-5.1.0/Gemfile.mysql2.erb +0 -10
  117. data/templates/gemfiles/activerecord-5.1.0/Gemfile.postgresql.erb +0 -10
  118. data/templates/gemfiles/activerecord-5.1.0/Gemfile.sqlite3.erb +0 -10
  119. data/templates/gemfiles/activerecord-5.1.1/Gemfile.base.erb +0 -3
  120. data/templates/gemfiles/activerecord-5.1.1/Gemfile.mysql2.erb +0 -10
  121. data/templates/gemfiles/activerecord-5.1.1/Gemfile.postgresql.erb +0 -10
  122. data/templates/gemfiles/activerecord-5.1.1/Gemfile.sqlite3.erb +0 -10
  123. data/templates/gemfiles/activerecord-edge/Gemfile.base.erb +0 -3
  124. data/templates/gemfiles/activerecord-edge/Gemfile.mysql2.erb +0 -10
  125. data/templates/gemfiles/activerecord-edge/Gemfile.postgresql.erb +0 -10
  126. data/templates/gemfiles/activerecord-edge/Gemfile.sqlite3.erb +0 -10
metadata CHANGED
@@ -1,59 +1,37 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schema_dev
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.13.0
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ronen barzel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-13 00:00:00.000000000 Z
11
+ date: 2022-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '5.0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
19
+ version: '5.2'
20
+ - - "<"
25
21
  - !ruby/object:Gem::Version
26
- version: '5.0'
27
- - !ruby/object:Gem::Dependency
28
- name: coveralls_reborn
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '0.23'
22
+ version: '6.2'
34
23
  type: :runtime
35
24
  prerelease: false
36
25
  version_requirements: !ruby/object:Gem::Requirement
37
26
  requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '0.23'
41
- - !ruby/object:Gem::Dependency
42
- name: faraday
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
27
+ - - ">="
46
28
  - !ruby/object:Gem::Version
47
- version: '0.9'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
29
+ version: '5.2'
30
+ - - "<"
53
31
  - !ruby/object:Gem::Version
54
- version: '0.9'
32
+ version: '6.2'
55
33
  - !ruby/object:Gem::Dependency
56
- name: fastandand
34
+ name: faraday
57
35
  requirement: !ruby/object:Gem::Requirement
58
36
  requirements:
59
37
  - - "~>"
@@ -67,61 +45,53 @@ dependencies:
67
45
  - !ruby/object:Gem::Version
68
46
  version: '1.0'
69
47
  - !ruby/object:Gem::Dependency
70
- name: hash_keyword_args
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '0.1'
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '0.1'
83
- - !ruby/object:Gem::Dependency
84
- name: its-it
48
+ name: simplecov
85
49
  requirement: !ruby/object:Gem::Requirement
86
50
  requirements:
87
- - - "~>"
51
+ - - ">="
88
52
  - !ruby/object:Gem::Version
89
- version: '1.3'
53
+ version: '0'
90
54
  type: :runtime
91
55
  prerelease: false
92
56
  version_requirements: !ruby/object:Gem::Requirement
93
57
  requirements:
94
- - - "~>"
58
+ - - ">="
95
59
  - !ruby/object:Gem::Version
96
- version: '1.3'
60
+ version: '0'
97
61
  - !ruby/object:Gem::Dependency
98
- name: key_struct
62
+ name: simplecov-lcov
99
63
  requirement: !ruby/object:Gem::Requirement
100
64
  requirements:
101
65
  - - "~>"
102
66
  - !ruby/object:Gem::Version
103
- version: '0.4'
67
+ version: 0.8.0
104
68
  type: :runtime
105
69
  prerelease: false
106
70
  version_requirements: !ruby/object:Gem::Requirement
107
71
  requirements:
108
72
  - - "~>"
109
73
  - !ruby/object:Gem::Version
110
- version: '0.4'
74
+ version: 0.8.0
111
75
  - !ruby/object:Gem::Dependency
112
76
  name: thor
113
77
  requirement: !ruby/object:Gem::Requirement
114
78
  requirements:
115
- - - "~>"
79
+ - - ">="
116
80
  - !ruby/object:Gem::Version
117
81
  version: '0.19'
82
+ - - "<"
83
+ - !ruby/object:Gem::Version
84
+ version: '2.0'
118
85
  type: :runtime
119
86
  prerelease: false
120
87
  version_requirements: !ruby/object:Gem::Requirement
121
88
  requirements:
122
- - - "~>"
89
+ - - ">="
123
90
  - !ruby/object:Gem::Version
124
91
  version: '0.19'
92
+ - - "<"
93
+ - !ruby/object:Gem::Version
94
+ version: '2.0'
125
95
  - !ruby/object:Gem::Dependency
126
96
  name: which_works
127
97
  requirement: !ruby/object:Gem::Requirement
@@ -156,14 +126,14 @@ dependencies:
156
126
  requirements:
157
127
  - - "~>"
158
128
  - !ruby/object:Gem::Version
159
- version: '10.0'
129
+ version: '13.0'
160
130
  type: :development
161
131
  prerelease: false
162
132
  version_requirements: !ruby/object:Gem::Requirement
163
133
  requirements:
164
134
  - - "~>"
165
135
  - !ruby/object:Gem::Version
166
- version: '10.0'
136
+ version: '13.0'
167
137
  - !ruby/object:Gem::Dependency
168
138
  name: rspec
169
139
  requirement: !ruby/object:Gem::Requirement
@@ -192,34 +162,20 @@ dependencies:
192
162
  - - "~>"
193
163
  - !ruby/object:Gem::Version
194
164
  version: '3.8'
195
- - !ruby/object:Gem::Dependency
196
- name: simplecov
197
- requirement: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - ">="
200
- - !ruby/object:Gem::Version
201
- version: '0'
202
- type: :development
203
- prerelease: false
204
- version_requirements: !ruby/object:Gem::Requirement
205
- requirements:
206
- - - ">="
207
- - !ruby/object:Gem::Version
208
- version: '0'
209
165
  - !ruby/object:Gem::Dependency
210
166
  name: webmock
211
167
  requirement: !ruby/object:Gem::Requirement
212
168
  requirements:
213
169
  - - "~>"
214
170
  - !ruby/object:Gem::Version
215
- version: '2.1'
171
+ version: '3.0'
216
172
  type: :development
217
173
  prerelease: false
218
174
  version_requirements: !ruby/object:Gem::Requirement
219
175
  requirements:
220
176
  - - "~>"
221
177
  - !ruby/object:Gem::Version
222
- version: '2.1'
178
+ version: '3.0'
223
179
  description: SchemaPlus development tools
224
180
  email:
225
181
  - ronen@barzel.org
@@ -228,9 +184,10 @@ executables:
228
184
  extensions: []
229
185
  extra_rdoc_files: []
230
186
  files:
187
+ - ".github/workflows/prs.yml"
231
188
  - ".gitignore"
232
189
  - ".rspec"
233
- - ".travis.yml"
190
+ - ".simplecov"
234
191
  - Gemfile
235
192
  - LICENSE.txt
236
193
  - README.md
@@ -242,6 +199,7 @@ files:
242
199
  - lib/schema_dev/gem.rb
243
200
  - lib/schema_dev/gemfile_selector.rb
244
201
  - lib/schema_dev/gemfiles.rb
202
+ - lib/schema_dev/github_actions.rb
245
203
  - lib/schema_dev/matrix_executor.rb
246
204
  - lib/schema_dev/readme.rb
247
205
  - lib/schema_dev/rspec.rb
@@ -249,19 +207,17 @@ files:
249
207
  - lib/schema_dev/ruby_selector.rb
250
208
  - lib/schema_dev/runner.rb
251
209
  - lib/schema_dev/tasks.rb
252
- - lib/schema_dev/tasks/coveralls.rb
253
210
  - lib/schema_dev/tasks/dbms.rb
254
211
  - lib/schema_dev/templates.rb
255
- - lib/schema_dev/travis.rb
256
212
  - lib/schema_dev/version.rb
257
213
  - schema_dev.gemspec
258
- - spec/config_spec.rb
259
- - spec/gem_spec.rb
260
- - spec/gemfile_sepector_spec.rb
261
- - spec/gemfiles_spec.rb
262
- - spec/runner_spec.rb
214
+ - spec/schema_dev/config_spec.rb
215
+ - spec/schema_dev/gem_spec.rb
216
+ - spec/schema_dev/gemfile_selector_spec.rb
217
+ - spec/schema_dev/gemfiles_spec.rb
218
+ - spec/schema_dev/github_actions_spec.rb
219
+ - spec/schema_dev/runner_spec.rb
263
220
  - spec/spec_helper.rb
264
- - spec/travis_spec.rb
265
221
  - templates/README/installation.md.erb
266
222
  - templates/README/uses.schema_dev.md.erb
267
223
  - templates/README/uses.schema_monkey.md.erb
@@ -276,78 +232,22 @@ files:
276
232
  - templates/gem/lib/GEM_BASE_NAME.rb.erb
277
233
  - templates/gem/lib/GEM_BASE_NAME/version.rb.erb
278
234
  - templates/gem/schema_dev.yml.erb
235
+ - templates/gem/simplecov.erb
279
236
  - templates/gem/spec/sanity_spec.rb.erb
280
237
  - templates/gem/spec/spec_helper.rb.erb
281
238
  - templates/gemfiles/Gemfile.base.erb
282
- - templates/gemfiles/activerecord-3.2/Gemfile.base.erb
283
- - templates/gemfiles/activerecord-3.2/Gemfile.mysql.erb
284
- - templates/gemfiles/activerecord-3.2/Gemfile.mysql2.erb
285
- - templates/gemfiles/activerecord-3.2/Gemfile.postgresql.erb
286
- - templates/gemfiles/activerecord-3.2/Gemfile.sqlite3.erb
287
- - templates/gemfiles/activerecord-4.0/Gemfile.base.erb
288
- - templates/gemfiles/activerecord-4.0/Gemfile.mysql2.erb
289
- - templates/gemfiles/activerecord-4.0/Gemfile.postgresql.erb
290
- - templates/gemfiles/activerecord-4.0/Gemfile.sqlite3.erb
291
- - templates/gemfiles/activerecord-4.1/Gemfile.base.erb
292
- - templates/gemfiles/activerecord-4.1/Gemfile.mysql2.erb
293
- - templates/gemfiles/activerecord-4.1/Gemfile.postgresql.erb
294
- - templates/gemfiles/activerecord-4.1/Gemfile.sqlite3.erb
295
- - templates/gemfiles/activerecord-4.2.0/Gemfile.base.erb
296
- - templates/gemfiles/activerecord-4.2.0/Gemfile.mysql2.erb
297
- - templates/gemfiles/activerecord-4.2.0/Gemfile.postgresql.erb
298
- - templates/gemfiles/activerecord-4.2.0/Gemfile.sqlite3.erb
299
- - templates/gemfiles/activerecord-4.2.1/Gemfile.base.erb
300
- - templates/gemfiles/activerecord-4.2.1/Gemfile.mysql2.erb
301
- - templates/gemfiles/activerecord-4.2.1/Gemfile.postgresql.erb
302
- - templates/gemfiles/activerecord-4.2.1/Gemfile.sqlite3.erb
303
- - templates/gemfiles/activerecord-4.2.6/Gemfile.base.erb
304
- - templates/gemfiles/activerecord-4.2.6/Gemfile.mysql2.erb
305
- - templates/gemfiles/activerecord-4.2.6/Gemfile.postgresql.erb
306
- - templates/gemfiles/activerecord-4.2.6/Gemfile.sqlite3.erb
307
- - templates/gemfiles/activerecord-4.2/Gemfile.base.erb
308
- - templates/gemfiles/activerecord-4.2/Gemfile.mysql2.erb
309
- - templates/gemfiles/activerecord-4.2/Gemfile.postgresql.erb
310
- - templates/gemfiles/activerecord-4.2/Gemfile.sqlite3.erb
311
- - templates/gemfiles/activerecord-5.0.0/Gemfile.base.erb
312
- - templates/gemfiles/activerecord-5.0.0/Gemfile.mysql2.erb
313
- - templates/gemfiles/activerecord-5.0.0/Gemfile.postgresql.erb
314
- - templates/gemfiles/activerecord-5.0.0/Gemfile.sqlite3.erb
315
- - templates/gemfiles/activerecord-5.0.1/Gemfile.base.erb
316
- - templates/gemfiles/activerecord-5.0.1/Gemfile.mysql2.erb
317
- - templates/gemfiles/activerecord-5.0.1/Gemfile.postgresql.erb
318
- - templates/gemfiles/activerecord-5.0.1/Gemfile.sqlite3.erb
319
- - templates/gemfiles/activerecord-5.0.2/Gemfile.base.erb
320
- - templates/gemfiles/activerecord-5.0.2/Gemfile.mysql2.erb
321
- - templates/gemfiles/activerecord-5.0.2/Gemfile.postgresql.erb
322
- - templates/gemfiles/activerecord-5.0.2/Gemfile.sqlite3.erb
323
- - templates/gemfiles/activerecord-5.0.3/Gemfile.base.erb
324
- - templates/gemfiles/activerecord-5.0.3/Gemfile.mysql2.erb
325
- - templates/gemfiles/activerecord-5.0.3/Gemfile.postgresql.erb
326
- - templates/gemfiles/activerecord-5.0.3/Gemfile.sqlite3.erb
327
- - templates/gemfiles/activerecord-5.0/Gemfile.base.erb
328
- - templates/gemfiles/activerecord-5.0/Gemfile.mysql2.erb
329
- - templates/gemfiles/activerecord-5.0/Gemfile.postgresql.erb
330
- - templates/gemfiles/activerecord-5.0/Gemfile.sqlite3.erb
331
- - templates/gemfiles/activerecord-5.1.0/Gemfile.base.erb
332
- - templates/gemfiles/activerecord-5.1.0/Gemfile.mysql2.erb
333
- - templates/gemfiles/activerecord-5.1.0/Gemfile.postgresql.erb
334
- - templates/gemfiles/activerecord-5.1.0/Gemfile.sqlite3.erb
335
- - templates/gemfiles/activerecord-5.1.1/Gemfile.base.erb
336
- - templates/gemfiles/activerecord-5.1.1/Gemfile.mysql2.erb
337
- - templates/gemfiles/activerecord-5.1.1/Gemfile.postgresql.erb
338
- - templates/gemfiles/activerecord-5.1.1/Gemfile.sqlite3.erb
339
- - templates/gemfiles/activerecord-5.1/Gemfile.base.erb
340
- - templates/gemfiles/activerecord-5.1/Gemfile.mysql2.erb
341
- - templates/gemfiles/activerecord-5.1/Gemfile.postgresql.erb
342
- - templates/gemfiles/activerecord-5.1/Gemfile.sqlite3.erb
343
239
  - templates/gemfiles/activerecord-5.2/Gemfile.base.erb
344
240
  - templates/gemfiles/activerecord-5.2/Gemfile.mysql2.erb
345
241
  - templates/gemfiles/activerecord-5.2/Gemfile.postgresql.erb
346
242
  - templates/gemfiles/activerecord-5.2/Gemfile.sqlite3.erb
347
- - templates/gemfiles/activerecord-edge/Gemfile.base.erb
348
- - templates/gemfiles/activerecord-edge/Gemfile.mysql2.erb
349
- - templates/gemfiles/activerecord-edge/Gemfile.postgresql.erb
350
- - templates/gemfiles/activerecord-edge/Gemfile.sqlite3.erb
243
+ - templates/gemfiles/activerecord-6.0/Gemfile.base.erb
244
+ - templates/gemfiles/activerecord-6.0/Gemfile.mysql2.erb
245
+ - templates/gemfiles/activerecord-6.0/Gemfile.postgresql.erb
246
+ - templates/gemfiles/activerecord-6.0/Gemfile.sqlite3.erb
247
+ - templates/gemfiles/activerecord-6.1/Gemfile.base.erb
248
+ - templates/gemfiles/activerecord-6.1/Gemfile.mysql2.erb
249
+ - templates/gemfiles/activerecord-6.1/Gemfile.postgresql.erb
250
+ - templates/gemfiles/activerecord-6.1/Gemfile.sqlite3.erb
351
251
  homepage: https://github.com/SchemaPlus/schema_dev
352
252
  licenses:
353
253
  - MIT
@@ -360,7 +260,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
360
260
  requirements:
361
261
  - - ">="
362
262
  - !ruby/object:Gem::Version
363
- version: '0'
263
+ version: 2.5.0
364
264
  required_rubygems_version: !ruby/object:Gem::Requirement
365
265
  requirements:
366
266
  - - ">="
@@ -372,10 +272,10 @@ signing_key:
372
272
  specification_version: 4
373
273
  summary: SchemaPlus development tools
374
274
  test_files:
375
- - spec/config_spec.rb
376
- - spec/gem_spec.rb
377
- - spec/gemfile_sepector_spec.rb
378
- - spec/gemfiles_spec.rb
379
- - spec/runner_spec.rb
275
+ - spec/schema_dev/config_spec.rb
276
+ - spec/schema_dev/gem_spec.rb
277
+ - spec/schema_dev/gemfile_selector_spec.rb
278
+ - spec/schema_dev/gemfiles_spec.rb
279
+ - spec/schema_dev/github_actions_spec.rb
280
+ - spec/schema_dev/runner_spec.rb
380
281
  - spec/spec_helper.rb
381
- - spec/travis_spec.rb
data/.travis.yml DELETED
@@ -1,4 +0,0 @@
1
- rvm:
2
- - 2.5.9
3
- - 2.7.4
4
- script: bundle exec rake travis
@@ -1,3 +0,0 @@
1
- require 'coveralls/rake/task'
2
- Coveralls::RakeTask.new
3
- task :spec_with_coveralls => [:spec, 'coveralls:push']
@@ -1,118 +0,0 @@
1
- require 'pathname'
2
- require 'yaml'
3
-
4
- require_relative 'gemfile_selector'
5
-
6
- module SchemaDev
7
- module Travis
8
- extend self
9
-
10
- TRAVIS_FILE = ".travis.yml"
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
-
41
- def build(config)
42
- env = []
43
- include = []
44
- addons = {}
45
- if config.dbms.include?(:postgresql)
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
69
- end
70
- if config.dbms.include?(:mysql)
71
- env << 'MYSQL_DB_USER=travis'
72
- end
73
- env = env.join(' ')
74
-
75
- gemfiles = config.matrix.map{|entry| GemfileSelector.gemfile(entry.slice(:activerecord, :db)).to_s}.uniq
76
-
77
- exclude = config.matrix(excluded: :only).map { |entry| {}.tap {|ex|
78
- ex["rvm"] = entry[:ruby]
79
- ex["gemfile"] = GemfileSelector.gemfile(entry.slice(:activerecord, :db)).to_s
80
- }}.reject{|ex| not gemfiles.include? ex["gemfile"]}
81
-
82
- {}.tap { |travis|
83
- travis["rvm"] = config.ruby.sort
84
- travis["gemfile"] = gemfiles.sort
85
- travis["env"] = env unless env.empty?
86
- travis["addons"] = addons unless addons.empty?
87
- if config.dbms.any?
88
- travis["before_script"] = 'bundle exec rake create_databases'
89
- travis["after_script"] = 'bundle exec rake drop_databases'
90
- end
91
- travis["script"] = "bundle exec rake travis"
92
- travis["notifications"] = { "email" => config.notify } if config.notify.any?
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?
99
- }
100
- end
101
-
102
- def update(config)
103
- filepath = Pathname.new(TRAVIS_FILE)
104
- newtravis = build(config)
105
- oldtravis = YAML.load(filepath.read) rescue nil
106
- if oldtravis != newtravis
107
- header = <<-ENDYAML
108
- # This file was auto-generated by the schema_dev tool, based on the data in
109
- # ./schema_dev.yml
110
- # Please do not edit this file; any changes will be overwritten next time
111
- # schema_dev gets run.
112
- ENDYAML
113
- filepath.write header + newtravis.to_yaml
114
- return true
115
- end
116
- end
117
- end
118
- end
data/spec/config_spec.rb DELETED
@@ -1,61 +0,0 @@
1
- describe SchemaDev::Config do
2
-
3
- it "computes matrix" do
4
- config = get_config(ruby: %W[1.9.3 2.1.5], activerecord: %W[4.0 4.1], db: %W[sqlite3 postgresql])
5
- expect(config.matrix).to match_array [
6
- { ruby: "1.9.3", activerecord: "4.0", db: "sqlite3" },
7
- { ruby: "1.9.3", activerecord: "4.0", db: "postgresql" },
8
- { ruby: "1.9.3", activerecord: "4.1", db: "sqlite3" },
9
- { ruby: "1.9.3", activerecord: "4.1", db: "postgresql" },
10
- { ruby: "2.1.5", activerecord: "4.0", db: "sqlite3" },
11
- { ruby: "2.1.5", activerecord: "4.0", db: "postgresql" },
12
- { ruby: "2.1.5", activerecord: "4.1", db: "sqlite3" },
13
- { ruby: "2.1.5", activerecord: "4.1", db: "postgresql" },
14
- ]
15
- end
16
-
17
- it "excludes explicit elements from matrix" do
18
- config = get_config(ruby: %W[1.9.3 2.1.5], activerecord: %W[4.0 4.1], db: %W[sqlite3 postgresql],
19
- exclude: [
20
- { ruby: "1.9.3", activerecord: "4.1", db: "postgresql" },
21
- { ruby: "2.1.5", activerecord: "4.0", db: "sqlite3" } ]
22
- )
23
- expect(config.matrix).to match_array [
24
- { ruby: "1.9.3", activerecord: "4.0", db: "sqlite3" },
25
- { ruby: "1.9.3", activerecord: "4.0", db: "postgresql" },
26
- { ruby: "1.9.3", activerecord: "4.1", db: "sqlite3" },
27
- # { ruby: "1.9.3", activerecord: "4.1", db: "postgresql" },
28
- # { ruby: "2.1.5", activerecord: "4.0", db: "sqlite3" },
29
- { ruby: "2.1.5", activerecord: "4.0", db: "postgresql" },
30
- { ruby: "2.1.5", activerecord: "4.1", db: "sqlite3" },
31
- { ruby: "2.1.5", activerecord: "4.1", db: "postgresql" },
32
- ]
33
- end
34
-
35
- it "excludes slices from matrix" do
36
- config = get_config(ruby: %W[1.9.3 2.1.5], activerecord: %W[4.0 4.1], db: %W[sqlite3 postgresql],
37
- exclude: [
38
- { ruby: "1.9.3", activerecord: "4.1"},
39
- { ruby: "2.1.5", db: "sqlite3" } ]
40
- )
41
- expect(config.matrix).to match_array [
42
- { ruby: "1.9.3", activerecord: "4.0", db: "sqlite3" },
43
- { ruby: "1.9.3", activerecord: "4.0", db: "postgresql" },
44
- #{ ruby: "1.9.3", activerecord: "4.1", db: "sqlite3" },
45
- #{ ruby: "1.9.3", activerecord: "4.1", db: "postgresql" },
46
- #{ ruby: "2.1.5", activerecord: "4.0", db: "sqlite3" },
47
- { ruby: "2.1.5", activerecord: "4.0", db: "postgresql" },
48
- #{ ruby: "2.1.5", activerecord: "4.1", db: "sqlite3" },
49
- { ruby: "2.1.5", activerecord: "4.1", db: "postgresql" },
50
- ]
51
- end
52
-
53
- it "uses last cell for --quick" do
54
- config = get_config(ruby: %W[1.9.3 2.1.5], activerecord: %W[4.0 4.1], db: %W[sqlite3 postgresql])
55
- expect(config.matrix quick: true).to match_array [
56
- { ruby: "2.1.5", activerecord: "4.1", db: "postgresql" },
57
- ]
58
- end
59
-
60
-
61
- end
data/spec/gem_spec.rb DELETED
@@ -1,77 +0,0 @@
1
- require 'schema_dev/gem'
2
-
3
- describe SchemaDev::Gem do
4
-
5
- around(:each) do |example|
6
- in_tmpdir do
7
- suppress_stdout_stderr do
8
- example.run
9
- end
10
- end
11
- end
12
-
13
- Given(:user_name) { "My Name" }
14
- Given(:user_email) { "my_name@example.com" }
15
-
16
- Given {
17
- allow_any_instance_of(SchemaDev::Gem).to receive(:`).with("git config user.name").and_return user_name
18
- allow_any_instance_of(SchemaDev::Gem).to receive(:`).with("git config user.email").and_return user_email
19
- }
20
-
21
- context "builds" do
22
-
23
- Given {
24
- stub_request(:get, 'https://rubygems.org/api/v1/versions/schema_plus_core.json').to_return body: JSON.generate([
25
- { number: "1.0.0.pre", prerelease: true},
26
- { number: "0.2.1"},
27
- { number: "0.1.2"},
28
- { number: "0.1.1" },
29
- ])
30
- }
31
-
32
- When { SchemaDev::Gem.build gem_name }
33
-
34
- When(:gemspec) { File.read "#{gem_name}/#{gem_name}.gemspec" }
35
- When(:readme) { File.read "#{gem_name}/README.md" }
36
-
37
- Invariant { expect(readme).to include %q{<!-- These lines are auto-generated by schema_dev based on schema_dev.yml -->} }
38
- Invariant { expect(readme).to include %q{<!-- These lines are auto-inserted from a schema_dev template -->} }
39
-
40
- Invariant { expect(gemspec).to include %q{"schema_plus_core", "~> 0.2", ">= 0.2.1"} }
41
- Invariant { expect(gemspec).to match %r{authors.*#{user_name}} }
42
- Invariant { expect(gemspec).to match %r{email.*#{user_email}} }
43
-
44
- context "flat gem" do
45
- Given(:gem_name) { "new_gem" }
46
- Then { expect(gemspec).to include %q{require 'new_gem/version'} }
47
- Then { expect(File.read "new_gem/lib/new_gem.rb").to include %q{SchemaMonkey.register NewGem} }
48
- end
49
-
50
- context "subdir gem" do
51
- Given(:gem_name) { "schema_plus_new_gem" }
52
- Then { expect(gemspec).to include %q{require 'schema_plus/new_gem/version'} }
53
- Then { expect(File.read "schema_plus_new_gem/lib/schema_plus_new_gem.rb").to include %q{require_relative 'schema_plus/new_gem'} }
54
- Then { expect(File.read "schema_plus_new_gem/lib/schema_plus/new_gem.rb").to include %q{SchemaMonkey.register SchemaPlus::NewGem} }
55
- end
56
- end
57
-
58
-
59
- context "complains" do
60
-
61
- context "when no git user.name" do
62
- Given(:user_name) { "" }
63
- Then { expect{SchemaDev::Gem.build("NewGem")}.to raise_error SystemExit, /who are you/i }
64
- end
65
-
66
- context "when in git worktree" do
67
- Given { expect_any_instance_of(SchemaDev::Gem).to receive(:system).with(/^git rev-parse/).and_return true }
68
- Then { expect{SchemaDev::Gem.build("NewGem")}.to raise_error SystemExit, /\bgit\b/ }
69
- end
70
-
71
- context "when gem directory exists" do
72
- Given { FileUtils.touch "new_gem" }
73
- Then { expect{SchemaDev::Gem.build("NewGem")}.to raise_error SystemExit, /exists/ }
74
- end
75
- end
76
-
77
- end
@@ -1,10 +0,0 @@
1
- require 'schema_dev/gemfile_selector'
2
-
3
- describe SchemaDev::GemfileSelector do
4
-
5
- it "infers db from env" do
6
- test_dbname = 'this_is_a_test'
7
- ENV['BUNDLE_GEMFILE'] = SchemaDev::GemfileSelector.gemfile(activerecord: '4.1', db: test_dbname).to_s
8
- expect(SchemaDev::GemfileSelector.infer_db).to eq test_dbname
9
- end
10
- end
@@ -1,43 +0,0 @@
1
- require 'schema_dev/gemfiles'
2
-
3
- describe SchemaDev::Gemfiles do
4
-
5
- it "copies listed files" do
6
- config = get_config(ruby: %W[1.9.3 2.1.5], activerecord: %W[4.0 4.1], db: %W[sqlite3 postgresql])
7
- in_tmpdir do
8
- expect(SchemaDev::Gemfiles.build(config)).to be_truthy
9
- expect(relevant_diff(config, "gemfiles")).to be_empty
10
- end
11
- end
12
-
13
- it "only copies files once" do
14
- config = get_config(ruby: %W[1.9.3 2.1.5], activerecord: %W[4.0 4.1], db: %W[sqlite3 postgresql])
15
- in_tmpdir do
16
- expect(SchemaDev::Gemfiles.build(config)).to be_truthy
17
- expect(SchemaDev::Gemfiles.build(config)).to be_falsey
18
- end
19
- end
20
-
21
- def relevant_diff(config, dir)
22
- Dir.mktmpdir do |no_erb_root|
23
- no_erb_root = Pathname(no_erb_root)
24
- erb_root = SchemaDev::Templates.root + dir
25
- Pathname.glob(erb_root + "**/*").select(&:file?).each do |p|
26
- d = (no_erb_root+p.relative_path_from(erb_root)).sub_ext('')
27
- d.dirname.mkpath
28
- d.write p.read
29
- end
30
-
31
- diff = `diff -rq #{no_erb_root} #{dir} 2>&1`.split("\n")
32
-
33
- # expect copy not to have entry for activerecord not in config
34
- diff.reject!{ |d| d =~ %r[Only in #{no_erb_root}: activerecord-(.*)] and not config.activerecord.include? $1 }
35
-
36
- # expect copy not to have entry for db not in config
37
- diff.reject!{ |d| d =~ %r[Only in #{no_erb_root}.*: Gemfile.(.*)] and not config.db.include? $1 }
38
- end
39
- end
40
-
41
- end
42
-
43
-