enumerate_it 3.1.0.rc1 → 3.2.2
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/.rubocop.yml +14 -3
- data/Appraisals +3 -3
- data/Gemfile.lock +55 -49
- data/README.md +6 -6
- data/Rakefile +4 -11
- data/enumerate_it.gemspec +5 -3
- data/gemfiles/rails_5.1.gemfile +1 -1
- data/gemfiles/rails_5.2.gemfile +3 -3
- data/gemfiles/rails_6.0.gemfile +3 -3
- data/gemfiles/rails_6.1.gemfile +9 -0
- data/lib/enumerate_it/base.rb +5 -5
- data/lib/enumerate_it/version.rb +1 -1
- data/lib/generators/enumerate_it/enum/templates/locale.yml +1 -1
- data/spec/enumerate_it/base_spec.rb +7 -1
- data/spec/enumerate_it_spec.rb +12 -2
- metadata +28 -14
- data/.travis.yml +0 -35
- data/gemfiles/rails_4.2.gemfile +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 114c01d4c307676728a2efbdc215df6596e5d915c8557d99f7ad3b9ff3230db0
|
4
|
+
data.tar.gz: ba845cf17d00731c6966148855ef2cc2cdbb37916d4c73fb6cdb070fae91c228
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8c91bf450d10feb513dd975e1d94c034722e4a99198f2379fbd4fa6fb281cabe3de559082ad450ab71e9191db89dcfe6fdeaa0ed943d8b3627f01fdc1c64599
|
7
|
+
data.tar.gz: be7eeb6ba615cdc711a32d10eaf8f7fb26ec2a29c64e18520c3bac960d875f025536c2b432ebdb2691da8d0d0a8c03575bde9979f05047384fdcbc2d3cbf9d39
|
@@ -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/.rubocop.yml
CHANGED
@@ -1,12 +1,14 @@
|
|
1
|
-
require:
|
1
|
+
require:
|
2
|
+
- rubocop-rspec
|
3
|
+
- rubocop-rake
|
2
4
|
|
3
5
|
inherit_mode:
|
4
6
|
merge:
|
5
7
|
- Exclude
|
6
8
|
|
7
9
|
AllCops:
|
8
|
-
|
9
|
-
|
10
|
+
NewCops: enable
|
11
|
+
TargetRubyVersion: 2.5
|
10
12
|
|
11
13
|
Exclude:
|
12
14
|
- 'lib/generators/enumerate_it/enum/templates/**/*'
|
@@ -21,6 +23,12 @@ Layout/EndAlignment:
|
|
21
23
|
Layout/LineLength:
|
22
24
|
Max: 100
|
23
25
|
|
26
|
+
Lint/RaiseException:
|
27
|
+
Enabled: true
|
28
|
+
|
29
|
+
Lint/StructNewOverride:
|
30
|
+
Enabled: true
|
31
|
+
|
24
32
|
Metrics/BlockLength:
|
25
33
|
Exclude:
|
26
34
|
- 'spec/**/*'
|
@@ -60,6 +68,9 @@ Naming/PredicateName:
|
|
60
68
|
Exclude:
|
61
69
|
- 'lib/enumerate_it/class_methods.rb'
|
62
70
|
|
71
|
+
Naming/VariableNumber:
|
72
|
+
EnforcedStyle: snake_case
|
73
|
+
|
63
74
|
RSpec/MultipleExpectations:
|
64
75
|
Enabled: false
|
65
76
|
|
data/Appraisals
CHANGED
@@ -2,9 +2,9 @@ require 'net/http'
|
|
2
2
|
require 'json'
|
3
3
|
|
4
4
|
rails_versions = JSON.parse(Net::HTTP.get(URI('https://rubygems.org/api/v1/versions/rails.json')))
|
5
|
-
.group_by { |version| version['number'] }.keys.
|
5
|
+
.group_by { |version| version['number'] }.keys.grep_v(/rc|racecar|beta|pre/)
|
6
6
|
|
7
|
-
%w[
|
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}/) }
|
@@ -13,6 +13,6 @@ rails_versions = JSON.parse(Net::HTTP.get(URI('https://rubygems.org/api/v1/versi
|
|
13
13
|
gem 'activesupport', "~> #{current_version}"
|
14
14
|
gem 'activerecord', "~> #{current_version}"
|
15
15
|
|
16
|
-
gem 'sqlite3', Gem::Version.new(version) > Gem::Version.new(5.0) ? '~> 1.4.
|
16
|
+
gem 'sqlite3', Gem::Version.new(version) > Gem::Version.new(5.0) ? '~> 1.4.2' : '< 1.4'
|
17
17
|
end
|
18
18
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,71 +1,76 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
enumerate_it (3.
|
5
|
-
activesupport (>=
|
4
|
+
enumerate_it (3.2.2)
|
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.1)
|
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.
|
21
|
-
coderay (1.1.
|
22
|
-
concurrent-ruby (1.1.
|
23
|
-
diff-lcs (1.
|
24
|
-
i18n (1.8.
|
20
|
+
ast (2.4.2)
|
21
|
+
coderay (1.1.3)
|
22
|
+
concurrent-ruby (1.1.9)
|
23
|
+
diff-lcs (1.4.4)
|
24
|
+
i18n (1.8.11)
|
25
25
|
concurrent-ruby (~> 1.0)
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
method_source (~> 0.9.0)
|
26
|
+
method_source (1.0.0)
|
27
|
+
minitest (5.14.4)
|
28
|
+
parallel (1.20.1)
|
29
|
+
parser (3.0.2.0)
|
30
|
+
ast (~> 2.4.1)
|
31
|
+
pry (0.14.1)
|
32
|
+
coderay (~> 1.1)
|
33
|
+
method_source (~> 1.0)
|
35
34
|
rainbow (3.0.0)
|
36
|
-
rake (13.0.
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
rspec-
|
41
|
-
rspec-
|
42
|
-
|
43
|
-
|
44
|
-
|
35
|
+
rake (13.0.6)
|
36
|
+
regexp_parser (2.1.1)
|
37
|
+
rexml (3.2.5)
|
38
|
+
rspec (3.10.0)
|
39
|
+
rspec-core (~> 3.10.0)
|
40
|
+
rspec-expectations (~> 3.10.0)
|
41
|
+
rspec-mocks (~> 3.10.0)
|
42
|
+
rspec-core (3.10.1)
|
43
|
+
rspec-support (~> 3.10.0)
|
44
|
+
rspec-expectations (3.10.1)
|
45
45
|
diff-lcs (>= 1.2.0, < 2.0)
|
46
|
-
rspec-support (~> 3.
|
47
|
-
rspec-mocks (3.
|
46
|
+
rspec-support (~> 3.10.0)
|
47
|
+
rspec-mocks (3.10.2)
|
48
48
|
diff-lcs (>= 1.2.0, < 2.0)
|
49
|
-
rspec-support (~> 3.
|
50
|
-
rspec-support (3.
|
51
|
-
rubocop (
|
52
|
-
jaro_winkler (~> 1.5.1)
|
49
|
+
rspec-support (~> 3.10.0)
|
50
|
+
rspec-support (3.10.2)
|
51
|
+
rubocop (1.18.4)
|
53
52
|
parallel (~> 1.10)
|
54
|
-
parser (>=
|
53
|
+
parser (>= 3.0.0.0)
|
55
54
|
rainbow (>= 2.2.2, < 4.0)
|
55
|
+
regexp_parser (>= 1.8, < 3.0)
|
56
56
|
rexml
|
57
|
+
rubocop-ast (>= 1.8.0, < 2.0)
|
57
58
|
ruby-progressbar (~> 1.7)
|
58
|
-
unicode-display_width (>= 1.4.0, <
|
59
|
-
rubocop-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
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
|
+
rubocop (~> 1.0)
|
66
|
+
rubocop-ast (>= 1.1.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)
|
67
72
|
wwtd (1.4.1)
|
68
|
-
zeitwerk (2.
|
73
|
+
zeitwerk (2.5.1)
|
69
74
|
|
70
75
|
PLATFORMS
|
71
76
|
ruby
|
@@ -78,8 +83,9 @@ DEPENDENCIES
|
|
78
83
|
rake
|
79
84
|
rspec
|
80
85
|
rubocop
|
86
|
+
rubocop-rake
|
81
87
|
rubocop-rspec
|
82
88
|
wwtd
|
83
89
|
|
84
90
|
BUNDLED WITH
|
85
|
-
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)
|
@@ -403,11 +403,11 @@ You sure can! 😄
|
|
403
403
|
|
404
404
|
#### What versions of Ruby and Rails are supported?
|
405
405
|
|
406
|
-
* **Ruby**: `2.
|
407
|
-
* **Rails** `
|
406
|
+
* **Ruby**: `2.5+`
|
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/Rakefile
CHANGED
@@ -1,14 +1,7 @@
|
|
1
1
|
require 'bundler/gem_tasks'
|
2
|
+
require 'rspec/core/rake_task'
|
2
3
|
|
3
|
-
|
4
|
-
|
4
|
+
Bundler::GemHelper.install_tasks
|
5
|
+
RSpec::Core::RakeTask.new(:spec)
|
5
6
|
|
6
|
-
|
7
|
-
RSpec::Core::RakeTask.new(:spec)
|
8
|
-
|
9
|
-
task default: :spec
|
10
|
-
else
|
11
|
-
require 'appraisal'
|
12
|
-
|
13
|
-
task default: :appraisal
|
14
|
-
end
|
7
|
+
task default: :spec
|
data/enumerate_it.gemspec
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
$LOAD_PATH << File.expand_path('lib', __dir__)
|
2
|
+
require 'enumerate_it/version'
|
2
3
|
|
3
4
|
Gem::Specification.new do |gem|
|
4
5
|
gem.authors = ['Cássio Marques', 'Lucas Caton']
|
@@ -12,14 +13,14 @@ Gem::Specification.new do |gem|
|
|
12
13
|
gem.name = 'enumerate_it'
|
13
14
|
gem.require_paths = ['lib']
|
14
15
|
gem.version = EnumerateIt::VERSION
|
15
|
-
gem.required_ruby_version = '>= 2.
|
16
|
+
gem.required_ruby_version = '>= 2.5.8'
|
16
17
|
|
17
18
|
gem.metadata = {
|
18
19
|
'source_code_uri' => 'https://github.com/lucascaton/enumerate_it',
|
19
20
|
'changelog_uri' => 'https://github.com/lucascaton/enumerate_it/releases'
|
20
21
|
}
|
21
22
|
|
22
|
-
gem.add_dependency 'activesupport', '>=
|
23
|
+
gem.add_dependency 'activesupport', '>= 5.0.7.2'
|
23
24
|
|
24
25
|
gem.add_development_dependency 'appraisal'
|
25
26
|
gem.add_development_dependency 'bundler'
|
@@ -27,6 +28,7 @@ Gem::Specification.new do |gem|
|
|
27
28
|
gem.add_development_dependency 'rake'
|
28
29
|
gem.add_development_dependency 'rspec'
|
29
30
|
gem.add_development_dependency 'rubocop'
|
31
|
+
gem.add_development_dependency 'rubocop-rake'
|
30
32
|
gem.add_development_dependency 'rubocop-rspec'
|
31
33
|
gem.add_development_dependency 'wwtd'
|
32
34
|
end
|
data/gemfiles/rails_5.1.gemfile
CHANGED
data/gemfiles/rails_5.2.gemfile
CHANGED
data/gemfiles/rails_6.0.gemfile
CHANGED
data/lib/enumerate_it/base.rb
CHANGED
@@ -43,16 +43,16 @@ module EnumerateIt
|
|
43
43
|
list.length
|
44
44
|
end
|
45
45
|
|
46
|
-
def each_translation
|
47
|
-
each_value { |value|
|
46
|
+
def each_translation(&block)
|
47
|
+
each_value { |value| block.call t(value) }
|
48
48
|
end
|
49
49
|
|
50
50
|
def translations
|
51
51
|
list.map { |value| t(value) }
|
52
52
|
end
|
53
53
|
|
54
|
-
def each_value
|
55
|
-
list.each
|
54
|
+
def each_value(&block)
|
55
|
+
list.each(&block)
|
56
56
|
end
|
57
57
|
|
58
58
|
def to_json(options = nil)
|
@@ -69,7 +69,7 @@ module EnumerateIt
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def value_for(value)
|
72
|
-
const_get(value.to_sym)
|
72
|
+
const_get(value.to_sym, false)
|
73
73
|
rescue NameError
|
74
74
|
nil
|
75
75
|
end
|
data/lib/enumerate_it/version.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require 'spec_helper'
|
2
2
|
|
3
3
|
describe EnumerateIt::Base do
|
4
4
|
it 'creates constants for each enumeration value' do
|
@@ -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
|
data/spec/enumerate_it_spec.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
-
require
|
1
|
+
require 'spec_helper'
|
2
2
|
|
3
3
|
describe EnumerateIt do
|
4
4
|
let :test_class do
|
5
5
|
Class.new do
|
6
6
|
extend EnumerateIt
|
7
7
|
attr_accessor :foobar
|
8
|
+
|
8
9
|
has_enumeration_for :foobar, with: TestEnumeration
|
9
10
|
|
10
11
|
def initialize(foobar)
|
@@ -62,6 +63,7 @@ describe EnumerateIt do
|
|
62
63
|
Class.new do
|
63
64
|
extend EnumerateIt
|
64
65
|
attr_accessor :foobar
|
66
|
+
|
65
67
|
has_enumeration_for :foobar, with: TestEnumerationWithoutArray
|
66
68
|
|
67
69
|
def initialize(foobar)
|
@@ -92,6 +94,7 @@ describe EnumerateIt do
|
|
92
94
|
Class.new do
|
93
95
|
extend EnumerateIt
|
94
96
|
attr_accessor :test_enumeration
|
97
|
+
|
95
98
|
has_enumeration_for :test_enumeration
|
96
99
|
|
97
100
|
def initialize(test_enumeration_value)
|
@@ -109,14 +112,17 @@ describe EnumerateIt do
|
|
109
112
|
context 'when using a nested class as the enumeration' do
|
110
113
|
let :class_with_nested_enum do
|
111
114
|
Class.new do
|
115
|
+
# rubocop:disable Lint/ConstantDefinitionInBlock
|
112
116
|
# rubocop:disable RSpec/LeakyConstantDeclaration
|
113
117
|
class NestedEnum < EnumerateIt::Base
|
114
118
|
associate_values foo: %w[1 Blerrgh], bar: ['2' => 'Blarghhh']
|
115
119
|
end
|
116
120
|
# rubocop:enable RSpec/LeakyConstantDeclaration
|
121
|
+
# rubocop:enable Lint/ConstantDefinitionInBlock
|
117
122
|
|
118
123
|
extend EnumerateIt
|
119
124
|
attr_accessor :nested_enum
|
125
|
+
|
120
126
|
has_enumeration_for :nested_enum
|
121
127
|
|
122
128
|
def initialize(nested_enum_value)
|
@@ -137,6 +143,7 @@ describe EnumerateIt do
|
|
137
143
|
Class.new do
|
138
144
|
extend EnumerateIt
|
139
145
|
attr_accessor :foobar
|
146
|
+
|
140
147
|
has_enumeration_for :foobar, with: TestEnumeration, create_helpers: true
|
141
148
|
|
142
149
|
def initialize(foobar)
|
@@ -177,6 +184,7 @@ describe EnumerateIt do
|
|
177
184
|
Class.new do
|
178
185
|
extend EnumerateIt
|
179
186
|
attr_accessor :foobar
|
187
|
+
|
180
188
|
has_enumeration_for :foobar, with: TestEnumeration, create_helpers: { prefix: true }
|
181
189
|
|
182
190
|
def initialize(foobar)
|
@@ -218,6 +226,7 @@ describe EnumerateIt do
|
|
218
226
|
Class.new do
|
219
227
|
extend EnumerateIt
|
220
228
|
attr_accessor :foo
|
229
|
+
|
221
230
|
has_enumeration_for :foo, with: PolymorphicEnum, create_helpers: { polymorphic: true }
|
222
231
|
end
|
223
232
|
end
|
@@ -243,6 +252,7 @@ describe EnumerateIt do
|
|
243
252
|
Class.new do
|
244
253
|
extend EnumerateIt
|
245
254
|
attr_accessor :foo
|
255
|
+
|
246
256
|
has_enumeration_for :foo, with: PolymorphicEnum,
|
247
257
|
create_helpers: { polymorphic: { suffix: '_strategy' } }
|
248
258
|
end
|
@@ -283,7 +293,7 @@ describe EnumerateIt do
|
|
283
293
|
|
284
294
|
TestEnumeration.enumeration.each do |symbol, pair|
|
285
295
|
expect(test_class_with_scope.public_send(symbol).to_sql)
|
286
|
-
.to match(/WHERE "test_class_with_scopes"."foobar" =
|
296
|
+
.to match(/WHERE "test_class_with_scopes"."foobar" = '#{pair.first}'/)
|
287
297
|
end
|
288
298
|
end
|
289
299
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enumerate_it
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cássio Marques
|
8
8
|
- Lucas Caton
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-11-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
20
|
+
version: 5.0.7.2
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
27
|
+
version: 5.0.7.2
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: appraisal
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -109,6 +109,20 @@ dependencies:
|
|
109
109
|
- - ">="
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: '0'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: rubocop-rake
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ">="
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
112
126
|
- !ruby/object:Gem::Dependency
|
113
127
|
name: rubocop-rspec
|
114
128
|
requirement: !ruby/object:Gem::Requirement
|
@@ -138,15 +152,15 @@ dependencies:
|
|
138
152
|
- !ruby/object:Gem::Version
|
139
153
|
version: '0'
|
140
154
|
description: Enumerations for Ruby with some magic powers!
|
141
|
-
email:
|
155
|
+
email:
|
142
156
|
executables: []
|
143
157
|
extensions: []
|
144
158
|
extra_rdoc_files: []
|
145
159
|
files:
|
160
|
+
- ".github/workflows/ci.yml"
|
146
161
|
- ".gitignore"
|
147
162
|
- ".rspec"
|
148
163
|
- ".rubocop.yml"
|
149
|
-
- ".travis.yml"
|
150
164
|
- Appraisals
|
151
165
|
- CHANGELOG.md
|
152
166
|
- Gemfile
|
@@ -155,11 +169,11 @@ files:
|
|
155
169
|
- README.md
|
156
170
|
- Rakefile
|
157
171
|
- enumerate_it.gemspec
|
158
|
-
- gemfiles/rails_4.2.gemfile
|
159
172
|
- gemfiles/rails_5.0.gemfile
|
160
173
|
- gemfiles/rails_5.1.gemfile
|
161
174
|
- gemfiles/rails_5.2.gemfile
|
162
175
|
- gemfiles/rails_6.0.gemfile
|
176
|
+
- gemfiles/rails_6.1.gemfile
|
163
177
|
- lib/enumerate_it.rb
|
164
178
|
- lib/enumerate_it/base.rb
|
165
179
|
- lib/enumerate_it/class_methods.rb
|
@@ -180,7 +194,7 @@ licenses:
|
|
180
194
|
metadata:
|
181
195
|
source_code_uri: https://github.com/lucascaton/enumerate_it
|
182
196
|
changelog_uri: https://github.com/lucascaton/enumerate_it/releases
|
183
|
-
post_install_message:
|
197
|
+
post_install_message:
|
184
198
|
rdoc_options: []
|
185
199
|
require_paths:
|
186
200
|
- lib
|
@@ -188,15 +202,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
188
202
|
requirements:
|
189
203
|
- - ">="
|
190
204
|
- !ruby/object:Gem::Version
|
191
|
-
version: 2.
|
205
|
+
version: 2.5.8
|
192
206
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
193
207
|
requirements:
|
194
|
-
- - "
|
208
|
+
- - ">="
|
195
209
|
- !ruby/object:Gem::Version
|
196
|
-
version:
|
210
|
+
version: '0'
|
197
211
|
requirements: []
|
198
|
-
rubygems_version: 3.
|
199
|
-
signing_key:
|
212
|
+
rubygems_version: 3.2.26
|
213
|
+
signing_key:
|
200
214
|
specification_version: 4
|
201
215
|
summary: Ruby Enumerations
|
202
216
|
test_files:
|
data/.travis.yml
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
|
3
|
-
sudo: false
|
4
|
-
|
5
|
-
cache: bundler
|
6
|
-
|
7
|
-
script:
|
8
|
-
- "ruby -e \"RUBY_VERSION == '2.7.0' ? system('bundle exec rubocop') : exit(0)\""
|
9
|
-
- bundle exec rake spec
|
10
|
-
|
11
|
-
rvm:
|
12
|
-
- 2.4.9
|
13
|
-
- 2.5.7
|
14
|
-
- 2.6.5
|
15
|
-
- 2.7.0
|
16
|
-
|
17
|
-
gemfile:
|
18
|
-
- gemfiles/rails_4.2.gemfile
|
19
|
-
- gemfiles/rails_5.0.gemfile
|
20
|
-
- gemfiles/rails_5.1.gemfile
|
21
|
-
- gemfiles/rails_5.2.gemfile
|
22
|
-
- gemfiles/rails_6.0.gemfile
|
23
|
-
|
24
|
-
matrix:
|
25
|
-
exclude:
|
26
|
-
# Rails 4.2 isn't compatible with Ruby 2.7+
|
27
|
-
- rvm: 2.7.0
|
28
|
-
gemfile: gemfiles/rails_4.2.gemfile
|
29
|
-
# Rails 6 requires Ruby 2.5+
|
30
|
-
- rvm: 2.4.9
|
31
|
-
gemfile: gemfiles/rails_6.0.gemfile
|
32
|
-
|
33
|
-
addons:
|
34
|
-
code_climate:
|
35
|
-
repo_token: 60e4a18e2a4bc86a98f92847f16756876c13d1e772058a9b3296643b04a697d7
|