schema_dev 4.1.1 → 4.2.beta.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/prs.yml +15 -3
- data/.gitignore +1 -0
- data/Gemfile +2 -1
- data/gemfiles/Gemfile.activesupport-5.2 +4 -0
- data/gemfiles/Gemfile.activesupport-6.0 +4 -0
- data/gemfiles/Gemfile.activesupport-6.1 +4 -0
- data/gemfiles/Gemfile.activesupport-7.0 +4 -0
- data/gemfiles/Gemfile.base +4 -0
- data/lib/schema_dev/config.rb +19 -5
- data/lib/schema_dev/rspec/db.rb +20 -2
- data/lib/schema_dev/version.rb +1 -1
- data/schema_dev.gemspec +1 -1
- data/spec/schema_dev/config_spec.rb +13 -0
- data/spec/schema_dev/github_actions_spec.rb +72 -0
- data/spec/spec_helper.rb +1 -1
- data/templates/gem/spec/spec_helper.rb.erb +1 -1
- data/templates/gemfiles/activerecord-7.0/Gemfile.base.erb +4 -0
- data/templates/gemfiles/activerecord-7.0/Gemfile.mysql2.erb +10 -0
- data/templates/gemfiles/activerecord-7.0/Gemfile.postgresql.erb +10 -0
- data/templates/gemfiles/activerecord-7.0/Gemfile.sqlite3.erb +10 -0
- metadata +15 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0df7ac647427e66a0e968bacc402b4e194789192f6a7f816b7d590b5c872a0b3
|
4
|
+
data.tar.gz: 4a4aedbf0d720816c33066d69ea7edc37eb4060e9ad511fe00b004741ca8641a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d743ea859930dd2b02ae3d5be9ef2e7b7bd31b63033f711f33f11315798a075afa4b46136f49b6b40279a45216ee77d41a49e5f923b29cb63707c390353ae58
|
7
|
+
data.tar.gz: 29e621ebfac4125d87073c4da2406b507bafbf9215e03e5191bcd8c7d3e6d8225c41774de8471646ef1db8bb44c35ceab340e57a048d654e30833e26de9bdc08
|
data/.github/workflows/prs.yml
CHANGED
@@ -16,14 +16,26 @@ jobs:
|
|
16
16
|
strategy:
|
17
17
|
fail-fast: false
|
18
18
|
matrix:
|
19
|
-
ruby
|
19
|
+
ruby: ['2.5', '2.6', '2.7', '3.0', '3.1']
|
20
|
+
activesupport: ['5.2', '6.0', '6.1', '7.0']
|
21
|
+
exclude:
|
22
|
+
- ruby: '2.5'
|
23
|
+
activesupport: '7.0'
|
24
|
+
- ruby: '2.6'
|
25
|
+
activesupport: '7.0'
|
26
|
+
- ruby: '3.0'
|
27
|
+
activesupport: '5.2'
|
28
|
+
- ruby: '3.1'
|
29
|
+
activesupport: '5.2'
|
30
|
+
env:
|
31
|
+
BUNDLE_GEMFILE: "${{ github.workspace }}/gemfiles/Gemfile.activesupport-${{ matrix.activesupport }}"
|
20
32
|
steps:
|
21
33
|
- uses: actions/checkout@v2
|
22
34
|
|
23
35
|
- name: Set up Ruby
|
24
36
|
uses: ruby/setup-ruby@v1
|
25
37
|
with:
|
26
|
-
ruby-version: ${{ matrix.ruby
|
38
|
+
ruby-version: ${{ matrix.ruby }}
|
27
39
|
bundler-cache: true
|
28
40
|
|
29
41
|
- name: 'Run bundle update'
|
@@ -36,7 +48,7 @@ jobs:
|
|
36
48
|
uses: coverallsapp/github-action@master
|
37
49
|
with:
|
38
50
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
39
|
-
flag-name: run-${{ matrix.ruby
|
51
|
+
flag-name: run-${{ matrix.ruby }}-${{ matrix.activesupport }}
|
40
52
|
parallel: true
|
41
53
|
finish:
|
42
54
|
needs: 'test'
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/lib/schema_dev/config.rb
CHANGED
@@ -17,7 +17,11 @@ module SchemaDev
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.read
|
20
|
-
new(
|
20
|
+
if ::Gem::Version.new(RUBY_VERSION) >= ::Gem::Version.new('3.1')
|
21
|
+
new(**YAML.safe_load(Pathname.new(CONFIG_FILE).read, permitted_classes: [Symbol], symbolize_names: true))
|
22
|
+
else
|
23
|
+
new(**YAML.safe_load(Pathname.new(CONFIG_FILE).read, [Symbol], symbolize_names: true))
|
24
|
+
end
|
21
25
|
end
|
22
26
|
|
23
27
|
def self.load
|
@@ -30,11 +34,21 @@ module SchemaDev
|
|
30
34
|
@db = Array.wrap(db)
|
31
35
|
@dbversions = (dbversions || {}).symbolize_keys
|
32
36
|
@exclude = Array.wrap(exclude).map(&:symbolize_keys).map { |tuple| Tuple.new(**tuple.transform_values(&:to_s)) }
|
33
|
-
|
34
|
-
|
37
|
+
@activerecord.each do |ar_version|
|
38
|
+
ar_check = ::Gem::Version.new(ar_version)
|
39
|
+
|
40
|
+
if ar_check < ::Gem::Version.new('6.0')
|
41
|
+
ruby3 = ::Gem::Version.new('3.0')
|
42
|
+
|
43
|
+
@ruby.select { |e| ::Gem::Version.new(e) >= ruby3 }.each do |v|
|
44
|
+
@exclude << Tuple.new(ruby: v, activerecord: ar_version)
|
45
|
+
end
|
46
|
+
elsif ar_check >= ::Gem::Version.new('7.0')
|
47
|
+
ruby27 = ::Gem::Version.new('2.7')
|
35
48
|
|
36
|
-
|
37
|
-
|
49
|
+
@ruby.select { |e| ::Gem::Version.new(e) < ruby27 }.each do |v|
|
50
|
+
@exclude << Tuple.new(ruby: v, activerecord: ar_version)
|
51
|
+
end
|
38
52
|
end
|
39
53
|
end
|
40
54
|
unless notify.nil?
|
data/lib/schema_dev/rspec/db.rb
CHANGED
@@ -14,12 +14,30 @@ module SchemaDev
|
|
14
14
|
connect
|
15
15
|
RSpec.configure do |config|
|
16
16
|
config.include Helpers
|
17
|
-
config.filter_run_excluding postgresql:
|
18
|
-
|
17
|
+
config.filter_run_excluding postgresql: -> (v) {
|
18
|
+
if Helpers.postgresql?
|
19
|
+
case v
|
20
|
+
when String
|
21
|
+
version = ActiveRecord::Base.connection.select_value("SHOW server_version").match(/(\d+\.\d+)/)[1]
|
22
|
+
postgresql_version = Gem::Version.new(version)
|
23
|
+
test = Gem::Requirement.new(v)
|
24
|
+
!test.satisfied_by?(postgresql_version)
|
25
|
+
else
|
26
|
+
v == :skip
|
27
|
+
end
|
28
|
+
else
|
29
|
+
v == :only
|
30
|
+
end
|
31
|
+
}
|
19
32
|
config.filter_run_excluding mysql: :only unless Helpers.mysql?
|
20
33
|
config.filter_run_excluding mysql: :skip if Helpers.mysql?
|
21
34
|
config.filter_run_excluding sqlite3: :only unless Helpers.sqlite3?
|
22
35
|
config.filter_run_excluding sqlite3: :skip if Helpers.sqlite3?
|
36
|
+
config.filter_run_excluding rails: -> (v) {
|
37
|
+
rails_version = Gem::Version.new(ActiveRecord::VERSION::STRING)
|
38
|
+
test = Gem::Requirement.new(v)
|
39
|
+
!test.satisfied_by?(rails_version)
|
40
|
+
}
|
23
41
|
end
|
24
42
|
end
|
25
43
|
|
data/lib/schema_dev/version.rb
CHANGED
data/schema_dev.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |gem|
|
|
21
21
|
|
22
22
|
gem.required_ruby_version = '>= 2.5.0'
|
23
23
|
|
24
|
-
gem.add_dependency 'activesupport', '>= 5.2', '<
|
24
|
+
gem.add_dependency 'activesupport', '>= 5.2', '< 7.1'
|
25
25
|
gem.add_dependency 'faraday', '~> 1.0'
|
26
26
|
gem.add_dependency 'simplecov'
|
27
27
|
gem.add_dependency 'simplecov-lcov', '~> 0.8.0'
|
@@ -57,4 +57,17 @@ describe SchemaDev::Config do
|
|
57
57
|
{ ruby: '2.1.5', activerecord: '4.1', db: 'postgresql' },
|
58
58
|
]
|
59
59
|
end
|
60
|
+
|
61
|
+
it 'excludes variations that are not possible' do
|
62
|
+
config = get_config(ruby: %w[2.6 2.7 3.0], activerecord: %w[5.2 6.0 7.0], db: %w[sqlite3])
|
63
|
+
expect(config.matrix).to contain_exactly(
|
64
|
+
{ ruby: '2.6', activerecord: '5.2', db: 'sqlite3' },
|
65
|
+
{ ruby: '2.6', activerecord: '6.0', db: 'sqlite3' },
|
66
|
+
{ ruby: '2.7', activerecord: '5.2', db: 'sqlite3' },
|
67
|
+
{ ruby: '2.7', activerecord: '6.0', db: 'sqlite3' },
|
68
|
+
{ ruby: '2.7', activerecord: '7.0', db: 'sqlite3' },
|
69
|
+
{ ruby: '3.0', activerecord: '6.0', db: 'sqlite3' },
|
70
|
+
{ ruby: '3.0', activerecord: '7.0', db: 'sqlite3' },
|
71
|
+
)
|
72
|
+
end
|
60
73
|
end
|
@@ -152,6 +152,78 @@ describe SchemaDev::GithubActions do
|
|
152
152
|
end
|
153
153
|
end
|
154
154
|
|
155
|
+
context 'when AR 7.0 is included with Ruby < 2.7' do
|
156
|
+
let(:config) do
|
157
|
+
{
|
158
|
+
ruby: [2.5, 2.7],
|
159
|
+
activerecord: [6.0, 7.0],
|
160
|
+
db: %w[sqlite3]
|
161
|
+
}
|
162
|
+
end
|
163
|
+
|
164
|
+
it 'automatically excludes Ruby < 2.7 for AR 7.0' do
|
165
|
+
is_expected.to eq described_class::HEADER + <<~YAML
|
166
|
+
---
|
167
|
+
name: CI PR Builds
|
168
|
+
'on':
|
169
|
+
push:
|
170
|
+
branches:
|
171
|
+
- master
|
172
|
+
pull_request:
|
173
|
+
concurrency:
|
174
|
+
group: ci-${{ github.ref }}
|
175
|
+
cancel-in-progress: true
|
176
|
+
jobs:
|
177
|
+
test:
|
178
|
+
runs-on: ubuntu-latest
|
179
|
+
strategy:
|
180
|
+
fail-fast: false
|
181
|
+
matrix:
|
182
|
+
ruby:
|
183
|
+
- '2.5'
|
184
|
+
- '2.7'
|
185
|
+
activerecord:
|
186
|
+
- '6.0'
|
187
|
+
- '7.0'
|
188
|
+
db:
|
189
|
+
- sqlite3
|
190
|
+
exclude:
|
191
|
+
- ruby: '2.5'
|
192
|
+
activerecord: '7.0'
|
193
|
+
env:
|
194
|
+
BUNDLE_GEMFILE: "${{ github.workspace }}/gemfiles/activerecord-${{ matrix.activerecord }}/Gemfile.${{ matrix.db }}"
|
195
|
+
steps:
|
196
|
+
- uses: actions/checkout@v2
|
197
|
+
- name: Set up Ruby
|
198
|
+
uses: ruby/setup-ruby@v1
|
199
|
+
with:
|
200
|
+
ruby-version: "${{ matrix.ruby }}"
|
201
|
+
bundler-cache: true
|
202
|
+
- name: Run bundle update
|
203
|
+
run: bundle update
|
204
|
+
- name: Run tests
|
205
|
+
run: bundle exec rake spec
|
206
|
+
- name: Coveralls Parallel
|
207
|
+
if: "${{ !env.ACT }}"
|
208
|
+
uses: coverallsapp/github-action@master
|
209
|
+
with:
|
210
|
+
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
211
|
+
flag-name: run-${{ matrix.ruby }}-${{ matrix.activerecord }}-${{ matrix.db }}-${{ matrix.dbversion }}
|
212
|
+
parallel: true
|
213
|
+
finish:
|
214
|
+
needs: test
|
215
|
+
runs-on: ubuntu-latest
|
216
|
+
steps:
|
217
|
+
- name: Coveralls Finished
|
218
|
+
if: "${{ !env.ACT }}"
|
219
|
+
uses: coverallsapp/github-action@master
|
220
|
+
with:
|
221
|
+
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
222
|
+
parallel-finished: true
|
223
|
+
YAML
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
155
227
|
context 'when notify is passed' do
|
156
228
|
let(:config) do
|
157
229
|
{
|
data/spec/spec_helper.rb
CHANGED
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: 4.
|
4
|
+
version: 4.2.beta.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ronen barzel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '5.2'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '7.1'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '5.2'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '7.1'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: faraday
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -193,6 +193,11 @@ files:
|
|
193
193
|
- README.md
|
194
194
|
- Rakefile
|
195
195
|
- bin/schema_dev
|
196
|
+
- gemfiles/Gemfile.activesupport-5.2
|
197
|
+
- gemfiles/Gemfile.activesupport-6.0
|
198
|
+
- gemfiles/Gemfile.activesupport-6.1
|
199
|
+
- gemfiles/Gemfile.activesupport-7.0
|
200
|
+
- gemfiles/Gemfile.base
|
196
201
|
- lib/schema_dev.rb
|
197
202
|
- lib/schema_dev/config.rb
|
198
203
|
- lib/schema_dev/executor.rb
|
@@ -248,6 +253,10 @@ files:
|
|
248
253
|
- templates/gemfiles/activerecord-6.1/Gemfile.mysql2.erb
|
249
254
|
- templates/gemfiles/activerecord-6.1/Gemfile.postgresql.erb
|
250
255
|
- templates/gemfiles/activerecord-6.1/Gemfile.sqlite3.erb
|
256
|
+
- templates/gemfiles/activerecord-7.0/Gemfile.base.erb
|
257
|
+
- templates/gemfiles/activerecord-7.0/Gemfile.mysql2.erb
|
258
|
+
- templates/gemfiles/activerecord-7.0/Gemfile.postgresql.erb
|
259
|
+
- templates/gemfiles/activerecord-7.0/Gemfile.sqlite3.erb
|
251
260
|
homepage: https://github.com/SchemaPlus/schema_dev
|
252
261
|
licenses:
|
253
262
|
- MIT
|
@@ -263,9 +272,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
263
272
|
version: 2.5.0
|
264
273
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
265
274
|
requirements:
|
266
|
-
- - "
|
275
|
+
- - ">"
|
267
276
|
- !ruby/object:Gem::Version
|
268
|
-
version:
|
277
|
+
version: 1.3.1
|
269
278
|
requirements: []
|
270
279
|
rubygems_version: 3.0.8
|
271
280
|
signing_key:
|