appraisal2 3.1.0 → 3.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f60cf90f788c79484aa1f01d218259c1cbb9459afe960a368e3de03bd84b7088
4
- data.tar.gz: 8b96fc10c341d3c395e8e6c210ad4a3c98d36cc60d4e92c82ed13ce4cf774c72
3
+ metadata.gz: 2c2316bffba1559cb55b0c393052bd487630867af9e7a41d37c73c43315bc2b9
4
+ data.tar.gz: a37397565aa148f422d031621cb715d2b48bffcd3f9ddba06aa773488f984995
5
5
  SHA512:
6
- metadata.gz: 967d0442aafbbead64cb127c57eab72ecc48f85d9d820619f6eb142ff2aaf3c7d6510bddd32c2c8f6524ea072ebfb7e7fc593719276b2f80259948aba1396c5e
7
- data.tar.gz: 45bba8cce0a182a5eacb7614e0e239906d76f8905c9fe057ac8e91cdb013d17fe48e3ddd1c730b61c907c7c0f6ef1b10b42f1eab10063366a1dc72ff9cb47bbc
6
+ metadata.gz: f9a4fe27e3fb3e5979021df8b565f32ad454c924f2aaa1a15d0517d66b5fa2fd095c2daaae9cf0d422f4445510d44f6e0604d0acd735d3131189d7c54ab79ca9
7
+ data.tar.gz: 1415ef332fc92e289a1f28fe4b9cfcd401d5699e2556d1bacfb463e67420121fd45b6184fca10c6b88a445c83f59c5e573b4bab5b047bd8707d2667046448a15
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -30,6 +30,22 @@ Please file a bug if you notice a violation of semantic versioning.
30
30
 
31
31
  ### Security
32
32
 
33
+ ## [3.1.1] - 2026-06-06
34
+
35
+ - TAG: [v3.1.1][3.1.1t]
36
+ - COVERAGE: 90.23% -- 822/911 lines in 29 files
37
+ - BRANCH COVERAGE: 80.51% -- 157/195 branches in 29 files
38
+ - 42.25% documented
39
+
40
+ ### Added
41
+
42
+ - Added the `plugin` Appraisals DSL for generator-only companion gems that
43
+ should be loaded while Appraisal2 generates gemfiles without being serialized
44
+ into generated appraisal gemfiles.
45
+ - Added the `generator_only` root Gemfile DSL for dependencies that Bundler
46
+ should install in the active generator bundle but Appraisal2 should not
47
+ serialize into generated appraisal gemfiles.
48
+
33
49
  ## [3.1.0] - 2026-06-06
34
50
 
35
51
  - TAG: [v3.1.0][3.1.0t]
@@ -345,7 +361,9 @@ Please file a bug if you notice a violation of semantic versioning.
345
361
  - code coverage tracked with Coveralls, QLTY.sh, and the kettle-soup-cover gem
346
362
  - other minor fixes and improvements
347
363
 
348
- [Unreleased]: https://github.com/appraisal-rb/appraisal2/compare/v3.1.0...HEAD
364
+ [Unreleased]: https://github.com/appraisal-rb/appraisal2/compare/v3.1.1...HEAD
365
+ [3.1.1]: https://github.com/appraisal-rb/appraisal2/compare/v3.1.0...v3.1.1
366
+ [3.1.1t]: https://github.com/appraisal-rb/appraisal2/releases/tag/v3.1.1
349
367
  [3.1.0]: https://github.com/appraisal-rb/appraisal2/compare/v3.0.9...v3.1.0
350
368
  [3.1.0t]: https://github.com/appraisal-rb/appraisal2/releases/tag/v3.1.0
351
369
  [3.0.9]: https://github.com/appraisal-rb/appraisal2/compare/v3.0.8...v3.0.9
data/README.md CHANGED
@@ -178,6 +178,47 @@ This is intended for plugin gems that need deterministic generated output, such
178
178
  as style normalization of appraisal gemfiles, without monkey-patching Appraisal2
179
179
  internals.
180
180
 
