gemika 0.8.1 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +6 -6
- data/CHANGELOG.md +12 -0
- data/Gemfile.5.2.mysql2.lock +2 -2
- data/Gemfile.5.2.pg.lock +2 -2
- data/Gemfile.5.2.sqlite3.lock +2 -2
- data/Gemfile.6.1.pg.lock +2 -2
- data/Gemfile.7.0.pg.lock +6 -6
- data/README.md +21 -9
- data/bin/matrix +65 -0
- data/lib/gemika/matrix.rb +8 -3
- data/lib/gemika/version.rb +1 -1
- data/spec/fixtures/migrate/expected_github_actions.yml +3 -3
- data/spec/gemika/matrix/row_spec.rb +13 -0
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f432a0cff504e477f6450ed48da82894a00daa92efa9b0789d4e6af8d0eafef8
|
4
|
+
data.tar.gz: 1eb9b92aba01e07cd4419addd13a11e0cd98d6e6d184007ebe0712b92e2f9bce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8215d8b44032c9dc6fcf9402054f498b7f70c9899bc56b579b80f5e1c56533821c7c1360d2def99def659fc4b0ee5e4c8e2b5b9913d790b30fa619de2a8a679b
|
7
|
+
data.tar.gz: 788d206f09144015868f90462c677df51495c9dbce64ff23289a0b1cf67e26330a50664a977a22e6dd65ab4844f051b5996cdfcb8798f5d9c7eec28218b7204b
|
data/.github/workflows/test.yml
CHANGED
@@ -28,7 +28,7 @@ jobs:
|
|
28
28
|
env:
|
29
29
|
BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
|
30
30
|
steps:
|
31
|
-
- uses: actions/checkout@
|
31
|
+
- uses: actions/checkout@v3
|
32
32
|
- name: Install ruby
|
33
33
|
uses: ruby/setup-ruby@v1
|
34
34
|
with:
|
@@ -38,7 +38,7 @@ jobs:
|
|
38
38
|
mysql -e 'create database IF NOT EXISTS test;' -u root --password=password -P 3306 -h 127.0.0.1
|
39
39
|
- name: Bundle
|
40
40
|
run: |
|
41
|
-
gem install bundler:2.
|
41
|
+
gem install bundler:2.3.1
|
42
42
|
bundle install --no-deployment
|
43
43
|
- name: Run tests
|
44
44
|
run: bundle exec rspec
|
@@ -72,7 +72,7 @@ jobs:
|
|
72
72
|
env:
|
73
73
|
BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
|
74
74
|
steps:
|
75
|
-
- uses: actions/checkout@
|
75
|
+
- uses: actions/checkout@v3
|
76
76
|
- name: Install ruby
|
77
77
|
uses: ruby/setup-ruby@v1
|
78
78
|
with:
|
@@ -84,7 +84,7 @@ jobs:
|
|
84
84
|
PGPASSWORD=postgres psql -c 'create database test;' -U postgres -p 5432 -h localhost
|
85
85
|
- name: Bundle
|
86
86
|
run: |
|
87
|
-
gem install bundler:2.
|
87
|
+
gem install bundler:2.3.1
|
88
88
|
bundle install --no-deployment
|
89
89
|
- name: Run tests
|
90
90
|
run: bundle exec rspec
|
@@ -99,14 +99,14 @@ jobs:
|
|
99
99
|
env:
|
100
100
|
BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
|
101
101
|
steps:
|
102
|
-
- uses: actions/checkout@
|
102
|
+
- uses: actions/checkout@v3
|
103
103
|
- name: Install ruby
|
104
104
|
uses: ruby/setup-ruby@v1
|
105
105
|
with:
|
106
106
|
ruby-version: "${{ matrix.ruby }}"
|
107
107
|
- name: Bundle
|
108
108
|
run: |
|
109
|
-
gem install bundler:2.
|
109
|
+
gem install bundler:2.3.1
|
110
110
|
bundle install --no-deployment
|
111
111
|
- name: Run tests
|
112
112
|
run: bundle exec rspec
|
data/CHANGELOG.md
CHANGED
@@ -13,7 +13,19 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
|
|
13
13
|
|
14
14
|
-
|
15
15
|
|
16
|
+
## 0.8.3 - 2024-01-04
|
16
17
|
|
18
|
+
### Compatible changes
|
19
|
+
|
20
|
+
- handle missing rbenv-aliases plugin
|
21
|
+
|
22
|
+
|
23
|
+
## 0.8.2 - 2023-07-13
|
24
|
+
|
25
|
+
### Compatible changes
|
26
|
+
|
27
|
+
- Update gem and bundler versions
|
28
|
+
- Provide dev script `bin/matrix` and update README
|
17
29
|
|
18
30
|
## 0.8.1 - 2023-01-24
|
19
31
|
|
data/Gemfile.5.2.mysql2.lock
CHANGED
data/Gemfile.5.2.pg.lock
CHANGED
data/Gemfile.5.2.sqlite3.lock
CHANGED
data/Gemfile.6.1.pg.lock
CHANGED
data/Gemfile.7.0.pg.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gemika (0.8.
|
4
|
+
gemika (0.8.3)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -19,7 +19,7 @@ GEM
|
|
19
19
|
coderay (1.1.3)
|
20
20
|
concurrent-ruby (1.1.10)
|
21
21
|
database_cleaner (1.7.0)
|
22
|
-
diff-lcs (1.
|
22
|
+
diff-lcs (1.5.0)
|
23
23
|
i18n (1.12.0)
|
24
24
|
concurrent-ruby (~> 1.0)
|
25
25
|
method_source (1.0.0)
|
@@ -35,13 +35,13 @@ GEM
|
|
35
35
|
rspec-mocks (~> 3.8.0)
|
36
36
|
rspec-core (3.8.2)
|
37
37
|
rspec-support (~> 3.8.0)
|
38
|
-
rspec-expectations (3.8.
|
38
|
+
rspec-expectations (3.8.6)
|
39
39
|
diff-lcs (>= 1.2.0, < 2.0)
|
40
40
|
rspec-support (~> 3.8.0)
|
41
|
-
rspec-mocks (3.8.
|
41
|
+
rspec-mocks (3.8.2)
|
42
42
|
diff-lcs (>= 1.2.0, < 2.0)
|
43
43
|
rspec-support (~> 3.8.0)
|
44
|
-
rspec-support (3.8.
|
44
|
+
rspec-support (3.8.3)
|
45
45
|
tzinfo (2.0.5)
|
46
46
|
concurrent-ruby (~> 1.0)
|
47
47
|
|
@@ -61,4 +61,4 @@ RUBY VERSION
|
|
61
61
|
ruby 2.2.4p230
|
62
62
|
|
63
63
|
BUNDLED WITH
|
64
|
-
2.
|
64
|
+
2.3.1
|
data/README.md
CHANGED
@@ -693,22 +693,34 @@ Development
|
|
693
693
|
|
694
694
|
Here are some hints when you try to make changes to Gemika itself:
|
695
695
|
|
696
|
-
There are tests in `spec`. We only accept PRs with tests.
|
696
|
+
There are tests in `spec`. We only accept PRs with tests. If you create a PR, the tests will automatically run on
|
697
|
+
GitHub actions on each push. We will only merge pull requests after a green GitHub actions run.
|
698
|
+
|
699
|
+
To run tests locally for development, first setup your test databases:
|
697
700
|
|
698
|
-
- Install Ruby 2.6.4
|
699
701
|
- Create a local test database `gemika_test` in both MySQL and PostgreSQL
|
700
702
|
- Copy `spec/support/database.sample.yml` to `spec/support/database.yml` and enter your local credentials for the test databases
|
701
|
-
- Create the databases specified in `database.yml`
|
702
|
-
- Install development dependencies using `bundle install`
|
703
|
-
- Run tests using `bundle exec rspec`
|
704
703
|
|
705
|
-
|
704
|
+
Afterwards you have multiple options:
|
706
705
|
|
707
|
-
|
708
|
-
-
|
706
|
+
1. Run tests against the "main development" Ruby version (`.ruby-version`) and dependencies (`Gemfile`/`Gemfile.lock` symlinks):
|
707
|
+
- Install the Ruby version specified in `.ruby-version`
|
708
|
+
- Install development dependencies using `bundle install`
|
709
|
+
- Run tests using `bundle exec rspec`
|
709
710
|
|
710
|
-
|
711
|
+
2. Run tests against a specific Ruby version (out of those mentioned in `.github/workflows/test.yml`) and all Gemfiles compatible with that version:
|
712
|
+
- Install and switch to the Ruby version
|
713
|
+
- Install development dependencies for all compatible Gemfiles using `rake matrix:install`
|
714
|
+
- Run tests for all compatible Gemfiles using `rake matrix:spec`
|
715
|
+
|
716
|
+
3. Run tests against all compatible combinations of Ruby and Gemfile:
|
717
|
+
- Install all Ruby versions mentioned in `.github/workflows/test.yml`
|
718
|
+
- run `bin/matrix` (only supports `rbenv` for switching Ruby versions currently)
|
711
719
|
|
720
|
+
Hints:
|
721
|
+
- We recommend to have sufficiently new versions of bundler (> 2.3.0) and rubygems (> 3.3.0) installed for each Ruby version.
|
722
|
+
- The script `bin/matrix` will warn you, if that is not the case. For all other methods you need to ensure that yourself.
|
723
|
+
- Supported "Ruby <-> Gemfile" combinations are configured in `.github/workflows/test.yml`.
|
712
724
|
|
713
725
|
Credits
|
714
726
|
-------
|
data/bin/matrix
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
set -euo pipefail
|
3
|
+
|
4
|
+
# utility for comparing version strings
|
5
|
+
# https://stackoverflow.com/questions/4023830/how-to-compare-two-strings-in-dot-separated-version-format-in-bash
|
6
|
+
function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }
|
7
|
+
|
8
|
+
# store current Ruby version and restore it on exit
|
9
|
+
original_ruby_version=$(cat .ruby-version)
|
10
|
+
trap "rbenv local $original_ruby_version" EXIT
|
11
|
+
|
12
|
+
# determine employed Ruby versions (awk command == "strip whitespace", sed command == "delete_prefix")
|
13
|
+
readarray -t versions < <(grep ruby: .github/workflows/test.yml | awk '{$1=$1};1' | sed 's/- ruby: //' | sort | uniq)
|
14
|
+
echo "Detected Ruby versions:"
|
15
|
+
for version in "${versions[@]}"
|
16
|
+
do
|
17
|
+
echo "- $version"
|
18
|
+
done
|
19
|
+
echo ""
|
20
|
+
|
21
|
+
for version in "${versions[@]}"
|
22
|
+
do
|
23
|
+
# switch Ruby version
|
24
|
+
rbenv local "$version"
|
25
|
+
|
26
|
+
# determine actual versions
|
27
|
+
ruby_version=$(ruby -v)
|
28
|
+
rubygems_version=$(gem -v)
|
29
|
+
bundler_version=$(bundler -v | sed 's/Bundler version //')
|
30
|
+
|
31
|
+
# debug output
|
32
|
+
echo "====================="
|
33
|
+
echo "Target Ruby version: $version"
|
34
|
+
echo ""
|
35
|
+
echo "Ruby: $ruby_version"
|
36
|
+
echo "rubygems: $rubygems_version"
|
37
|
+
echo "Bundler: $bundler_version"
|
38
|
+
echo "====================="
|
39
|
+
echo ""
|
40
|
+
|
41
|
+
# version checks (minimum versions to make 'BUNDLED WITH' in Gemfile.lock work correctly)
|
42
|
+
if [ $(version $rubygems_version) -lt $(version "3.3.0") ]; then
|
43
|
+
echo "Please ensure that your rubygems version is > 3.3.0 for Ruby $ruby_version!"
|
44
|
+
echo "Install newest version:"
|
45
|
+
echo "gem update --system"
|
46
|
+
echo "Install specific version:"
|
47
|
+
echo "gem update --system <version>"
|
48
|
+
exit 1
|
49
|
+
fi
|
50
|
+
|
51
|
+
if [ $(version $bundler_version) -lt $(version "2.3.0") ]; then
|
52
|
+
echo "Please ensure that your Bundler version is > 2.3.0 for Ruby $ruby_version!"
|
53
|
+
echo "Install newest version:"
|
54
|
+
echo "gem install bundler"
|
55
|
+
echo "Install specific version:"
|
56
|
+
echo "gem install bundler:<version>"
|
57
|
+
exit 1
|
58
|
+
fi
|
59
|
+
|
60
|
+
# bundle and run specs
|
61
|
+
rake matrix:install
|
62
|
+
rake matrix:spec
|
63
|
+
done
|
64
|
+
|
65
|
+
exit 0
|
data/lib/gemika/matrix.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'open3'
|
1
2
|
require 'yaml'
|
2
3
|
require 'gemika/errors'
|
3
4
|
require 'gemika/env'
|
@@ -89,11 +90,15 @@ module Gemika
|
|
89
90
|
end
|
90
91
|
|
91
92
|
##
|
92
|
-
# Returns the list of rbenv aliases, if rbenv is installed.
|
93
|
+
# Returns the list of rbenv aliases, if rbenv is installed with rbenv-aliases plugin.
|
93
94
|
#
|
94
95
|
def rbenv_aliases
|
95
|
-
|
96
|
-
|
96
|
+
_output, status = Open3.capture2e('which', 'rbenv')
|
97
|
+
return '' unless status.success?
|
98
|
+
|
99
|
+
output, status = Open3.capture2e('rbenv', 'alias', '--list')
|
100
|
+
if status.success?
|
101
|
+
output
|
97
102
|
else
|
98
103
|
''
|
99
104
|
end
|
data/lib/gemika/version.rb
CHANGED
@@ -54,7 +54,7 @@ jobs:
|
|
54
54
|
mysql -e 'create database IF NOT EXISTS test;' -u root --password=password -P 3306 -h 127.0.0.1
|
55
55
|
- name: Bundle
|
56
56
|
run: |
|
57
|
-
gem install bundler:2.
|
57
|
+
gem install bundler:2.3.1
|
58
58
|
bundle install --no-deployment
|
59
59
|
- name: Run tests
|
60
60
|
run: bundle exec rspec
|
@@ -99,7 +99,7 @@ jobs:
|
|
99
99
|
PGPASSWORD=postgres psql -c 'create database test;' -U postgres -p 5432 -h localhost
|
100
100
|
- name: Bundle
|
101
101
|
run: |
|
102
|
-
gem install bundler:2.
|
102
|
+
gem install bundler:2.3.1
|
103
103
|
bundle install --no-deployment
|
104
104
|
- name: Run tests
|
105
105
|
run: bundle exec rspec
|
@@ -123,7 +123,7 @@ jobs:
|
|
123
123
|
ruby-version: "${{ matrix.ruby }}"
|
124
124
|
- name: Bundle
|
125
125
|
run: |
|
126
|
-
gem install bundler:2.
|
126
|
+
gem install bundler:2.3.1
|
127
127
|
bundle install --no-deployment
|
128
128
|
- name: Run tests
|
129
129
|
run: bundle exec rspec
|
@@ -57,6 +57,19 @@ describe Gemika::Matrix::Row do
|
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
|
+
context 'when rbenv is installed without rbenv-aliases plugin' do
|
61
|
+
before do
|
62
|
+
allow(Open3).to receive(:capture2e).with('which', 'rbenv').and_return(['/path/to/rbenv', double(success?: true, exitstatus: 0)])
|
63
|
+
allow(Open3).to receive(:capture2e).with('rbenv', 'alias', '--list').and_return(['rbenv: no such command `alias', double(success?: false, exitstatus: 1)])
|
64
|
+
end
|
65
|
+
|
66
|
+
it 'does not crash and does not print errors' do
|
67
|
+
expect do
|
68
|
+
expect(subject.compatible_with_ruby?('3.0.3')).to eq(true)
|
69
|
+
end.to output('').to_stdout_from_any_process.and output('').to_stderr_from_any_process
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
60
73
|
end
|
61
74
|
|
62
75
|
end
|
metadata
CHANGED
@@ -1,18 +1,19 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gemika
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henning Koch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Helpers for testing Ruby gems
|
14
14
|
email: henning.koch@makandra.de
|
15
|
-
executables:
|
15
|
+
executables:
|
16
|
+
- matrix
|
16
17
|
extensions: []
|
17
18
|
extra_rdoc_files: []
|
18
19
|
files:
|
@@ -35,6 +36,7 @@ files:
|
|
35
36
|
- LICENSE
|
36
37
|
- README.md
|
37
38
|
- Rakefile
|
39
|
+
- bin/matrix
|
38
40
|
- doc/minidusen_test.png
|
39
41
|
- gemika.gemspec
|
40
42
|
- lib/gemika.rb
|
@@ -102,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
104
|
- !ruby/object:Gem::Version
|
103
105
|
version: '0'
|
104
106
|
requirements: []
|
105
|
-
rubygems_version: 3.4.
|
107
|
+
rubygems_version: 3.4.13
|
106
108
|
signing_key:
|
107
109
|
specification_version: 4
|
108
110
|
summary: Helpers for testing Ruby gems
|