appraisal2 3.0.5 → 3.0.6
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
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +37 -1
- data/CONTRIBUTING.md +45 -14
- data/README.md +2 -2
- data/lib/appraisal/command.rb +120 -7
- data/lib/appraisal/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +4 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d133d78a6198d0a3b26dd959c3c1f70e7106ca48c188639db816b594cbe821ed
|
|
4
|
+
data.tar.gz: 03e9f36d0704cd7f3c8bb6b9a79d318f5793a587e3e719084066f9cf91f395a4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e9d4d82c677bd83ba21c8590f6a92c5fd475bb9374243744fceb353f3acd985f99fd8ec28b9309b5ffca09f25db5ddef76850fb5f8163f105353b41d7b1abf3a
|
|
7
|
+
data.tar.gz: d65eb45d17fd233ac1de8b36d34b186b9f6f8bf82fcc106f16c045df1c943a65fb017f739c9da2a3a01027934a3e9f0d6afb5044531caecffcd86788708b25a8
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/CHANGELOG.md
CHANGED
|
@@ -19,6 +19,40 @@ Versioning: [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
19
19
|
|
|
20
20
|
### Security
|
|
21
21
|
|
|
22
|
+
## [3.0.6] - 2026-02-17
|
|
23
|
+
|
|
24
|
+
- TAG: [v3.0.6][3.0.6t]
|
|
25
|
+
- COVERAGE: 88.34% -- 727/823 lines in 27 files
|
|
26
|
+
- BRANCH COVERAGE: 76.05% -- 127/167 branches in 27 files
|
|
27
|
+
- 43.11% documented
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
|
|
31
|
+
- Test for bundler handling with pre-existing appraisal lockfiles
|
|
32
|
+
- Added acceptance test that verifies appraisal correctly handles `gemfiles/*.gemfile.lock` files with `BUNDLED WITH` specified
|
|
33
|
+
- Test validates that:
|
|
34
|
+
- Appraisal gemfiles with pre-created lockfiles install correctly
|
|
35
|
+
- Lockfiles preserve the `BUNDLED WITH` section reporting which bundler version was used
|
|
36
|
+
- The bundler version in the lockfile is correctly maintained during installation
|
|
37
|
+
- Note: Multi-version bundler switching in CI would require pre-installing multiple bundler versions; coverage is limited to lockfile preservation and environment handling.
|
|
38
|
+
|
|
39
|
+
### Fixed
|
|
40
|
+
|
|
41
|
+
- Restore bundler's automatic version switching for modern bundler versions (2.2+)
|
|
42
|
+
- Bundler can detect and switch to the version specified in `Gemfile.lock` (or appraisal lockfiles) via `BUNDLED WITH`
|
|
43
|
+
- Previously, `with_original_env` stripped all bundler-related variables, preventing bundler from detecting version mismatches and breaking test isolation
|
|
44
|
+
- Now uses `with_bundler_env` with selective cleanup:
|
|
45
|
+
- Starts from `Bundler.original_env` when available
|
|
46
|
+
- Preserves critical bundler and isolation variables (for example: `BUNDLE_GEMFILE`, `BUNDLE_APP_CONFIG`, `BUNDLE_PATH`, `BUNDLE_USER_CACHE`)
|
|
47
|
+
- Removes `BUNDLER_SETUP` and `BUNDLER_VERSION` activation markers
|
|
48
|
+
- Removes `bundler/setup` from `RUBYOPT` to prevent auto-activation in subprocesses
|
|
49
|
+
- Prevents `BUNDLE_LOCKFILE` lockfile pollution of subprocesses so per-gemfile lockfiles are created correctly
|
|
50
|
+
- This approach:
|
|
51
|
+
- Lets subprocess bundler start fresh and process the target gemfile cleanly
|
|
52
|
+
- Preserves test isolation and prevents global config pollution
|
|
53
|
+
- Enables committing appraisal lockfiles with specific bundler versions for stable, repeatable builds
|
|
54
|
+
- This fix maintains backward compatibility with all bundler versions
|
|
55
|
+
|
|
22
56
|
## [3.0.5] - 2026-02-14
|
|
23
57
|
|
|
24
58
|
- TAG: [v3.0.5][3.0.5t]
|
|
@@ -171,7 +205,9 @@ Versioning: [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
171
205
|
- code coverage tracked with Coveralls, QLTY.sh, and the kettle-soup-cover gem
|
|
172
206
|
- other minor fixes and improvements
|
|
173
207
|
|
|
174
|
-
[Unreleased]: https://github.com/appraisal-rb/appraisal2/compare/v3.0.
|
|
208
|
+
[Unreleased]: https://github.com/appraisal-rb/appraisal2/compare/v3.0.6...HEAD
|
|
209
|
+
[3.0.6]: https://github.com/appraisal-rb/appraisal2/compare/v3.0.5...v3.0.6
|
|
210
|
+
[3.0.6t]: https://github.com/appraisal-rb/appraisal2/releases/tag/v3.0.6
|
|
175
211
|
[3.0.5]: https://github.com/appraisal-rb/appraisal2/compare/v3.0.4...v3.0.5
|
|
176
212
|
[3.0.5t]: https://github.com/appraisal-rb/appraisal2/releases/tag/v3.0.5
|
|
177
213
|
[3.0.4]: https://github.com/appraisal-rb/appraisal2/compare/v3.0.3...v3.0.4
|
data/CONTRIBUTING.md
CHANGED
|
@@ -7,7 +7,7 @@ the [code of conduct][🤝conduct].
|
|
|
7
7
|
To submit a patch, please fork the project and create a patch with tests.
|
|
8
8
|
Once you're happy with it send a pull request.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Remember to [![Keep A Changelog][📗keep-changelog-img]][📗keep-changelog] if you make changes.
|
|
11
11
|
|
|
12
12
|
## You can help!
|
|
13
13
|
|
|
@@ -33,6 +33,23 @@ NOTE: Run tests with `act` to have confidence they will pass in CI.
|
|
|
33
33
|
many specs will fail locally in subsequent runs unless run via `act`.
|
|
34
34
|
The spec suite is not idempotent. This is a goal for the future, if you'd like to work on it.
|
|
35
35
|
|
|
36
|
+
## Appraisals
|
|
37
|
+
|
|
38
|
+
From time to time the [appraisal2][🚎appraisal2] gemfiles in `gemfiles/` will need to be updated.
|
|
39
|
+
They are created and updated with the commands:
|
|
40
|
+
|
|
41
|
+
```console
|
|
42
|
+
bin/rake appraisal:update
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
If you need to reset all gemfiles/*.gemfile.lock files:
|
|
46
|
+
|
|
47
|
+
```console
|
|
48
|
+
bin/rake appraisal:reset
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
When adding an appraisal to CI, check the [runner tool cache][🏃♂️runner-tool-cache] to see which runner to use.
|
|
52
|
+
|
|
36
53
|
## The Reek List
|
|
37
54
|
|
|
38
55
|
Take a look at the `reek` list which is the file called `REEK` and find something to improve.
|
|
@@ -86,37 +103,49 @@ Also see GitLab Contributors: [https://gitlab.com/appraisal-rb/appraisal2/-/grap
|
|
|
86
103
|
|
|
87
104
|
### One-time, Per-maintainer, Setup
|
|
88
105
|
|
|
89
|
-
**IMPORTANT**:
|
|
90
|
-
|
|
106
|
+
**IMPORTANT**: To sign a build,
|
|
107
|
+
a public key for signing gems will need to be picked up by the line in the
|
|
91
108
|
`gemspec` defining the `spec.cert_chain` (check the relevant ENV variables there).
|
|
92
|
-
All releases
|
|
109
|
+
All releases are signed releases.
|
|
93
110
|
See: [RubyGems Security Guide][🔒️rubygems-security-guide]
|
|
94
111
|
|
|
95
112
|
NOTE: To build without signing the gem you must set `SKIP_GEM_SIGNING` to some value in your environment.
|
|
96
113
|
|
|
97
114
|
### To release a new version:
|
|
98
115
|
|
|
99
|
-
|
|
116
|
+
#### Automated process
|
|
117
|
+
|
|
118
|
+
1. Update version.rb to contain the correct version-to-be-released.
|
|
119
|
+
2. Run `bundle exec kettle-changelog`.
|
|
120
|
+
3. Run `bundle exec kettle-release`.
|
|
121
|
+
4. Stay awake and monitor the release process for any errors, and answer any prompts.
|
|
122
|
+
|
|
123
|
+
#### Manual process
|
|
124
|
+
|
|
125
|
+
1. Run `bin/setup && bin/rake` as a "test, coverage, & linting" sanity check
|
|
100
126
|
2. Update the version number in `version.rb`, and ensure `CHANGELOG.md` reflects changes
|
|
101
127
|
3. Run `bin/setup && bin/rake` again as a secondary check, and to update `Gemfile.lock`
|
|
102
128
|
4. Run `git commit -am "🔖 Prepare release v<VERSION>"` to commit the changes
|
|
103
|
-
5. Run `git push` to trigger the final CI pipeline before release,
|
|
104
|
-
- NOTE: Remember to [check the build][🧪build]
|
|
129
|
+
5. Run `git push` to trigger the final CI pipeline before release, and merge PRs
|
|
130
|
+
- NOTE: Remember to [check the build][🧪build].
|
|
105
131
|
6. Run `export GIT_TRUNK_BRANCH_NAME="$(git remote show origin | grep 'HEAD branch' | cut -d ' ' -f5)" && echo $GIT_TRUNK_BRANCH_NAME`
|
|
106
132
|
7. Run `git checkout $GIT_TRUNK_BRANCH_NAME`
|
|
107
|
-
8. Run `git pull origin $GIT_TRUNK_BRANCH_NAME` to ensure
|
|
108
|
-
9. Set `SOURCE_DATE_EPOCH` so `rake build` and `rake release` use same timestamp
|
|
133
|
+
8. Run `git pull origin $GIT_TRUNK_BRANCH_NAME` to ensure latest trunk code
|
|
134
|
+
9. Optional for older Bundler (< 2.7.0): Set `SOURCE_DATE_EPOCH` so `rake build` and `rake release` use the same timestamp and generate the same checksums
|
|
135
|
+
- If your Bundler is >= 2.7.0, you can skip this; builds are reproducible by default.
|
|
109
136
|
- Run `export SOURCE_DATE_EPOCH=$EPOCHSECONDS && echo $SOURCE_DATE_EPOCH`
|
|
110
137
|
- If the echo above has no output, then it didn't work.
|
|
111
|
-
- Note
|
|
138
|
+
- Note: `zsh/datetime` module is needed, if running `zsh`.
|
|
112
139
|
- In older versions of `bash` you can use `date +%s` instead, i.e. `export SOURCE_DATE_EPOCH=$(date +%s) && echo $SOURCE_DATE_EPOCH`
|
|
113
140
|
10. Run `bundle exec rake build`
|
|
114
141
|
11. Run `bin/gem_checksums` (more context [1][🔒️rubygems-checksums-pr], [2][🔒️rubygems-guides-pr])
|
|
115
142
|
to create SHA-256 and SHA-512 checksums. This functionality is provided by the `stone_checksums`
|
|
116
143
|
[gem][💎stone_checksums].
|
|
117
|
-
-
|
|
118
|
-
12.
|
|
119
|
-
|
|
144
|
+
- The script automatically commits but does not push the checksums
|
|
145
|
+
12. Sanity check the SHA256, comparing with the output from the `bin/gem_checksums` command:
|
|
146
|
+
- `sha256sum pkg/<gem name>-<version>.gem`
|
|
147
|
+
13. Run `bundle exec rake release` which will create a git tag for the version,
|
|
148
|
+
push git commits and tags, and push the `.gem` file to the gem host configured in the gemspec.
|
|
120
149
|
|
|
121
150
|
[🚎src-main]: https://gitlab.com/appraisal-rb/appraisal2
|
|
122
151
|
[🧪build]: https://github.com/appraisal-rb/appraisal2/actions
|
|
@@ -125,7 +154,7 @@ NOTE: To build without signing the gem you must set `SKIP_GEM_SIGNING` to some v
|
|
|
125
154
|
[🖐contributors]: https://github.com/appraisal-rb/appraisal2/graphs/contributors
|
|
126
155
|
[🚎contributors-gl]: https://gitlab.com/appraisal-rb/appraisal2/-/graphs/main
|
|
127
156
|
[🖐contributors-img]: https://contrib.rocks/image?repo=appraisal-rb/appraisal2
|
|
128
|
-
[💎
|
|
157
|
+
[💎gem-coop]: https://gem.coop
|
|
129
158
|
[🔒️rubygems-security-guide]: https://guides.rubygems.org/security/#building-gems
|
|
130
159
|
[🔒️rubygems-checksums-pr]: https://github.com/rubygems/rubygems/pull/6022
|
|
131
160
|
[🔒️rubygems-guides-pr]: https://github.com/rubygems/guides/pull/325
|
|
@@ -134,3 +163,5 @@ NOTE: To build without signing the gem you must set `SKIP_GEM_SIGNING` to some v
|
|
|
134
163
|
[📗keep-changelog-img]: https://img.shields.io/badge/keep--a--changelog-1.0.0-FFDD67.svg?style=flat
|
|
135
164
|
[✉️discord-invite]: https://discord.gg/3qme4XHNKN
|
|
136
165
|
[✉️discord-invite-img]: https://img.shields.io/discord/1373797679469170758?style=for-the-badge
|
|
166
|
+
[🚎appraisal2]: https://github.com/appraisal-rb/appraisal2
|
|
167
|
+
[🏃♂️runner-tool-cache]: https://github.com/ruby/ruby-builder/releases/tag/toolcache
|
data/README.md
CHANGED
|
@@ -66,7 +66,7 @@ Appraisal2 adds:
|
|
|
66
66
|
| Documentation | [![Current release on RubyDoc.info][📜docs-cr-rd-img]][🚎yard-current] [![YARD on Galtzo.com][📜docs-head-rd-img]][🚎yard-head] [![BDFL Blog][🚂bdfl-blog-img]][🚂bdfl-blog] [![Wiki][📜wiki-img]][📜wiki] |
|
|
67
67
|
| Compliance | [![License: MIT][📄license-img]][📄license-ref] [![📄ilo-declaration-img]][📄ilo-declaration] [![Security Policy][🔐security-img]][🔐security] [![Contributor Covenant 2.1][🪇conduct-img]][🪇conduct] [![SemVer 2.0.0][📌semver-img]][📌semver] |
|
|
68
68
|
| Style | [![Enforced Code Style Linter][💎rlts-img]][💎rlts] [![Keep-A-Changelog 1.0.0][📗keep-changelog-img]][📗keep-changelog] [![Gitmoji Commits][📌gitmoji-img]][📌gitmoji] |
|
|
69
|
-
| Support | [![Live Chat on Discord][✉️discord-invite-img]][
|
|
69
|
+
| Support | [![Join Me on Daily.dev's RubyFriends][✉️ruby-friends-img]][✉️ruby-friends] [![Live Chat on Discord][✉️discord-invite-img-ftb]][🖼️galtzo-discord] [![Get help from me on Upwork][👨🏼🏫expsup-upwork-img]][👨🏼🏫expsup-upwork] [![Get help from me on Codementor][👨🏼🏫expsup-codementor-img]][👨🏼🏫expsup-codementor] |
|
|
70
70
|
| Enterprise Support | [![Get help from me on Tidelift][🏙️entsup-tidelift-img]][🏙️entsup-tidelift]<br/>💡Subscribe for support guarantees covering _all_ FLOSS dependencies!<br/>💡Tidelift is part of [Sonar][🏙️entsup-tidelift-sonar]!<br/>💡Tidelift pays maintainers to maintain the software you depend on!<br/>📊`@`Pointy Haired Boss: An [enterprise support][🏙️entsup-tidelift] subscription is "[never gonna let you down][🧮kloc]", and *supports* open source maintainers! |
|
|
71
71
|
| Comrade BDFL 🎖️ | [![Follow Me on LinkedIn][💖🖇linkedin-img]][💖🖇linkedin] [![Follow Me on Ruby.Social][💖🐘ruby-mast-img]][💖🐘ruby-mast] [![Follow Me on Bluesky][💖🦋bluesky-img]][💖🦋bluesky] [![Contact BDFL][🚂bdfl-contact-img]][🚂bdfl-contact] [![My technical writing][💖💁🏼♂️devto-img]][💖💁🏼♂️devto] |
|
|
72
72
|
| `...` 💖 | [![Find Me on WellFound:][💖✌️wellfound-img]][💖✌️wellfound] [![Find Me on CrunchBase][💖💲crunchbase-img]][💖💲crunchbase] [![My LinkTree][💖🌳linktree-img]][💖🌳linktree] [![More About Me][💖💁🏼♂️aboutme-img]][💖💁🏼♂️aboutme] [🧊][💖🧊berg] [🐙][💖🐙hub] [🛖][💖🛖hut] [🧪][💖🧪lab] |
|
|
@@ -1181,7 +1181,7 @@ Thanks for RTFM. ☺️
|
|
|
1181
1181
|
[📌gitmoji]:https://gitmoji.dev
|
|
1182
1182
|
[📌gitmoji-img]:https://img.shields.io/badge/gitmoji_commits-%20😜%20😍-34495e.svg?style=flat-square
|
|
1183
1183
|
[🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
|
|
1184
|
-
[🧮kloc-img]: https://img.shields.io/badge/KLOC-0.
|
|
1184
|
+
[🧮kloc-img]: https://img.shields.io/badge/KLOC-0.823-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
|
|
1185
1185
|
[🔐security]: SECURITY.md
|
|
1186
1186
|
[🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
|
|
1187
1187
|
[📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
|
data/lib/appraisal/command.rb
CHANGED
|
@@ -7,6 +7,33 @@ module Appraisal
|
|
|
7
7
|
class Command
|
|
8
8
|
attr_reader :command, :env, :gemfile
|
|
9
9
|
|
|
10
|
+
# BUNDLE_* environment variables that must be preserved for proper bundler operation
|
|
11
|
+
# and test isolation. These are preserved when using with_bundler_env to ensure:
|
|
12
|
+
# - Bundler version switching works (BUNDLE_GEMFILE)
|
|
13
|
+
# - Test isolation is maintained (BUNDLE_APP_CONFIG, etc.)
|
|
14
|
+
# - User settings are respected (BUNDLE_PATH, BUNDLE_USER_CACHE, etc.)
|
|
15
|
+
#
|
|
16
|
+
# NOTE: BUNDLE_LOCKFILE is NOT preserved because:
|
|
17
|
+
# - Bundler automatically infers lockfile from BUNDLE_GEMFILE (e.g., foo.gemfile -> foo.gemfile.lock)
|
|
18
|
+
# - Forcing BUNDLE_LOCKFILE breaks appraisal's ability to create per-gemfile lockfiles
|
|
19
|
+
# - Each appraisal needs its own lockfile, not the root Gemfile.lock
|
|
20
|
+
PRESERVED_BUNDLE_VARS = %w[
|
|
21
|
+
BUNDLE_GEMFILE
|
|
22
|
+
BUNDLE_APP_CONFIG
|
|
23
|
+
BUNDLE_PATH
|
|
24
|
+
BUNDLE_BIN_PATH
|
|
25
|
+
BUNDLE_USER_CONFIG
|
|
26
|
+
BUNDLE_USER_CACHE
|
|
27
|
+
BUNDLE_USER_PLUGIN
|
|
28
|
+
BUNDLE_IGNORE_FUNDING_REQUESTS
|
|
29
|
+
BUNDLE_DISABLE_SHARED_GEMS
|
|
30
|
+
].freeze
|
|
31
|
+
|
|
32
|
+
PRESERVED_RUNTIME_VARS = %w[
|
|
33
|
+
PATH
|
|
34
|
+
GEM_PATH
|
|
35
|
+
].freeze
|
|
36
|
+
|
|
10
37
|
def initialize(command, options = {})
|
|
11
38
|
@gemfile = options[:gemfile]
|
|
12
39
|
@env = options.fetch(:env, {})
|
|
@@ -15,19 +42,21 @@ module Appraisal
|
|
|
15
42
|
end
|
|
16
43
|
|
|
17
44
|
def run
|
|
18
|
-
# Capture BUNDLE_PATH from the current environment before with_original_env scrubs it
|
|
19
|
-
bundle_path = ENV["BUNDLE_PATH"]
|
|
20
45
|
run_env = test_environment.merge(env)
|
|
21
46
|
|
|
22
47
|
if @skip_bundle_exec
|
|
23
48
|
execute(run_env)
|
|
24
49
|
else
|
|
25
|
-
#
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
50
|
+
# For bundler version switching to work in modern bundler (2.2+),
|
|
51
|
+
# we need to preserve certain BUNDLE_* environment variables.
|
|
52
|
+
# However, we still need to isolate from the parent's bundler state
|
|
53
|
+
# to avoid conflicts.
|
|
54
|
+
#
|
|
55
|
+
# Solution: Use a selective environment approach instead of with_original_env,
|
|
56
|
+
# which strips all BUNDLE_* variables and breaks version switching.
|
|
57
|
+
with_bundler_env do
|
|
30
58
|
ensure_bundler_is_available
|
|
59
|
+
ensure_locked_bundler_is_available
|
|
31
60
|
execute(run_env)
|
|
32
61
|
end
|
|
33
62
|
end
|
|
@@ -35,6 +64,50 @@ module Appraisal
|
|
|
35
64
|
|
|
36
65
|
private
|
|
37
66
|
|
|
67
|
+
# Provide a clean environment while preserving bundler's version switching capability
|
|
68
|
+
# and test isolation settings.
|
|
69
|
+
#
|
|
70
|
+
# The current Ruby process has bundler activated, which adds bundler/setup to RUBYOPT.
|
|
71
|
+
# When we run a subprocess, we need to remove that activation so the subprocess bundler
|
|
72
|
+
# can start fresh. However, we keep all test isolation variables intact.
|
|
73
|
+
def with_bundler_env
|
|
74
|
+
backup_env = ENV.to_h
|
|
75
|
+
|
|
76
|
+
begin
|
|
77
|
+
clean_env = if Bundler.respond_to?(:original_env)
|
|
78
|
+
Bundler.original_env.to_h
|
|
79
|
+
else
|
|
80
|
+
backup_env.to_h
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Avoid leaking a global BUNDLE_LOCKFILE into subprocesses.
|
|
84
|
+
clean_env.delete("BUNDLE_LOCKFILE")
|
|
85
|
+
|
|
86
|
+
preserved_vars = PRESERVED_BUNDLE_VARS + PRESERVED_RUNTIME_VARS
|
|
87
|
+
|
|
88
|
+
preserved_vars.each do |var|
|
|
89
|
+
clean_env[var] = backup_env[var] if backup_env[var]
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Remove bundler/setup from RUBYOPT so subprocess doesn't auto-load bundler
|
|
93
|
+
if backup_env["RUBYOPT"]
|
|
94
|
+
rubyopt = backup_env["RUBYOPT"].split(" ")
|
|
95
|
+
rubyopt.reject! { |opt| opt == "-rbundler/setup" || opt.include?("bundler/setup") }
|
|
96
|
+
clean_env["RUBYOPT"] = rubyopt.join(" ") unless rubyopt.empty?
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Remove bundler activation markers from the subprocess environment
|
|
100
|
+
clean_env.delete("BUNDLER_SETUP")
|
|
101
|
+
clean_env.delete("BUNDLER_VERSION")
|
|
102
|
+
|
|
103
|
+
ENV.replace(clean_env)
|
|
104
|
+
|
|
105
|
+
yield
|
|
106
|
+
ensure
|
|
107
|
+
ENV.replace(backup_env)
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
|
|
38
111
|
def execute(run_env)
|
|
39
112
|
announce
|
|
40
113
|
|
|
@@ -65,6 +138,46 @@ manually.
|
|
|
65
138
|
exit(1)
|
|
66
139
|
end
|
|
67
140
|
|
|
141
|
+
def ensure_locked_bundler_is_available
|
|
142
|
+
# Bundler 2.2+ already switches to the lockfile version automatically.
|
|
143
|
+
# Only install the locked version as a fallback for older Bundler releases.
|
|
144
|
+
return if bundler_handles_lockfile_version?
|
|
145
|
+
|
|
146
|
+
locked_version = locked_bundler_version
|
|
147
|
+
return unless locked_version
|
|
148
|
+
|
|
149
|
+
return if system(%(gem list --silent -i bundler -v "#{locked_version}"))
|
|
150
|
+
|
|
151
|
+
puts ">> Bundler #{locked_version} not found, attempting to install..."
|
|
152
|
+
return if system("gem install bundler -v #{Shellwords.escape(locked_version)} --no-document")
|
|
153
|
+
|
|
154
|
+
puts
|
|
155
|
+
puts <<-ERROR.rstrip
|
|
156
|
+
Bundler #{locked_version} installation failed.
|
|
157
|
+
Please try running:
|
|
158
|
+
`gem install bundler -v #{locked_version}`
|
|
159
|
+
manually.
|
|
160
|
+
ERROR
|
|
161
|
+
exit(1)
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
def bundler_handles_lockfile_version?
|
|
165
|
+
return false unless defined?(Bundler::VERSION)
|
|
166
|
+
|
|
167
|
+
Gem::Version.new(Bundler::VERSION) >= Gem::Version.new("2.2.0")
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
def locked_bundler_version
|
|
171
|
+
return unless gemfile
|
|
172
|
+
|
|
173
|
+
lockfile_path = "#{gemfile}.lock"
|
|
174
|
+
return unless File.exist?(lockfile_path)
|
|
175
|
+
|
|
176
|
+
lockfile_content = File.read(lockfile_path)
|
|
177
|
+
match = lockfile_content.match(/BUNDLED WITH\s*\n\s*([^\s]+)/)
|
|
178
|
+
match && match[1]
|
|
179
|
+
end
|
|
180
|
+
|
|
68
181
|
def announce
|
|
69
182
|
if gemfile
|
|
70
183
|
puts ">> BUNDLE_GEMFILE=#{gemfile} #{command_as_string}"
|
data/lib/appraisal/version.rb
CHANGED
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: appraisal2
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.0.
|
|
4
|
+
version: 3.0.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Peter Boling
|
|
@@ -400,10 +400,10 @@ licenses:
|
|
|
400
400
|
- MIT
|
|
401
401
|
metadata:
|
|
402
402
|
homepage_uri: https://appraisal2.galtzo.com/
|
|
403
|
-
source_code_uri: https://github.com/appraisal-rb/appraisal2/releases/tag/v3.0.
|
|
404
|
-
changelog_uri: https://gitlab.com/appraisal-rb/appraisal2/-/blob/v3.0.
|
|
403
|
+
source_code_uri: https://github.com/appraisal-rb/appraisal2/releases/tag/v3.0.6
|
|
404
|
+
changelog_uri: https://gitlab.com/appraisal-rb/appraisal2/-/blob/v3.0.6/CHANGELOG.md
|
|
405
405
|
bug_tracker_uri: https://gitlab.com/appraisal-rb/appraisal2/-/issues
|
|
406
|
-
documentation_uri: https://www.rubydoc.info/gems/appraisal2/3.0.
|
|
406
|
+
documentation_uri: https://www.rubydoc.info/gems/appraisal2/3.0.6
|
|
407
407
|
wiki_uri: https://gitlab.com/appraisal-rb/appraisal2/-/wiki
|
|
408
408
|
funding_uri: https://github.com/sponsors/pboling
|
|
409
409
|
news_uri: https://www.railsbling.com/tags/appraisal2
|
metadata.gz.sig
CHANGED
|
Binary file
|