human_enum 0.1.3 → 1.1.3

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.
@@ -0,0 +1,196 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ human_enum (1.1.3)
5
+ activerecord (>= 6.1, < 9)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ activemodel (7.2.2.1)
11
+ activesupport (= 7.2.2.1)
12
+ activerecord (7.2.2.1)
13
+ activemodel (= 7.2.2.1)
14
+ activesupport (= 7.2.2.1)
15
+ timeout (>= 0.4.0)
16
+ activesupport (7.2.2.1)
17
+ base64
18
+ benchmark (>= 0.3)
19
+ bigdecimal
20
+ concurrent-ruby (~> 1.0, >= 1.3.1)
21
+ connection_pool (>= 2.2.5)
22
+ drb
23
+ i18n (>= 1.6, < 2)
24
+ logger (>= 1.4.2)
25
+ minitest (>= 5.1)
26
+ securerandom (>= 0.3)
27
+ tzinfo (~> 2.0, >= 2.0.5)
28
+ ast (2.4.2)
29
+ base64 (0.1.2)
30
+ benchmark (0.4.0)
31
+ bigdecimal (3.1.8)
32
+ coderay (1.1.3)
33
+ concurrent-ruby (1.3.4)
34
+ connection_pool (2.4.1)
35
+ diff-lcs (1.6.0)
36
+ docile (1.4.1)
37
+ drb (2.2.1)
38
+ ffi (1.17.1-aarch64-linux-gnu)
39
+ ffi (1.17.1-arm-linux-gnu)
40
+ ffi (1.17.1-arm64-darwin)
41
+ ffi (1.17.1-x86-linux-gnu)
42
+ ffi (1.17.1-x86_64-darwin)
43
+ ffi (1.17.1-x86_64-linux-gnu)
44
+ formatador (1.1.0)
45
+ guard (2.19.1)
46
+ formatador (>= 0.2.4)
47
+ listen (>= 2.7, < 4.0)
48
+ logger (~> 1.6)
49
+ lumberjack (>= 1.0.12, < 2.0)
50
+ nenv (~> 0.1)
51
+ notiffany (~> 0.0)
52
+ ostruct (~> 0.6)
53
+ pry (>= 0.13.0)
54
+ shellany (~> 0.0)
55
+ thor (>= 0.18.1)
56
+ guard-compat (1.2.1)
57
+ guard-rspec (4.7.3)
58
+ guard (~> 2.1)
59
+ guard-compat (~> 1.1)
60
+ rspec (>= 2.99.0, < 4.0)
61
+ guard-rubocop (1.5.0)
62
+ guard (~> 2.0)
63
+ rubocop (< 2.0)
64
+ i18n (1.14.6)
65
+ concurrent-ruby (~> 1.0)
66
+ json (2.10.2)
67
+ language_server-protocol (3.17.0.4)
68
+ listen (3.9.0)
69
+ rb-fsevent (~> 0.10, >= 0.10.3)
70
+ rb-inotify (~> 0.9, >= 0.9.10)
71
+ logger (1.6.3)
72
+ lumberjack (1.2.10)
73
+ method_source (1.1.0)
74
+ minitest (5.25.4)
75
+ nenv (0.3.0)
76
+ notiffany (0.1.3)
77
+ nenv (~> 0.1)
78
+ shellany (~> 0.0)
79
+ ostruct (0.6.1)
80
+ parallel (1.26.3)
81
+ parser (3.3.7.1)
82
+ ast (~> 2.4.1)
83
+ racc
84
+ prism (1.3.0)
85
+ pry (0.15.2)
86
+ coderay (~> 1.1)
87
+ method_source (~> 1.0)
88
+ racc (1.8.1)
89
+ rack (3.1.12)
90
+ rainbow (3.1.1)
91
+ rake (13.2.1)
92
+ rb-fsevent (0.11.2)
93
+ rb-inotify (0.11.1)
94
+ ffi (~> 1.0)
95
+ rbs (3.8.1)
96
+ logger
97
+ regexp_parser (2.10.0)
98
+ rexml (3.4.1)
99
+ rspec (3.13.0)
100
+ rspec-core (~> 3.13.0)
101
+ rspec-expectations (~> 3.13.0)
102
+ rspec-mocks (~> 3.13.0)
103
+ rspec-core (3.13.3)
104
+ rspec-support (~> 3.13.0)
105
+ rspec-expectations (3.13.3)
106
+ diff-lcs (>= 1.2.0, < 2.0)
107
+ rspec-support (~> 3.13.0)
108
+ rspec-mocks (3.13.2)
109
+ diff-lcs (>= 1.2.0, < 2.0)
110
+ rspec-support (~> 3.13.0)
111
+ rspec-support (3.13.2)
112
+ rubocop (1.56.4)
113
+ base64 (~> 0.1.1)
114
+ json (~> 2.3)
115
+ language_server-protocol (>= 3.17.0)
116
+ parallel (~> 1.10)
117
+ parser (>= 3.2.2.3)
118
+ rainbow (>= 2.2.2, < 4.0)
119
+ regexp_parser (>= 1.8, < 3.0)
120
+ rexml (>= 3.2.5, < 4.0)
121
+ rubocop-ast (>= 1.28.1, < 2.0)
122
+ ruby-progressbar (~> 1.7)
123
+ unicode-display_width (>= 2.4.0, < 3.0)
124
+ rubocop-ast (1.38.1)
125
+ parser (>= 3.3.1.0)
126
+ rubocop-performance (1.23.1)
127
+ rubocop (>= 1.48.1, < 2.0)
128
+ rubocop-ast (>= 1.31.1, < 2.0)
129
+ rubocop-rails (2.29.1)
130
+ activesupport (>= 4.2.0)
131
+ rack (>= 1.1)
132
+ rubocop (>= 1.52.0, < 2.0)
133
+ rubocop-ast (>= 1.31.1, < 2.0)
134
+ rubocop-rake (0.6.0)
135
+ rubocop (~> 1.0)
136
+ rubocop-rspec (3.0.0)
137
+ rubocop (~> 1.40)
138
+ ruby-lsp (0.23.11)
139
+ language_server-protocol (~> 3.17.0)
140
+ prism (>= 1.2, < 2.0)
141
+ rbs (>= 3, < 4)
142
+ sorbet-runtime (>= 0.5.10782)
143
+ ruby-lsp-rails (0.4.0)
144
+ ruby-lsp (>= 0.23.0, < 0.24.0)
145
+ ruby-lsp-rspec (0.1.22)
146
+ ruby-lsp (~> 0.23.0)
147
+ ruby-progressbar (1.13.0)
148
+ securerandom (0.4.0)
149
+ shellany (0.0.1)
150
+ simplecov (0.22.0)
151
+ docile (~> 1.1)
152
+ simplecov-html (~> 0.11)
153
+ simplecov_json_formatter (~> 0.1)
154
+ simplecov-html (0.13.1)
155
+ simplecov_json_formatter (0.1.4)
156
+ sorbet-runtime (0.5.11919)
157
+ sqlite3 (2.6.0-aarch64-linux-gnu)
158
+ sqlite3 (2.6.0-arm-linux-gnu)
159
+ sqlite3 (2.6.0-arm64-darwin)
160
+ sqlite3 (2.6.0-x86-linux-gnu)
161
+ sqlite3 (2.6.0-x86_64-darwin)
162
+ sqlite3 (2.6.0-x86_64-linux-gnu)
163
+ thor (1.3.2)
164
+ timeout (0.4.3)
165
+ tzinfo (2.0.6)
166
+ concurrent-ruby (~> 1.0)
167
+ unicode-display_width (2.6.0)
168
+
169
+ PLATFORMS
170
+ aarch64-linux
171
+ arm-linux
172
+ arm64-darwin
173
+ x86-linux
174
+ x86_64-darwin
175
+ x86_64-linux
176
+
177
+ DEPENDENCIES
178
+ activerecord (~> 7.2.0)
179
+ guard (~> 2.18)
180
+ guard-rspec (~> 4.7)
181
+ guard-rubocop (~> 1.5)
182
+ human_enum!
183
+ rake (~> 13.0)
184
+ rspec (~> 3.12)
185
+ rubocop (~> 1.56.3)
186
+ rubocop-performance
187
+ rubocop-rails
188
+ rubocop-rake
189
+ rubocop-rspec
190
+ ruby-lsp-rails
191
+ ruby-lsp-rspec
192
+ simplecov (~> 0.22.0)
193
+ sqlite3 (~> 2.0)
194
+
195
+ BUNDLED WITH
196
+ 2.5.10
@@ -0,0 +1,198 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ human_enum (1.1.3)
5
+ activerecord (>= 6.1, < 9)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ activemodel (8.0.2)
11
+ activesupport (= 8.0.2)
12
+ activerecord (8.0.2)
13
+ activemodel (= 8.0.2)
14
+ activesupport (= 8.0.2)
15
+ timeout (>= 0.4.0)
16
+ activesupport (8.0.2)
17
+ base64
18
+ benchmark (>= 0.3)
19
+ bigdecimal
20
+ concurrent-ruby (~> 1.0, >= 1.3.1)
21
+ connection_pool (>= 2.2.5)
22
+ drb
23
+ i18n (>= 1.6, < 2)
24
+ logger (>= 1.4.2)
25
+ minitest (>= 5.1)
26
+ securerandom (>= 0.3)
27
+ tzinfo (~> 2.0, >= 2.0.5)
28
+ uri (>= 0.13.1)
29
+ ast (2.4.2)
30
+ base64 (0.1.2)
31
+ benchmark (0.4.0)
32
+ bigdecimal (3.1.8)
33
+ coderay (1.1.3)
34
+ concurrent-ruby (1.3.4)
35
+ connection_pool (2.4.1)
36
+ diff-lcs (1.6.0)
37
+ docile (1.4.1)
38
+ drb (2.2.1)
39
+ ffi (1.17.1-aarch64-linux-gnu)
40
+ ffi (1.17.1-arm-linux-gnu)
41
+ ffi (1.17.1-arm64-darwin)
42
+ ffi (1.17.1-x86-linux-gnu)
43
+ ffi (1.17.1-x86_64-darwin)
44
+ ffi (1.17.1-x86_64-linux-gnu)
45
+ formatador (1.1.0)
46
+ guard (2.19.1)
47
+ formatador (>= 0.2.4)
48
+ listen (>= 2.7, < 4.0)
49
+ logger (~> 1.6)
50
+ lumberjack (>= 1.0.12, < 2.0)
51
+ nenv (~> 0.1)
52
+ notiffany (~> 0.0)
53
+ ostruct (~> 0.6)
54
+ pry (>= 0.13.0)
55
+ shellany (~> 0.0)
56
+ thor (>= 0.18.1)
57
+ guard-compat (1.2.1)
58
+ guard-rspec (4.7.3)
59
+ guard (~> 2.1)
60
+ guard-compat (~> 1.1)
61
+ rspec (>= 2.99.0, < 4.0)
62
+ guard-rubocop (1.5.0)
63
+ guard (~> 2.0)
64
+ rubocop (< 2.0)
65
+ i18n (1.14.6)
66
+ concurrent-ruby (~> 1.0)
67
+ json (2.10.2)
68
+ language_server-protocol (3.17.0.4)
69
+ listen (3.9.0)
70
+ rb-fsevent (~> 0.10, >= 0.10.3)
71
+ rb-inotify (~> 0.9, >= 0.9.10)
72
+ logger (1.6.3)
73
+ lumberjack (1.2.10)
74
+ method_source (1.1.0)
75
+ minitest (5.25.4)
76
+ nenv (0.3.0)
77
+ notiffany (0.1.3)
78
+ nenv (~> 0.1)
79
+ shellany (~> 0.0)
80
+ ostruct (0.6.1)
81
+ parallel (1.26.3)
82
+ parser (3.3.7.1)
83
+ ast (~> 2.4.1)
84
+ racc
85
+ prism (1.3.0)
86
+ pry (0.15.2)
87
+ coderay (~> 1.1)
88
+ method_source (~> 1.0)
89
+ racc (1.8.1)
90
+ rack (3.1.12)
91
+ rainbow (3.1.1)
92
+ rake (13.2.1)
93
+ rb-fsevent (0.11.2)
94
+ rb-inotify (0.11.1)
95
+ ffi (~> 1.0)
96
+ rbs (3.8.1)
97
+ logger
98
+ regexp_parser (2.10.0)
99
+ rexml (3.4.1)
100
+ rspec (3.13.0)
101
+ rspec-core (~> 3.13.0)
102
+ rspec-expectations (~> 3.13.0)
103
+ rspec-mocks (~> 3.13.0)
104
+ rspec-core (3.13.3)
105
+ rspec-support (~> 3.13.0)
106
+ rspec-expectations (3.13.3)
107
+ diff-lcs (>= 1.2.0, < 2.0)
108
+ rspec-support (~> 3.13.0)
109
+ rspec-mocks (3.13.2)
110
+ diff-lcs (>= 1.2.0, < 2.0)
111
+ rspec-support (~> 3.13.0)
112
+ rspec-support (3.13.2)
113
+ rubocop (1.56.4)
114
+ base64 (~> 0.1.1)
115
+ json (~> 2.3)
116
+ language_server-protocol (>= 3.17.0)
117
+ parallel (~> 1.10)
118
+ parser (>= 3.2.2.3)
119
+ rainbow (>= 2.2.2, < 4.0)
120
+ regexp_parser (>= 1.8, < 3.0)
121
+ rexml (>= 3.2.5, < 4.0)
122
+ rubocop-ast (>= 1.28.1, < 2.0)
123
+ ruby-progressbar (~> 1.7)
124
+ unicode-display_width (>= 2.4.0, < 3.0)
125
+ rubocop-ast (1.38.1)
126
+ parser (>= 3.3.1.0)
127
+ rubocop-performance (1.23.1)
128
+ rubocop (>= 1.48.1, < 2.0)
129
+ rubocop-ast (>= 1.31.1, < 2.0)
130
+ rubocop-rails (2.29.1)
131
+ activesupport (>= 4.2.0)
132
+ rack (>= 1.1)
133
+ rubocop (>= 1.52.0, < 2.0)
134
+ rubocop-ast (>= 1.31.1, < 2.0)
135
+ rubocop-rake (0.6.0)
136
+ rubocop (~> 1.0)
137
+ rubocop-rspec (3.0.0)
138
+ rubocop (~> 1.40)
139
+ ruby-lsp (0.23.11)
140
+ language_server-protocol (~> 3.17.0)
141
+ prism (>= 1.2, < 2.0)
142
+ rbs (>= 3, < 4)
143
+ sorbet-runtime (>= 0.5.10782)
144
+ ruby-lsp-rails (0.4.0)
145
+ ruby-lsp (>= 0.23.0, < 0.24.0)
146
+ ruby-lsp-rspec (0.1.22)
147
+ ruby-lsp (~> 0.23.0)
148
+ ruby-progressbar (1.13.0)
149
+ securerandom (0.4.0)
150
+ shellany (0.0.1)
151
+ simplecov (0.22.0)
152
+ docile (~> 1.1)
153
+ simplecov-html (~> 0.11)
154
+ simplecov_json_formatter (~> 0.1)
155
+ simplecov-html (0.13.1)
156
+ simplecov_json_formatter (0.1.4)
157
+ sorbet-runtime (0.5.11919)
158
+ sqlite3 (2.6.0-aarch64-linux-gnu)
159
+ sqlite3 (2.6.0-arm-linux-gnu)
160
+ sqlite3 (2.6.0-arm64-darwin)
161
+ sqlite3 (2.6.0-x86-linux-gnu)
162
+ sqlite3 (2.6.0-x86_64-darwin)
163
+ sqlite3 (2.6.0-x86_64-linux-gnu)
164
+ thor (1.3.2)
165
+ timeout (0.4.3)
166
+ tzinfo (2.0.6)
167
+ concurrent-ruby (~> 1.0)
168
+ unicode-display_width (2.6.0)
169
+ uri (1.0.3)
170
+
171
+ PLATFORMS
172
+ aarch64-linux
173
+ arm-linux
174
+ arm64-darwin
175
+ x86-linux
176
+ x86_64-darwin
177
+ x86_64-linux
178
+
179
+ DEPENDENCIES
180
+ activerecord (~> 8.0.0)
181
+ guard (~> 2.18)
182
+ guard-rspec (~> 4.7)
183
+ guard-rubocop (~> 1.5)
184
+ human_enum!
185
+ rake (~> 13.0)
186
+ rspec (~> 3.12)
187
+ rubocop (~> 1.56.3)
188
+ rubocop-performance
189
+ rubocop-rails
190
+ rubocop-rake
191
+ rubocop-rspec
192
+ ruby-lsp-rails
193
+ ruby-lsp-rspec
194
+ simplecov (~> 0.22.0)
195
+ sqlite3 (~> 2.0)
196
+
197
+ BUNDLED WITH
198
+ 2.5.10
data/Guardfile CHANGED
@@ -1,16 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- guard :rubocop, all_on_start: false, cli: '-a' do
4
- watch(/.+\.rb$/)
5
- watch(%r{(?:.+/)?\.rubocop(?:_todo)?\.yml$}) { |m| File.dirname(m[0]) }
6
- end
3
+ # guard :rubocop, all_on_start: false, cli: '-a' do
4
+ # watch(/.+\.rb$/)
5
+ # watch(%r{(?:.+/)?\.rubocop(?:_todo)?\.yml$}) { |m| File.dirname(m[0]) }
6
+ # end
7
7
 
