enumerate_it 3.2.0 → 3.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +51 -0
- data/Appraisals +1 -1
- data/Gemfile.lock +35 -36
- data/README.md +4 -4
- data/gemfiles/rails_5.2.gemfile +2 -2
- data/gemfiles/rails_6.0.gemfile +2 -2
- data/gemfiles/rails_6.1.gemfile +9 -0
- data/lib/enumerate_it/base.rb +1 -1
- data/lib/enumerate_it/version.rb +1 -1
- data/spec/enumerate_it/base_spec.rb +6 -0
- metadata +5 -4
- data/.travis.yml +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30519e86bb2c6fda44e28d8abb00dba9148ccea033a2c99a363fbf6f2fd42a09
|
4
|
+
data.tar.gz: 8f5bd97543dc7f14551829327a324d0830d62de53c46e4d08256d25a200694e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34a5e8b29263a13902bea44f4e7fab5c852c74acc4a2670fc35120be6955682e067e893117c9b4eb1cd3c15b99fe89583c8a5ba78b39b83af515e9c998908d5d
|
7
|
+
data.tar.gz: 88db7990bde7a0c25ef2ba773038f17741a92da080409f900b1eed5a68c7fe821ed5ef92b55547c59bb24a3cdcdb973a9601518a9c57bb852bba00ec00cd49ef
|
@@ -0,0 +1,51 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
test:
|
7
|
+
strategy:
|
8
|
+
fail-fast: false
|
9
|
+
|
10
|
+
matrix:
|
11
|
+
ruby:
|
12
|
+
- 2.5
|
13
|
+
- 2.6
|
14
|
+
- 2.7
|
15
|
+
- 3.0
|
16
|
+
gemfile:
|
17
|
+
- gemfiles/rails_5.0.gemfile
|
18
|
+
- gemfiles/rails_5.1.gemfile
|
19
|
+
- gemfiles/rails_5.2.gemfile
|
20
|
+
- gemfiles/rails_6.0.gemfile
|
21
|
+
- gemfiles/rails_6.1.gemfile
|
22
|
+
exclude:
|
23
|
+
# Rails < 6 does not support Ruby 3+:
|
24
|
+
# https://github.com/rails/rails/issues/40938#issuecomment-751357907
|
25
|
+
- ruby: 3.0
|
26
|
+
gemfile: gemfiles/rails_5.0.gemfile
|
27
|
+
- ruby: 3.0
|
28
|
+
gemfile: gemfiles/rails_5.1.gemfile
|
29
|
+
- ruby: 3.0
|
30
|
+
gemfile: gemfiles/rails_5.2.gemfile
|
31
|
+
|
32
|
+
env:
|
33
|
+
BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
|
34
|
+
|
35
|
+
runs-on: ubuntu-latest
|
36
|
+
|
37
|
+
steps:
|
38
|
+
- name: Checkout
|
39
|
+
uses: actions/checkout@v2
|
40
|
+
- name: Set up Ruby
|
41
|
+
uses: ruby/setup-ruby@v1
|
42
|
+
with:
|
43
|
+
ruby-version: ${{ matrix.ruby }}
|
44
|
+
bundler-cache: true
|
45
|
+
|
46
|
+
- name: Rubocop
|
47
|
+
if: ${{ matrix.ruby == '3.0' }}
|
48
|
+
run: "bundle exec rubocop"
|
49
|
+
|
50
|
+
- name: Tests
|
51
|
+
run: bundle exec rake spec
|
data/Appraisals
CHANGED
@@ -4,7 +4,7 @@ require 'json'
|
|
4
4
|
rails_versions = JSON.parse(Net::HTTP.get(URI('https://rubygems.org/api/v1/versions/rails.json')))
|
5
5
|
.group_by { |version| version['number'] }.keys.reject { |key| key =~ /rc|racecar|beta|pre/ }
|
6
6
|
|
7
|
-
%w[5.0 5.1 5.2 6.0].each do |version|
|
7
|
+
%w[5.0 5.1 5.2 6.0 6.1].each do |version|
|
8
8
|
appraise "rails_#{version}" do
|
9
9
|
current_version = rails_versions
|
10
10
|
.select { |key| key.match(/\A#{version}/) }
|
data/Gemfile.lock
CHANGED
@@ -1,75 +1,74 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
enumerate_it (3.2.
|
4
|
+
enumerate_it (3.2.1)
|
5
5
|
activesupport (>= 5.0.7.2)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activesupport (6.
|
10
|
+
activesupport (6.1.4)
|
11
11
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
12
|
-
i18n (>=
|
13
|
-
minitest (
|
14
|
-
tzinfo (~>
|
15
|
-
zeitwerk (~> 2.
|
16
|
-
appraisal (2.
|
12
|
+
i18n (>= 1.6, < 2)
|
13
|
+
minitest (>= 5.1)
|
14
|
+
tzinfo (~> 2.0)
|
15
|
+
zeitwerk (~> 2.3)
|
16
|
+
appraisal (2.4.1)
|
17
17
|
bundler
|
18
18
|
rake
|
19
19
|
thor (>= 0.14.0)
|
20
|
-
ast (2.4.
|
20
|
+
ast (2.4.2)
|
21
21
|
coderay (1.1.3)
|
22
|
-
concurrent-ruby (1.1.
|
22
|
+
concurrent-ruby (1.1.9)
|
23
23
|
diff-lcs (1.4.4)
|
24
|
-
i18n (1.8.
|
24
|
+
i18n (1.8.10)
|
25
25
|
concurrent-ruby (~> 1.0)
|
26
26
|
method_source (1.0.0)
|
27
|
-
minitest (5.14.
|
27
|
+
minitest (5.14.4)
|
28
28
|
parallel (1.20.1)
|
29
|
-
parser (
|
29
|
+
parser (3.0.2.0)
|
30
30
|
ast (~> 2.4.1)
|
31
|
-
pry (0.
|
31
|
+
pry (0.14.1)
|
32
32
|
coderay (~> 1.1)
|
33
33
|
method_source (~> 1.0)
|
34
34
|
rainbow (3.0.0)
|
35
|
-
rake (13.0.
|
36
|
-
regexp_parser (2.
|
37
|
-
rexml (3.2.
|
35
|
+
rake (13.0.6)
|
36
|
+
regexp_parser (2.1.1)
|
37
|
+
rexml (3.2.5)
|
38
38
|
rspec (3.10.0)
|
39
39
|
rspec-core (~> 3.10.0)
|
40
40
|
rspec-expectations (~> 3.10.0)
|
41
41
|
rspec-mocks (~> 3.10.0)
|
42
|
-
rspec-core (3.10.
|
42
|
+
rspec-core (3.10.1)
|
43
43
|
rspec-support (~> 3.10.0)
|
44
|
-
rspec-expectations (3.10.
|
44
|
+
rspec-expectations (3.10.1)
|
45
45
|
diff-lcs (>= 1.2.0, < 2.0)
|
46
46
|
rspec-support (~> 3.10.0)
|
47
|
-
rspec-mocks (3.10.
|
47
|
+
rspec-mocks (3.10.2)
|
48
48
|
diff-lcs (>= 1.2.0, < 2.0)
|
49
49
|
rspec-support (~> 3.10.0)
|
50
|
-
rspec-support (3.10.
|
51
|
-
rubocop (1.
|
50
|
+
rspec-support (3.10.2)
|
51
|
+
rubocop (1.18.4)
|
52
52
|
parallel (~> 1.10)
|
53
|
-
parser (>=
|
53
|
+
parser (>= 3.0.0.0)
|
54
54
|
rainbow (>= 2.2.2, < 4.0)
|
55
55
|
regexp_parser (>= 1.8, < 3.0)
|
56
56
|
rexml
|
57
|
-
rubocop-ast (>= 1.
|
57
|
+
rubocop-ast (>= 1.8.0, < 2.0)
|
58
58
|
ruby-progressbar (~> 1.7)
|
59
|
-
unicode-display_width (>= 1.4.0, <
|
60
|
-
rubocop-ast (1.
|
61
|
-
parser (>=
|
62
|
-
rubocop-rake (0.
|
63
|
-
rubocop
|
64
|
-
rubocop-rspec (2.0
|
59
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
60
|
+
rubocop-ast (1.8.0)
|
61
|
+
parser (>= 3.0.1.1)
|
62
|
+
rubocop-rake (0.6.0)
|
63
|
+
rubocop (~> 1.0)
|
64
|
+
rubocop-rspec (2.4.0)
|
65
65
|
rubocop (~> 1.0)
|
66
66
|
rubocop-ast (>= 1.1.0)
|
67
|
-
ruby-progressbar (1.
|
68
|
-
thor (1.0
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
unicode-display_width (1.7.0)
|
67
|
+
ruby-progressbar (1.11.0)
|
68
|
+
thor (1.1.0)
|
69
|
+
tzinfo (2.0.4)
|
70
|
+
concurrent-ruby (~> 1.0)
|
71
|
+
unicode-display_width (2.0.0)
|
73
72
|
wwtd (1.4.1)
|
74
73
|
zeitwerk (2.4.2)
|
75
74
|
|
@@ -89,4 +88,4 @@ DEPENDENCIES
|
|
89
88
|
wwtd
|
90
89
|
|
91
90
|
BUNDLED WITH
|
92
|
-
2.
|
91
|
+
2.2.24
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Enumerations for Ruby with some magic powers! 🎩
|
4
4
|
|
5
|
-
[![
|
5
|
+
[![CI Status](https://github.com/lucascaton/enumerate_it/workflows/CI/badge.svg)](https://github.com/lucascaton/enumerate_it/actions?query=workflow%3ACI)
|
6
6
|
[![Gem Version](https://badge.fury.io/rb/enumerate_it.svg)](https://rubygems.org/gems/enumerate_it)
|
7
7
|
[![Code Climate](https://codeclimate.com/github/lucascaton/enumerate_it/badges/gpa.svg)](https://codeclimate.com/github/lucascaton/enumerate_it)
|
8
8
|
[![Downloads](https://img.shields.io/gem/dt/enumerate_it.svg)](https://rubygems.org/gems/enumerate_it)
|
@@ -407,7 +407,7 @@ You sure can! 😄
|
|
407
407
|
* **Rails** `5.0+`
|
408
408
|
|
409
409
|
All versions are tested via
|
410
|
-
[
|
410
|
+
[GitHub Actions](https://github.com/lucascaton/enumerate_it/blob/HEAD/.github/workflows/ci.yml).
|
411
411
|
|
412
412
|
#### Can I set a value to always be at the end of a sorted list?
|
413
413
|
|
@@ -528,11 +528,11 @@ Changes are maintained under [Releases page](https://github.com/lucascaton/enume
|
|
528
528
|
* Fork the project.
|
529
529
|
* Make your feature addition or bug fix.
|
530
530
|
* Add tests for it. This is important so we don't break it in a future version unintentionally.
|
531
|
-
* [Optional] Run the tests agaist a specific Gemfile: `$ bundle exec appraisal rails_6.
|
531
|
+
* [Optional] Run the tests agaist a specific Gemfile: `$ bundle exec appraisal rails_6.1 rake spec`.
|
532
532
|
* Run the tests agaist all supported versions: `$ bundle exec rake` (or `$ bundle exec wwtd`)
|
533
533
|
* Commit, but please do not mess with `Rakefile`, version, or history.
|
534
534
|
* Send a Pull Request. Bonus points for topic branches.
|
535
535
|
|
536
536
|
## Copyright
|
537
537
|
|
538
|
-
Copyright (c) 2010-
|
538
|
+
Copyright (c) 2010-2021 Cássio Marques and Lucas Caton. See `LICENSE` file for details.
|
data/gemfiles/rails_5.2.gemfile
CHANGED
data/gemfiles/rails_6.0.gemfile
CHANGED
data/lib/enumerate_it/base.rb
CHANGED
data/lib/enumerate_it/version.rb
CHANGED
@@ -178,6 +178,12 @@ describe EnumerateIt::Base do
|
|
178
178
|
expect(TestEnumeration.value_for('THIS_IS_WRONG')).to be_nil
|
179
179
|
end
|
180
180
|
end
|
181
|
+
|
182
|
+
context 'when a constant named after the received value exists as an ancestor' do
|
183
|
+
it 'returns nil' do
|
184
|
+
expect(TestEnumeration.value_for('Module')).to be_nil
|
185
|
+
end
|
186
|
+
end
|
181
187
|
end
|
182
188
|
|
183
189
|
describe '.value_from_key' do
|
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: 3.2.
|
4
|
+
version: 3.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cássio Marques
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-08-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -157,10 +157,10 @@ executables: []
|
|
157
157
|
extensions: []
|
158
158
|
extra_rdoc_files: []
|
159
159
|
files:
|
160
|
+
- ".github/workflows/ci.yml"
|
160
161
|
- ".gitignore"
|
161
162
|
- ".rspec"
|
162
163
|
- ".rubocop.yml"
|
163
|
-
- ".travis.yml"
|
164
164
|
- Appraisals
|
165
165
|
- CHANGELOG.md
|
166
166
|
- Gemfile
|
@@ -173,6 +173,7 @@ files:
|
|
173
173
|
- gemfiles/rails_5.1.gemfile
|
174
174
|
- gemfiles/rails_5.2.gemfile
|
175
175
|
- gemfiles/rails_6.0.gemfile
|
176
|
+
- gemfiles/rails_6.1.gemfile
|
176
177
|
- lib/enumerate_it.rb
|
177
178
|
- lib/enumerate_it/base.rb
|
178
179
|
- lib/enumerate_it/class_methods.rb
|
@@ -208,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
208
209
|
- !ruby/object:Gem::Version
|
209
210
|
version: '0'
|
210
211
|
requirements: []
|
211
|
-
rubygems_version: 3.
|
212
|
+
rubygems_version: 3.2.25
|
212
213
|
signing_key:
|
213
214
|
specification_version: 4
|
214
215
|
summary: Ruby Enumerations
|
data/.travis.yml
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
|
3
|
-
sudo: false
|
4
|
-
|
5
|
-
cache: bundler
|
6
|
-
|
7
|
-
script:
|
8
|
-
- "ruby -e \"RUBY_VERSION == '2.7.2' ? system('bundle exec rubocop') : exit(0)\""
|
9
|
-
- bundle exec rake spec
|
10
|
-
|
11
|
-
rvm:
|
12
|
-
- 2.5.8
|
13
|
-
- 2.6.6
|
14
|
-
- 2.7.2
|
15
|
-
|
16
|
-
gemfile:
|
17
|
-
- gemfiles/rails_5.0.gemfile
|
18
|
-
- gemfiles/rails_5.1.gemfile
|
19
|
-
- gemfiles/rails_5.2.gemfile
|
20
|
-
- gemfiles/rails_6.0.gemfile
|
21
|
-
|
22
|
-
addons:
|
23
|
-
code_climate:
|
24
|
-
repo_token: 60e4a18e2a4bc86a98f92847f16756876c13d1e772058a9b3296643b04a697d7
|