181
+ ### Generator Plugins
182
+
183
+ Use `plugin` in `Appraisals` for companion gems that must be loaded while
184
+ Appraisal2 evaluates and generates appraisal gemfiles, but must not be written
185
+ as dependencies in the generated appraisal gemfiles.
186
+
187
+ ```ruby
188
+ plugin "appraisal2-rubocop",
189
+ :require => "appraisal2/rubocop",
190
+ :optional => true
191
+ ```
192
+
193
+ `plugin` requires the requested path in the active generator bundle. It does not
194
+ call `gem`, and it is not serialized into `gemfiles/*.gemfile`. This keeps
195
+ generator-only tooling out of appraisals that target older Rubies, while still
196
+ allowing modern generator workflows to load hooks such as
197
+ `Appraisal.transform_gemfile`.
198
+
199
+ Set `:optional => true` when some workflows evaluate `Appraisals` without the
200
+ plugin dependency installed. This is useful when a CI matrix uses one generator
201
+ bundle for old-Ruby appraisals and another modern workflow provides the plugin.
202
+
203
+ If the generator bundle needs dependencies that must not be copied into every
204
+ generated appraisal gemfile, wrap those root Gemfile declarations with
205
+ `generator_only` for Appraisal2 and leave the Bundler branch unchanged:
206
+
207
+ ```ruby
208
+ if respond_to?(:generator_only)
209
+ generator_only do
210
+ eval_gemfile "gemfiles/modular/style.gemfile"
211
+ end
212
+ else
213
+ eval_gemfile "gemfiles/modular/style.gemfile"
214
+ end
215
+ ```
216
+
217
+ Bundler evaluates the `else` branch while installing the active generator
218
+ bundle. Appraisal2 evaluates the `generator_only` branch while parsing the root
219
+ Gemfile, but intentionally does not serialize that block into generated
220
+ appraisal gemfiles.
221
+
181
222
  ## 🔧 Basic Usage
182
223
 
183
224
  Once you've configured the appraisals you want to use, you need to install the
@@ -750,7 +791,7 @@ Thanks for RTFM. ☺️
750
791
  [📌gitmoji]: https://gitmoji.dev
751
792
  [📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
752
793
  [🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
753
- [🧮kloc-img]: https://img.shields.io/badge/KLOC-0.894-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
794
+ [🧮kloc-img]: https://img.shields.io/badge/KLOC-0.911-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
754
795
  [🔐security]: https://github.com/appraisal-rb/appraisal2/blob/main/SECURITY.md
755
796
  [🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
756
797
  [📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
@@ -41,6 +41,16 @@ module Appraisal
41
41
  Customize.new(args)
42
42
  end
43
43
 
44
+ def plugin(name, *args)
45
+ options = args.last.is_a?(Hash) ? args.last : {}
46
+ require_path = options.key?(:require) ? options[:require] : name
47
+ optional = options.key?(:optional) ? options[:optional] : false
48
+
49
+ require require_path if require_path
50
+ rescue LoadError
51
+ raise unless optional
52
+ end
53
+
44
54
  private
45
55
 
46
56
  def run(definitions)
@@ -44,6 +44,10 @@ module Appraisal
44
44
  @eval_gemfile << [path, contents]
45
45
  end
46
46
 
47
+ def generator_only(&_block)
48
+ nil
49
+ end
50
+
47
51
  def gem(name, *requirements)
48
52
  @dependencies.add(name, substitute_git_source(requirements))
49
53
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Appraisal
4
4
  module Version
5
- VERSION = "3.1.0"
5
+ VERSION = "3.1.1"
6
6
  end
7
7
  VERSION = Version::VERSION # Traditional constant location
8
8
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Appraisal2
4
4
  module Version
5
- VERSION = "3.1.0"
5
+ VERSION = "3.1.1"
6
6
  end
7
7
  VERSION = Version::VERSION # Traditional Constant Location
8
8
  end
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.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Boling
@@ -437,10 +437,10 @@ licenses:
437
437
  - MIT
438
438
  metadata:
439
439
  homepage_uri: https://appraisal2.galtzo.com
440
- source_code_uri: https://github.com/appraisal-rb/appraisal2/tree/v3.1.0
441
- changelog_uri: https://github.com/appraisal-rb/appraisal2/blob/v3.1.0/CHANGELOG.md
440
+ source_code_uri: https://github.com/appraisal-rb/appraisal2/tree/v3.1.1
441
+ changelog_uri: https://github.com/appraisal-rb/appraisal2/blob/v3.1.1/CHANGELOG.md
442
442
  bug_tracker_uri: https://github.com/appraisal-rb/appraisal2/issues
443
- documentation_uri: https://www.rubydoc.info/gems/appraisal2/3.1.0
443
+ documentation_uri: https://www.rubydoc.info/gems/appraisal2/3.1.1
444
444
  funding_uri: https://github.com/sponsors/pboling
445
445
  wiki_uri: https://github.com/appraisal-rb/appraisal2/wiki
446
446
  news_uri: https://www.railsbling.com/tags/appraisal2
metadata.gz.sig CHANGED
Binary file