enumerations 2.5.0 → 2.5.1

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: 662c2ae6e522b2f97a03e6dc0c848b8d6d45d77000f36ca5f08a3b6dc4ce6433
4
- data.tar.gz: 8d5a3f9e31fe5f1bf514e0b7deb2c6269a6acce629f14d18078110165994cda2
3
+ metadata.gz: 54447b9967c65df1318cac0ec59daab41b5f41ad118ad0ba32e260b8cbcf36d9
4
+ data.tar.gz: fa276b02570956e52d22915957154a125585983c5a2923453d3cc0c6146d908f
5
5
  SHA512:
6
- metadata.gz: d9b80ce8946b5614c07d15e7625f366186bfdbb463b807faa4b18458af32ea69c623214ac87b83f165d683e49047d1fdada5222ac299b8d2bb53d3c3ca8d2e3d
7
- data.tar.gz: b05ffbd75a2fd6744c71b211aa966c72e74cba905a73cd4efdbb1dde43a3809314d0da4be8626609b9b761fa85f2b96872d8eb01826b6c27a4ce78226999f0cb
6
+ metadata.gz: 63e002298b8365cc55c296d85963b3bf410bcd02501394666d45efbfffd3f0fd70a276e9413a51b3a7c81571599f9958a98a3d0b9d5c7671cff60cfd77002591
7
+ data.tar.gz: f7e3d0337b42d668fe78a6ea3037ad59820803db1ae65f1ddbcfaf6fcfc1e5d19e6081c0582fc5a1766e27b2c24747901117d78e9f03f2b5e690b87e79a7bb8f
@@ -0,0 +1,24 @@
1
+ name: Test suite
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test:
11
+ name: Ruby ${{ matrix.ruby }}
12
+ runs-on: ubuntu-18.04
13
+ strategy:
14
+ matrix:
15
+ ruby: [2.6, 2.7, 3.0]
16
+
17
+ steps:
18
+ - uses: actions/checkout@v2
19
+ - uses: ruby/setup-ruby@v1
20
+ with:
21
+ ruby-version: ${{ matrix.ruby }}
22
+ bundler-cache: true
23
+ - name: Run tests
24
+ run: bundle exec rake test
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Change Log
2
2
 
3
+ ## [v2.5.1](https://github.com/infinum/enumerations/tree/v2.5.1) (YYYY-MM-DD)
4
+ [Full Changelog](https://github.com/infinum/enumerations/compare/v2.5.0...v2.5.1)
5
+
6
+ **Implemented enhancements:**
7
+
8
+ - Add support for Ruby 3 [\#52](https://github.com/infinum/enumerations/issues/52)
9
+
10
+ ## [v2.5.0](https://github.com/infinum/enumerations/tree/v2.5.0) (2021-03-03)
11
+ [Full Changelog](https://github.com/infinum/enumerations/compare/v2.4.0...v2.5.0)
12
+
13
+ **Implemented enhancements:**
14
+
15
+ - Add `raise_invalid_value_error` configuration option to disable raising errors on invalid values
16
+
3
17
  ## [v2.4.0](https://github.com/infinum/enumerations/tree/v2.4.0) (2019-02-07)
4
18
  [Full Changelog](https://github.com/infinum/enumerations/compare/v2.3.3...v2.4.0)
5
19
 
@@ -31,7 +31,7 @@ module Enumerations
31
31
  # Role.find_by(name: 'Admin') => #<Enumerations::Value: @base=Role, @symbol=:admin...>
32
32
  #
33
33
  def find_by(**args)
34
- where(args).first
34
+ where(**args).first
35
35
  end
36
36
 
37
37
  def find_by_key(key)
@@ -54,7 +54,7 @@ module Enumerations
54
54
  #
55
55
  def define_attributes_getters
56
56
  @attributes.each do |key, _|
57
- next if respond_to?(key)
57
+ next if self.class.method_defined?(key)
58
58
 
59
59
  self.class.send :define_method, key do |locale: I18n.locale|
60
60
  case @attributes[key]
@@ -102,7 +102,7 @@ module Enumerations
102
102
  @attributes.each do |key, _|
103
103
  method_name = "#{key}?"
104
104
 
105
- next if respond_to?(method_name.to_sym)
105
+ next if self.class.method_defined?(method_name.to_sym)
106
106
 
107
107
  self.class.send :define_method, method_name do
108
108
  @attributes[key].present?
@@ -1,3 +1,3 @@
1
1
  module Enumerations
2
- VERSION = '2.5.0'.freeze
2
+ VERSION = '2.5.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enumerations
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomislav Car
@@ -9,7 +9,7 @@ authors:
9
9
  - Nikola Santić
10
10
  - Stjepan Hadjić
11
11
  - Petar Ćurković
12
- autorequire:
12
+ autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
15
  date: 2017-09-08 00:00:00.000000000 Z
@@ -123,6 +123,7 @@ executables: []
123
123
  extensions: []
124
124
  extra_rdoc_files: []
125
125
  files:
126
+ - ".github/workflows/test.yml"
126
127
  - ".gitignore"
127
128
  - ".rubocop.yml"
128
129
  - CHANGELOG.md
@@ -157,7 +158,7 @@ files:
157
158
  homepage: https://github.com/infinum/enumerations
158
159
  licenses: []
159
160
  metadata: {}
160
- post_install_message:
161
+ post_install_message:
161
162
  rdoc_options: []
162
163
  require_paths:
163
164
  - lib
@@ -172,23 +173,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
172
173
  - !ruby/object:Gem::Version
173
174
  version: '0'
174
175
  requirements: []
175
- rubygems_version: 3.1.2
176
- signing_key:
176
+ rubygems_version: 3.0.1
177
+ signing_key:
177
178
  specification_version: 4
178
179
  summary: Enumerations for ActiveRecord!
179
- test_files:
180
- - test/base_test.rb
181
- - test/configuration/configuration.rb
182
- - test/configuration/custom_configuration_test.rb
183
- - test/configuration/enumerations_test.rb
184
- - test/configuration/finder_test.rb
185
- - test/configuration_test.rb
186
- - test/enumerations_test.rb
187
- - test/finder_test.rb
188
- - test/helpers/database_helper.rb
189
- - test/helpers/locale_helper.rb
190
- - test/helpers/test_helper.rb
191
- - test/locales/hr.yml
192
- - test/reflection_test.rb
193
- - test/translation_test.rb
194
- - test/value_test.rb
180
+ test_files: []