appraisal-matrix 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5bc730eb59878944e9b078ee6486cfc104df8f820660a3b2f5f11b02c2d5b735
4
- data.tar.gz: 7e13b5cb6866609568f7b30e62bbea9ed0120fcc107f1d73efebc1231316c22e
3
+ metadata.gz: 6b58a1b5ec3aea2557d2d9eaad20a88e0d57bf7531fc9dd26f78419db4ad11d5
4
+ data.tar.gz: d4e76f2d2cc0777f0622a5389017b6c62a09df1f5321b2e38f3bb75e778a74c6
5
5
  SHA512:
6
- metadata.gz: d7e535ac299153fa96e41ba82924cd6160cfb9711554ef1a6741a1bad21f2b1872a81caefcf57af64fd966bc9576123fcdc7efb60793bb8378174bdbfa0740ce
7
- data.tar.gz: cde84bde53c7dcae15b1311c63847536c34793b501ee3bfc62e536d6563dc30a9c4db7986344560184c85fc53af612cf8652801560eeee98fe8cfaef8fe1d15c
6
+ metadata.gz: 1023e48055bbbd5a4f1d8fc891685c948547385487e7e1a2058bb8cfcb910a9c3dc064fef2104af0edea70b6ad13c4020f7a32e076ba0326dca68eabaa32b91b
7
+ data.tar.gz: 8f324f7de5618b1b7509bdf9f9aeced7f3c0294460be19418a734d5204d3284e58e163ddf1b97b1c0b19be9ad0bfa0be4f95093d01cf52cee9aab59a8aa6976c
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.1.6
1
+ 3.0.6
data/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
3
3
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
4
4
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
5
 
6
+ ## 0.3.0 - 2024-07-16
7
+ ### Changed
8
+ - Changed the block passed to `appraisal_matrix` to be called with the versions of gems for the current matrix entry.
9
+
6
10
  ## 0.2.0 - 2024-07-09
7
11
  ### Added
8
12
  - Support special request options for `appraisal_matrix`:
data/README.md CHANGED
@@ -53,6 +53,18 @@ appraisal_matrix(activesupport: "6.1") do
53
53
  end
54
54
  ```
55
55
 
56
+ #### Block arguments
57
+ If you would like to setup conditional logic based off of the versions of the gems in the matrix, you can pass a block with arguments to `appraisal_matrix`.
58
+
59
+ ```ruby
60
+ appraisal_matrix(activesupport: "6.1") do |activesupport:|
61
+ # activesupport <Gem::Version>
62
+ if activesupport < "7"
63
+ remove_gem 'test_after_commit'
64
+ end
65
+ end
66
+ ```
67
+
56
68
  ### Appraising more than one Gem
57
69
 
58
70
  You can also pass more than one gem to `appraisal_matrix` to create a matrix of all combinations of the specified gems.
@@ -33,6 +33,13 @@ module Appraisal::Matrix
33
33
  # appraisal_matrix(rails: "6.0") do
34
34
  # gem "sqlite3", "~> 2.5"
35
35
  # end
36
+ # appraisal_matrix(rails: "6.0", sidekiq: "5.0") do |rails:, sidekiq:|
37
+ # if rails < "7"
38
+ # # do something...
39
+ # else
40
+ # # do something else...
41
+ # end
42
+ # end
36
43
  def appraisal_matrix(**kwargs, &block)
37
44
  # names_and_versions_to_test
38
45
  # [
@@ -76,7 +83,10 @@ module Appraisal::Matrix
76
83
  appraisal_spec.each do |gem_name, version|
77
84
  gem gem_name, "~> #{version}.0"
78
85
  end
79
- instance_eval(&block) if block
86
+ if block
87
+ block_args = appraisal_spec.to_h { |gem_name, version| [gem_name.to_sym, Gem::Version.new(version)] }
88
+ instance_exec(**block_args, &block)
89
+ end
80
90
  end
81
91
  end
82
92
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Appraisal
4
4
  module Matrix
5
- VERSION = "0.2.0"
5
+ VERSION = "0.3.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appraisal-matrix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Drew Caddell
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-09 00:00:00.000000000 Z
11
+ date: 2024-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appraisal
@@ -70,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
70
70
  - !ruby/object:Gem::Version
71
71
  version: '0'
72
72
  requirements: []
73
- rubygems_version: 3.3.27
73
+ rubygems_version: 3.2.33
74
74
  signing_key:
75
75
  specification_version: 4
76
76
  summary: Appraisal file DSL for generating a matrix of gemfiles.