8
8
  guard :rspec, cmd: 'bundle exec rspec' do
9
9
  require 'guard/rspec/dsl'
10
10
  dsl = Guard::RSpec::Dsl.new(self)
11
11
 
12
- # Feel free to open issues for suggestions and improvements
13
-
14
12
  # RSpec files
15
13
  rspec = dsl.rspec
16
14
  watch(rspec.spec_helper) { rspec.spec_dir }
@@ -20,10 +18,4 @@ guard :rspec, cmd: 'bundle exec rspec' do
20
18
  # Ruby files
21
19
  ruby = dsl.ruby
22
20
  dsl.watch_spec_files_for(ruby.lib_files)
23
-
24
- # Turnip features and steps
25
- watch(%r{^spec/acceptance/(.+)\.feature$})
26
- watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
27
- Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance'
28
- end
29
21
  end
data/README.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  This gem allows you to specify enum value translations in your I18n locale files like any other ActiveRecord attribute and adds helper methods to get humanized translations of enum values.
4
4
 
5
+ [![Tests](https://github.com/rafasoares/human_enum/actions/workflows/tests.yml/badge.svg)](https://github.com/rafasoares/human_enum/actions/workflows/tests.yml)
6
+ [![Maintainability](https://api.codeclimate.com/v1/badges/b1caef25c888cde6688e/maintainability)](https://codeclimate.com/github/rafasoares/human_enum/maintainability)
7
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/b1caef25c888cde6688e/test_coverage)](https://codeclimate.com/github/rafasoares/human_enum/test_coverage)
8
+
9
+ ## Requirements
10
+
11
+ This gem only supports actively maintained versions of Ruby and Rails. Currently, that is:
12
+ * Ruby 3.1+
13
+ * Rails 6.1+
14
+
15
+ It may work with older versions, but it is not officially supported.
16
+
5
17
  ## Installation
6
18
 
7
19
  Add this line to your application's Gemfile:
@@ -12,15 +24,19 @@ gem 'human_enum'
12
24
 
13
25
  And then execute:
14
26
 
15
- $ bundle
27
+ ```sh
28
+ bundle
29
+ ```
16
30
 
17
31
  Or install it yourself as:
18
32
 
19
- $ gem install human_enum
33
+ ```sh
34
+ gem install human_enum
35
+ ```
20
36
 
21
37
  ## Usage
22
38
 
23
- First, include the concern in your models:
39
+ First, include the concern in your models.
24
40
 
25
41
  ```ruby
26
42
  class MyModel < ApplicationRecord
@@ -28,7 +44,7 @@ class MyModel < ApplicationRecord
28
44
  end
29
45
  ```
30
46
 
31
- Alternativelly, add it to your `ApplicationRecord` to add the functionality to every model in your application:
47
+ For convenience, you can add it to your `ApplicationRecord` to add the functionality to every model in your application. For models that don't declare `enum` attributes, no extra logic is called.
32
48
 
33
49
  ```ruby
34
50
  class ApplicationRecord < ActiveRecord::Base
@@ -38,15 +54,19 @@ class ApplicationRecord < ActiveRecord::Base
38
54
  end
39
55
  ```
40
56
 
41
- Declare your enums as you normally would:
57
+ Then declare your enums as you normally would:
42
58
 
43
59
  ```ruby
44
60
  class MyModel < ApplicationRecord
45
- enum model_type: [:default, :special]
61
+ # For Rails 7+
62
+ enum :model_type, %i[default special]
63
+
64
+ # For Rails 6
65
+ enum model_type: %i[default special]
46
66
  end
47
67
  ```
48
68
 
49
- And add the enum values to your locale files under the pluralized version of the enum attribute:
69
+ And add the enum values to your locale files under the **pluralized** version of the enum attribute:
50
70
 
51
71
  ```yaml
52
72
  en:
@@ -58,10 +78,12 @@ en:
58
78
  special: I am so special
59
79
  ```
60
80
 
61
- Then, you can use the helper method `human_[enum_attribute_name]` whenever you need the translated / humanized version of the enum value:
81
+ Note: internally, `human_enum` uses the model's [`i18n_scope`](https://api.rubyonrails.org/classes/ActiveModel/Translation.html#method-i-i18n_scope), so any customizations to your model/I18n setup should be automatically picked up.
82
+
83
+ Finally, you can use the helper method `human_[enum_attribute_name]` whenever you need the translated/human version of the enum value:
62
84
 
63
85
  ```ruby
64
- model = MyModel.new model_type: :special
86
+ model = MyModel.new(model_type: :special)
65
87
  puts model.human_model_type # "I am so special"
66
88
  ```
67
89
 
@@ -73,9 +95,9 @@ puts MyModel.human_model_types # "{default: 'Default Type', special: 'I am so sp
73
95
 
74
96
  ## Development
75
97
 
76
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
98
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
77
99
 
78
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
100
+ To install this gem onto your local machine, run `bin/rake install`.
79
101
 
80
102
  ## Contributing
81
103
 
@@ -85,4 +107,3 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/rafaso
85
107
  ## License
86
108
 
87
109
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
88
-
data/bin/rake ADDED
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rake' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
12
+
13
+ bundle_binstub = File.expand_path('bundle', __dir__)
14
+
15
+ if File.file?(bundle_binstub)
16
+ if File.read(bundle_binstub, 300).include?('This file was generated by Bundler')
17
+ load(bundle_binstub)
18
+ else
19
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
20
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
21
+ end
22
+ end
23
+
24
+ require 'rubygems'
25
+ require 'bundler/setup'
26
+
27
+ load Gem.bin_path('rake', 'rake')
data/bin/rspec ADDED
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rspec' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
12
+
13
+ bundle_binstub = File.expand_path('bundle', __dir__)
14
+
15
+ if File.file?(bundle_binstub)
16
+ if File.read(bundle_binstub, 300).include?('This file was generated by Bundler')
17
+ load(bundle_binstub)
18
+ else
19
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
20
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
21
+ end
22
+ end
23
+
24
+ require 'rubygems'
25
+ require 'bundler/setup'
26
+
27
+ load Gem.bin_path('rspec-core', 'rspec')
data/bin/setup CHANGED
@@ -4,5 +4,3 @@ IFS=$'\n\t'
4
4
  set -vx
5
5
 
6
6
  bundle install
7
-
8
- # Do any other automated setup that you need to do here
data/human_enum.gemspec CHANGED
@@ -8,7 +8,10 @@ Gem::Specification.new do |spec|
8
8
  spec.name = 'human_enum'
9
9
  spec.version = HumanEnum::VERSION
10
10
  spec.authors = ['Rafael Soares']
11
- spec.email = ['rafasoaresms@gmail.com']
11
+ spec.email = ['893971+rafasoares@users.noreply.github.com']
12
+
13
+ # Should always be the lowest maintained version of Ruby
14
+ spec.required_ruby_version = '>= 3.1'
12
15
 
13
16
  spec.summary = 'Adds simple and easy I18n support for Rails enums'
14
17
  spec.description = 'This gem allows you to specify enum value translations
@@ -19,7 +22,8 @@ Gem::Specification.new do |spec|
19
22
 
20
23
  spec.metadata['homepage_uri'] = spec.homepage
21
24
  spec.metadata['source_code_uri'] = 'https://github.com/rafasoares/human_enum'
22
- spec.metadata['changelog_uri'] = 'https://github.com/rafasoares/human_enum/blob/master/CHANGELOG.md'
25
+ spec.metadata['changelog_uri'] = 'https://github.com/rafasoares/human_enum/blob/main/CHANGELOG.md'
26
+ spec.metadata['rubygems_mfa_required'] = 'true'
23
27
 
24
28
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
25
29
  f.match(%r{^(test|spec|features)/})
@@ -28,19 +32,5 @@ Gem::Specification.new do |spec|
28
32
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
33
  spec.require_paths = ['lib']
30
34
 
31
- spec.add_development_dependency 'bundler', '~> 2.0'
32
- spec.add_development_dependency 'rake', '~> 10.0'
33
- spec.add_development_dependency 'rspec', '~> 3.0'
34
-
35
- spec.add_development_dependency 'rubocop', '~> 0.72.0'
36
- spec.add_development_dependency 'rubocop-performance', '~> 1.5'
37
- spec.add_development_dependency 'rubocop-rspec', '~> 1.36'
38
-
39
- spec.add_development_dependency 'guard', '~> 2.15'
40
- spec.add_development_dependency 'guard-rspec', '~> 4.7'
41
- spec.add_development_dependency 'guard-rubocop', '~> 1.3'
42
-
43
- spec.add_development_dependency 'sqlite3', '~> 1.4'
44
-
45
- spec.add_dependency 'activerecord', '> 5.0.0'
35
+ spec.add_dependency 'activerecord', '>= 6.1', '< 9'
46
36
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HumanEnum
4
- VERSION = '0.1.3'
4
+ VERSION = '1.1.3'
5
5
  end