enumerate_it 4.2.0 → 4.2.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 +4 -4
- data/.github/workflows/ci.yml +10 -7
- data/Appraisals +3 -0
- data/Gemfile.lock +79 -27
- data/gemfiles/rails_6.0.gemfile +1 -0
- data/gemfiles/rails_6.1.gemfile +1 -0
- data/gemfiles/rails_7.0.gemfile +1 -0
- data/gemfiles/rails_7.1.gemfile +1 -0
- data/gemfiles/rails_7.2.gemfile +3 -2
- data/gemfiles/rails_8.0.gemfile +3 -2
- data/gemfiles/rails_8.1.gemfile +2 -2
- data/lib/enumerate_it/base.rb +1 -1
- data/lib/enumerate_it/version.rb +1 -1
- data/spec/enumerate_it/base_spec.rb +10 -1
- data/spec/enumerate_it_spec.rb +1 -4
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 30af25c92670f35f261f3d6ad6dca3f302d3553d6a9a1adf0a91495402f11718
|
|
4
|
+
data.tar.gz: 5f8324535f04dc5553a4ef359cb0429294aa3257a23e3a9b7d2a9a08c344919e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 72f81a09f56ad298a98e21c4aa817e36f41b435ec747fb5f717b1004708877a2eef813aedf1127831126e1e7d6131f385bc9e1e39fcefb2aae3356f63d86c4ba
|
|
7
|
+
data.tar.gz: 993ecdc71d85a9c13eefef4f7129bf179de1d8af96694239691294f862427eeaffc28493b4e90457f6eaafff4744cce8c107a1ceb9c9cde6ab36a22ca2f4fe6d
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -9,12 +9,12 @@ jobs:
|
|
|
9
9
|
|
|
10
10
|
matrix:
|
|
11
11
|
ruby:
|
|
12
|
-
- 3.0
|
|
13
|
-
- 3.1
|
|
14
|
-
- 3.2
|
|
15
|
-
- 3.3
|
|
16
|
-
- 3.4
|
|
17
|
-
- 4.0
|
|
12
|
+
- "3.0"
|
|
13
|
+
- "3.1"
|
|
14
|
+
- "3.2"
|
|
15
|
+
- "3.3"
|
|
16
|
+
- "3.4"
|
|
17
|
+
- "4.0"
|
|
18
18
|
gemfile:
|
|
19
19
|
- gemfiles/rails_6.0.gemfile
|
|
20
20
|
- gemfiles/rails_6.1.gemfile
|
|
@@ -24,6 +24,9 @@ jobs:
|
|
|
24
24
|
- gemfiles/rails_8.0.gemfile
|
|
25
25
|
- gemfiles/rails_8.1.gemfile
|
|
26
26
|
exclude:
|
|
27
|
+
# Rails 7.2+ requires Ruby 3.1 or newer
|
|
28
|
+
- ruby: 3.0
|
|
29
|
+
gemfile: gemfiles/rails_7.2.gemfile
|
|
27
30
|
# Rails 8+ requires Ruby 3.2 or newer
|
|
28
31
|
- ruby: 3.0
|
|
29
32
|
gemfile: gemfiles/rails_8.0.gemfile
|
|
@@ -48,7 +51,7 @@ jobs:
|
|
|
48
51
|
|
|
49
52
|
steps:
|
|
50
53
|
- name: Checkout
|
|
51
|
-
uses: actions/checkout@
|
|
54
|
+
uses: actions/checkout@v7
|
|
52
55
|
- name: Set up Ruby
|
|
53
56
|
uses: ruby/setup-ruby@v1
|
|
54
57
|
with:
|
data/Appraisals
CHANGED
|
@@ -19,6 +19,9 @@ rails_versions = JSON.parse(Net::HTTP.get(URI('https://rubygems.org/api/v1/versi
|
|
|
19
19
|
gem 'sqlite3', '< 2' # Rails 6.x and 7.0 require sqlite3 v1.x
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
+
# Rails versions before 8.1 pass the removed quirks_mode option to JSON 3.
|
|
23
|
+
gem 'json', '< 3' if Gem::Version.new(rails_version) < Gem::Version.new('8.1')
|
|
24
|
+
|
|
22
25
|
# The following is likely necessary due to this issue (or something related):
|
|
23
26
|
# https://stackoverflow.com/a/79385484/1445184
|
|
24
27
|
if Gem::Version.new(rails_version) < Gem::Version.new(7.1)
|
data/Gemfile.lock
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
enumerate_it (4.2.
|
|
4
|
+
enumerate_it (4.2.1)
|
|
5
5
|
activesupport (>= 6.0.0)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: https://rubygems.org/
|
|
9
9
|
specs:
|
|
10
|
-
activemodel (8.1.
|
|
11
|
-
activesupport (= 8.1.
|
|
12
|
-
activerecord (8.1.
|
|
13
|
-
activemodel (= 8.1.
|
|
14
|
-
activesupport (= 8.1.
|
|
10
|
+
activemodel (8.1.4)
|
|
11
|
+
activesupport (= 8.1.4)
|
|
12
|
+
activerecord (8.1.4)
|
|
13
|
+
activemodel (= 8.1.4)
|
|
14
|
+
activesupport (= 8.1.4)
|
|
15
15
|
timeout (>= 0.4.0)
|
|
16
|
-
activesupport (8.1.
|
|
16
|
+
activesupport (8.1.4)
|
|
17
17
|
base64
|
|
18
18
|
bigdecimal
|
|
19
19
|
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
@@ -32,17 +32,17 @@ GEM
|
|
|
32
32
|
thor (>= 0.14.0)
|
|
33
33
|
ast (2.4.3)
|
|
34
34
|
base64 (0.3.0)
|
|
35
|
-
bigdecimal (4.1.
|
|
35
|
+
bigdecimal (4.1.3)
|
|
36
36
|
coderay (1.1.3)
|
|
37
|
-
concurrent-ruby (1.3.
|
|
37
|
+
concurrent-ruby (1.3.8)
|
|
38
38
|
connection_pool (3.0.2)
|
|
39
39
|
diff-lcs (1.6.2)
|
|
40
40
|
drb (2.2.3)
|
|
41
|
-
i18n (1.
|
|
41
|
+
i18n (1.15.2)
|
|
42
42
|
concurrent-ruby (~> 1.0)
|
|
43
|
-
io-console (0.
|
|
44
|
-
json (
|
|
45
|
-
language_server-protocol (3.17.0.
|
|
43
|
+
io-console (0.9.4)
|
|
44
|
+
json (3.0.2)
|
|
45
|
+
language_server-protocol (3.17.0.6)
|
|
46
46
|
lint_roller (1.1.0)
|
|
47
47
|
logger (1.7.0)
|
|
48
48
|
method_source (1.1.0)
|
|
@@ -50,8 +50,8 @@ GEM
|
|
|
50
50
|
minitest (6.0.6)
|
|
51
51
|
drb (~> 2.0)
|
|
52
52
|
prism (~> 1.5)
|
|
53
|
-
parallel (2.
|
|
54
|
-
parser (3.3.
|
|
53
|
+
parallel (2.3.0)
|
|
54
|
+
parser (3.3.12.0)
|
|
55
55
|
ast (~> 2.4.1)
|
|
56
56
|
racc
|
|
57
57
|
prism (1.9.0)
|
|
@@ -62,8 +62,8 @@ GEM
|
|
|
62
62
|
racc (1.8.1)
|
|
63
63
|
rainbow (3.1.1)
|
|
64
64
|
rake (13.4.2)
|
|
65
|
-
regexp_parser (2.
|
|
66
|
-
reline (0.
|
|
65
|
+
regexp_parser (2.13.1)
|
|
66
|
+
reline (0.7.0)
|
|
67
67
|
io-console (~> 0.5)
|
|
68
68
|
rspec (3.13.2)
|
|
69
69
|
rspec-core (~> 3.13.0)
|
|
@@ -78,18 +78,18 @@ GEM
|
|
|
78
78
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
79
79
|
rspec-support (~> 3.13.0)
|
|
80
80
|
rspec-support (3.13.7)
|
|
81
|
-
rubocop (1.
|
|
82
|
-
json (
|
|
81
|
+
rubocop (1.92.0)
|
|
82
|
+
json (>= 2.3)
|
|
83
83
|
language_server-protocol (~> 3.17.0.2)
|
|
84
84
|
lint_roller (~> 1.1.0)
|
|
85
85
|
parallel (>= 1.10)
|
|
86
86
|
parser (>= 3.3.0.2)
|
|
87
87
|
rainbow (>= 2.2.2, < 4.0)
|
|
88
|
-
regexp_parser (>= 2.
|
|
88
|
+
regexp_parser (>= 2.11.3, < 3.0)
|
|
89
89
|
rubocop-ast (>= 1.49.0, < 2.0)
|
|
90
90
|
ruby-progressbar (~> 1.7)
|
|
91
91
|
unicode-display_width (>= 2.4.0, < 4.0)
|
|
92
|
-
rubocop-ast (1.
|
|
92
|
+
rubocop-ast (1.50.0)
|
|
93
93
|
parser (>= 3.3.7.2)
|
|
94
94
|
prism (~> 1.7)
|
|
95
95
|
rubocop-rake (0.7.1)
|
|
@@ -101,16 +101,16 @@ GEM
|
|
|
101
101
|
rubocop (~> 1.86, >= 1.86.2)
|
|
102
102
|
ruby-progressbar (1.13.0)
|
|
103
103
|
securerandom (0.4.1)
|
|
104
|
-
sqlite3 (2.9.
|
|
104
|
+
sqlite3 (2.9.6)
|
|
105
105
|
mini_portile2 (~> 2.8.0)
|
|
106
106
|
thor (1.5.0)
|
|
107
107
|
timeout (0.6.1)
|
|
108
108
|
tzinfo (2.0.6)
|
|
109
109
|
concurrent-ruby (~> 1.0)
|
|
110
|
-
unicode-display_width (3.
|
|
111
|
-
unicode-emoji (~> 4.
|
|
112
|
-
unicode-emoji (4.
|
|
113
|
-
uri (1.1.
|
|
110
|
+
unicode-display_width (3.3.0)
|
|
111
|
+
unicode-emoji (~> 4.3)
|
|
112
|
+
unicode-emoji (4.3.0)
|
|
113
|
+
uri (1.1.2)
|
|
114
114
|
|
|
115
115
|
PLATFORMS
|
|
116
116
|
ruby
|
|
@@ -128,5 +128,57 @@ DEPENDENCIES
|
|
|
128
128
|
rubocop-rspec
|
|
129
129
|
sqlite3
|
|
130
130
|
|
|
131
|
+
CHECKSUMS
|
|
132
|
+
activemodel (8.1.4) sha256=9a0906c127bd118aa5f06157db12b8f750da83dccee72db2f658547a0ae7a0e8
|
|
133
|
+
activerecord (8.1.4) sha256=3b4957ea7f246c9231bd7faa909312eac03a9101aaf87977b6c52733ff00b04f
|
|
134
|
+
activesupport (8.1.4) sha256=891dd3fe43c4fc8391934b237b1189bb1f661c932a84a840043db9d46a4e80df
|
|
135
|
+
appraisal (2.5.0) sha256=36989221be127913b0dba8d114da2001e6b2dceea7bd4951200eaba764eed3ce
|
|
136
|
+
ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
|
|
137
|
+
base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
|
|
138
|
+
bigdecimal (4.1.3) sha256=61ebe1e5e559bdc3cc6f2c0ee7f427321fc838f59611c294356eb04d6e21cf66
|
|
139
|
+
bundler (4.0.22) sha256=d8d5ec84c8555e0af71db63ed7aee4d1a8fb839ec46d84212d61979242a5d75a
|
|
140
|
+
coderay (1.1.3) sha256=dc530018a4684512f8f38143cd2a096c9f02a1fc2459edcfe534787a7fc77d4b
|
|
141
|
+
concurrent-ruby (1.3.8) sha256=b2f1be836e968ccc78ccfce277ea79c72a88633f22306782c16ff23fb415d1e1
|
|
142
|
+
connection_pool (3.0.2) sha256=33fff5ba71a12d2aa26cb72b1db8bba2a1a01823559fb01d29eb74c286e62e0a
|
|
143
|
+
diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
|
|
144
|
+
drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
|
|
145
|
+
enumerate_it (4.2.1)
|
|
146
|
+
i18n (1.15.2) sha256=00f9eb62412fe593b2a65a97daa75300d37abb8f7202ec748e94b6d46a9dd1b5
|
|
147
|
+
io-console (0.9.4) sha256=a403304f32928ee85e56d457b4612ca43f2703b561a3258844992bd24085fbb1
|
|
148
|
+
json (3.0.2) sha256=8e6d7e7b11384c21230430cef90b71f14849a34a1f4452796670f7c981bd19df
|
|
149
|
+
language_server-protocol (3.17.0.6) sha256=5ef2c0c138f8267e1bc631d3328347d354f96724b0af22f2c79516120443b7f0
|
|
150
|
+
lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
|
|
151
|
+
logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
|
|
152
|
+
method_source (1.1.0) sha256=181301c9c45b731b4769bc81e8860e72f9161ad7d66dd99103c9ab84f560f5c5
|
|
153
|
+
mini_portile2 (2.8.9) sha256=0cd7c7f824e010c072e33f68bc02d85a00aeb6fce05bb4819c03dfd3c140c289
|
|
154
|
+
minitest (6.0.6) sha256=153ea36d1d987a62942382b61075745042a2b3123b1cd48f4c3675af9cc7d6f1
|
|
155
|
+
parallel (2.3.0) sha256=f75a3e904101ce6a1ccb6b8dc800cbafd42166d83330192438dcf29395167a6f
|
|
156
|
+
parser (3.3.12.0) sha256=21a6d7f755d5a24dfbdc6e6b772e4e879a52e7631a88bc5a3a134606052c9828
|
|
157
|
+
prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85
|
|
158
|
+
pry (0.16.0) sha256=d76c69065698ed1f85e717bd33d7942c38a50868f6b0673c636192b3d1b6054e
|
|
159
|
+
racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
|
|
160
|
+
rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
|
|
161
|
+
rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701
|
|
162
|
+
regexp_parser (2.13.1) sha256=5aedb6b7c35688f51e86eef17a15374dfd287c83f4ca644b2c5f3ec50a33b44b
|
|
163
|
+
reline (0.7.0) sha256=5b012d8e55dbf9d450f12bde2cf7d15ff546ae80b3f8f3b30e570d431815583d
|
|
164
|
+
rspec (3.13.2) sha256=206284a08ad798e61f86d7ca3e376718d52c0bc944626b2349266f239f820587
|
|
165
|
+
rspec-core (3.13.6) sha256=a8823c6411667b60a8bca135364351dda34cd55e44ff94c4be4633b37d828b2d
|
|
166
|
+
rspec-expectations (3.13.5) sha256=33a4d3a1d95060aea4c94e9f237030a8f9eae5615e9bd85718fe3a09e4b58836
|
|
167
|
+
rspec-mocks (3.13.8) sha256=086ad3d3d17533f4237643de0b5c42f04b66348c28bf6b9c2d3f4a3b01af1d47
|
|
168
|
+
rspec-support (3.13.7) sha256=0640e5570872aafefd79867901deeeeb40b0c9875a36b983d85f54fb7381c47c
|
|
169
|
+
rubocop (1.92.0) sha256=2af68041fb2e70bd9321d0479b49fad07f8008a3d0758c83347b4917128c56e0
|
|
170
|
+
rubocop-ast (1.50.0) sha256=b9ca88300da0803ee222ad20cdb30494c0a784eed06fdc35d254b06d662788db
|
|
171
|
+
rubocop-rake (0.7.1) sha256=3797f2b6810c3e9df7376c26d5f44f3475eda59eb1adc38e6f62ecf027cbae4d
|
|
172
|
+
rubocop-rspec (3.10.2) sha256=0b3e2ecc592cd10ecbf0095bb58d1e357905276e069643523cc19eb7495f65e2
|
|
173
|
+
ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
|
|
174
|
+
securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
|
|
175
|
+
sqlite3 (2.9.6) sha256=956fe606956420d04ac7157d3ace620c8caba2135b2e05c76e483493da24d08e
|
|
176
|
+
thor (1.5.0) sha256=e3a9e55fe857e44859ce104a84675ab6e8cd59c650a49106a05f55f136425e73
|
|
177
|
+
timeout (0.6.1) sha256=78f57368a7e7bbadec56971f78a3f5ecbcfb59b7fcbb0a3ed6ddc08a5094accb
|
|
178
|
+
tzinfo (2.0.6) sha256=8daf828cc77bcf7d63b0e3bdb6caa47e2272dcfaf4fbfe46f8c3a9df087a829b
|
|
179
|
+
unicode-display_width (3.3.0) sha256=4b7aa66a4b11db50f6f7e98411215cd0dd10eaecb665d36eec5bcacb3fa0b613
|
|
180
|
+
unicode-emoji (4.3.0) sha256=11c02fa73290378c066bb0562cd4c87d8e1b706fbbe0059ca12746a4244de8ce
|
|
181
|
+
uri (1.1.2) sha256=89292e98eabbef6248b0a0ed5e7e398e152f83f17560023a6d94a7f492b169fb
|
|
182
|
+
|
|
131
183
|
BUNDLED WITH
|
|
132
|
-
4.0.
|
|
184
|
+
4.0.22
|
data/gemfiles/rails_6.0.gemfile
CHANGED
data/gemfiles/rails_6.1.gemfile
CHANGED
data/gemfiles/rails_7.0.gemfile
CHANGED
data/gemfiles/rails_7.1.gemfile
CHANGED
data/gemfiles/rails_7.2.gemfile
CHANGED
data/gemfiles/rails_8.0.gemfile
CHANGED
data/gemfiles/rails_8.1.gemfile
CHANGED
data/lib/enumerate_it/base.rb
CHANGED
data/lib/enumerate_it/version.rb
CHANGED
|
@@ -135,6 +135,15 @@ describe EnumerateIt::Base do
|
|
|
135
135
|
it 'returns a hash' do
|
|
136
136
|
expect(TestEnumerationWithoutArray.to_h).to eq(value_one: '1', value_two: '2')
|
|
137
137
|
end
|
|
138
|
+
|
|
139
|
+
context 'specifying a sort mode' do
|
|
140
|
+
subject(:enumeration) { create_enumeration_class_with_sort_mode(:name) }
|
|
141
|
+
|
|
142
|
+
it 'returns a hash sorted by the given mode' do
|
|
143
|
+
expect(enumeration.to_h).to eq(bar: '2', bra: '4', foo: '1', omg: '3', zomg: '0')
|
|
144
|
+
expect(enumeration.to_h.keys).to eq(%i[bar bra foo omg zomg])
|
|
145
|
+
end
|
|
146
|
+
end
|
|
138
147
|
end
|
|
139
148
|
|
|
140
149
|
describe '.to_json' do
|
|
@@ -266,7 +275,7 @@ describe EnumerateIt::Base do
|
|
|
266
275
|
context 'when methods are defined inside custom_helpers block' do
|
|
267
276
|
it 'returns the registered names' do
|
|
268
277
|
expect(TestEnumerationWithCustomHelpers.custom_helper_methods)
|
|
269
|
-
.to
|
|
278
|
+
.to match_array(%i[lookup boolean?])
|
|
270
279
|
end
|
|
271
280
|
end
|
|
272
281
|
|
data/spec/enumerate_it_spec.rb
CHANGED
|
@@ -133,13 +133,10 @@ describe EnumerateIt do
|
|
|
133
133
|
context 'when using a nested class as the enumeration' do
|
|
134
134
|
let :class_with_nested_enum do
|
|
135
135
|
Class.new do
|
|
136
|
-
# rubocop:disable Lint/ConstantDefinitionInBlock
|
|
137
|
-
# rubocop:disable RSpec/LeakyConstantDeclaration
|
|
136
|
+
# rubocop:disable-next Lint/ConstantDefinitionInBlock, RSpec/LeakyConstantDeclaration
|
|
138
137
|
class NestedEnum < EnumerateIt::Base
|
|
139
138
|
associate_values foo: %w[1 Blerrgh], bar: [{ '2' => 'Blarghhh' }]
|
|
140
139
|
end
|
|
141
|
-
# rubocop:enable RSpec/LeakyConstantDeclaration
|
|
142
|
-
# rubocop:enable Lint/ConstantDefinitionInBlock
|
|
143
140
|
|
|
144
141
|
extend EnumerateIt
|
|
145
142
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: enumerate_it
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.2.
|
|
4
|
+
version: 4.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Cássio Marques
|
|
@@ -225,7 +225,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
225
225
|
- !ruby/object:Gem::Version
|
|
226
226
|
version: '0'
|
|
227
227
|
requirements: []
|
|
228
|
-
rubygems_version: 4.0.
|
|
228
|
+
rubygems_version: 4.0.17
|
|
229
229
|
specification_version: 4
|
|
230
230
|
summary: Ruby Enumerations
|
|
231
231
|
test_files: []
|