active_model_validations_reflection 0.1.2 → 0.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a2157bd5ce0dd6c8eaec27072fa186ac7bd93409ba32df041a86f5fe583cf208
4
- data.tar.gz: e6d3f51343264ec744d0395dc090a416a13f1a5fc039caaa9e8aba1384f91816
3
+ metadata.gz: 3909c5a1b8c4436565b453b0046368d1704e578f3528ed4098e5eac4b8253d3a
4
+ data.tar.gz: a16e00410f3455915e389f7e9be31239db1786b6b39ea1f9982651f8ed69a833
5
5
  SHA512:
6
- metadata.gz: 8e0b853c7190f4bcda9791ba89ad92ab3fd8c8c7806c46dc2bf9e346750543af003f09e5751a40ea4b4c0e894e03947d5b47a03dcd57791981f00296e8e6a710
7
- data.tar.gz: 7318a479b2b89410b6499ec1388a84b515b5d32deb31e83c9147bce2cfb2873dc303e8978fc0fd39955503b9dba62ef290552dc070eb59ab75d14493b09c8e22
6
+ metadata.gz: 10cec024a56e8b8df6c0844b4aed626af7c808d4ae392ca4e31f6c21c6ff361bb5922e6ef5d9badb4d23c5ccc00cc2415781f9f9c3e297cb8d042b275cbd4e2d
7
+ data.tar.gz: def863160d14823f5caf4610b815716bb9cf36a1ec27fad95c8d4a19a2e6e7b95b992a5f1cff3bb3611ee0ca203655bf0be11ea486114a082605d99a7f70076d
data/CHANGELOG.md ADDED
@@ -0,0 +1,40 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## Version 0.2.0 (2025-10-23)
10
+
11
+ ### Changed
12
+
13
+ * Configure Dependabot to automatically update Github Actions (#16)
14
+ * Drop support for Rails 7.1, Ruby 2.7 and Ruby 3.0 (#15)
15
+ * Add Rails 8.1 to the test matrix (#14)
16
+ * Remove Rails 7.0 from the test matrix (#13)
17
+ * Add Ruby 3.4 to the test matrix (#12)
18
+ * Add Rails 8.0 to the test matrix (#11)
19
+ * Add Ruby 2.7 (Rails 7.0 minimum requirements) to the test matrix (#10)
20
+ * Remove Rails 6.1 from the test matrix (#10)
21
+ * Add Rails 7.2 to the test matrix (#9)
22
+ * Update test matrix (#8)
23
+ Add Ruby 3.3. Drop Ruby 2.6 and Ruby 2.7
24
+ * Migrate from Travis CI to Github Actions
25
+ * Add Ruby 3.2 to the test matrix
26
+ * Introduce `rubocop-performance` and apply recommendations
27
+
28
+ ## Version 0.1.2 (2021-04-06)
29
+
30
+ ### Added
31
+
32
+ * `relevant_validators` to get all relevant validators considering the instance current state.
33
+
34
+ ## Version 0.1.1 (2021-04-06)
35
+
36
+ No changes.
37
+
38
+ ## Version 0.1.0 (2021-04-06)
39
+
40
+ Initial release.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # ActiveModel::Validations::Reflection
2
2
 
3
- [![Build Status](https://travis-ci.org/notus-sh/active_model_validations_reflection.svg?branch=master)](https://travis-ci.org/notus-sh/active_model_validations_reflection)
3
+ [![Unit tests](https://github.com/notus-sh/active_model_validations_reflection/actions/workflows/unit-tests.yml/badge.svg?branch=main)](https://github.com/notus-sh/active_model_validations_reflection/actions/workflows/unit-tests.yml)
4
4
  [![Gem Version](https://badge.fury.io/rb/active_model_validations_reflection.svg)](https://badge.fury.io/rb/active_model_validations_reflection)
5
5
 
6
6
  `ActiveModel::Validations::Reflection` extends `ActiveModel` reflection capabilities on validations.
@@ -13,22 +13,33 @@ Gem::Specification.new do |spec|
13
13
  spec.description = 'An ActiveModel extension for more expressive validations reflection'
14
14
  spec.homepage = 'https://github.com/notus-sh/active_model_validations_reflection'
15
15
 
16
- spec.metadata['allowed_push_host'] = 'https://rubygems.org'
16
+ raise 'RubyGems 2.0 or newer is required.' unless spec.respond_to?(:metadata)
17
+
18
+ spec.metadata = {
19
+ 'allowed_push_host' => 'https://rubygems.org',
20
+ 'rubygems_mfa_required' => 'true',
21
+
22
+ 'bug_tracker_uri' => 'https://github.com/notus-sh/active_model_validations_reflection/issues',
23
+ 'changelog_uri' => 'https://github.com/notus-sh/active_model_validations_reflection/blob/main/CHANGELOG.md',
24
+ 'homepage_uri' => 'https://github.com/notus-sh/active_model_validations_reflection',
25
+ 'source_code_uri' => 'https://github.com/notus-sh/active_model_validations_reflection',
26
+ 'funding_uri' => 'https://opencollective.com/notus-sh'
27
+ }
17
28
 
18
29
  spec.require_paths = ['lib']
19
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
20
- f.match(%r{^(test|spec|features)/})
30
+
31
+ excluded_dirs = %r{^(.github|dev|spec)/}
32
+ excluded_files = %w[.gitignore .rspec .rubocop.yml Gemfile Gemfile.lock Rakefile]
33
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
34
+ f.match(excluded_dirs) || excluded_files.include?(f)
21
35
  end
22
36
 
23
- spec.required_ruby_version = Gem::Requirement.new('>= 2.6.0')
37
+ spec.required_ruby_version = '>= 3.1'
24
38
 
25
39
  spec.add_dependency 'activemodel', '>= 3.2'
26
40
  spec.add_dependency 'activesupport', '>= 3.2'
27
41
 
28
42
  spec.add_development_dependency 'bundler', '~> 2.1'
29
43
  spec.add_development_dependency 'rake', '~> 13.0'
30
- spec.add_development_dependency 'rspec', '~> 3.10.0'
31
- spec.add_development_dependency 'rubocop'
32
- spec.add_development_dependency 'rubocop-rake'
33
- spec.add_development_dependency 'rubocop-rspec'
44
+ spec.add_development_dependency 'rspec', '~> 3.13.0'
34
45
  end
@@ -4,10 +4,10 @@ require 'active_support/concern'
4
4
 
5
5
  module ActiveModel
6
6
  module Validations
7
- module Reflection
7
+ module Reflection # :nodoc:
8
8
  extend ActiveSupport::Concern
9
9
 
10
- module Helpers
10
+ module Helpers # :nodoc:
11
11
  class << self
12
12
  def flat_validator?(validator)
13
13
  !(validator.options.key?(:if) || validator.options.key?(:unless))
@@ -29,9 +29,9 @@ module ActiveModel
29
29
  end
30
30
  end
31
31
 
32
- module ClassMethods
32
+ module ClassMethods # :nodoc:
33
33
  def validators_of_kinds(*kinds)
34
- return validators if kinds.size.zero?
34
+ return validators if kinds.empty?
35
35
 
36
36
  validators.select do |validator|
37
37
  kinds.include?(validator.kind)
@@ -45,7 +45,7 @@ module ActiveModel
45
45
  end
46
46
 
47
47
  def validators_on_of_kinds(attribute, *kinds)
48
- return validators_on(attribute) if kinds.size.zero?
48
+ return validators_on(attribute) if kinds.empty?
49
49
 
50
50
  validators_on(attribute).select do |validator|
51
51
  kinds.include?(validator.kind)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveModelValidationsReflection
4
- VERSION = '0.1.2'
4
+ VERSION = '0.2.0'
5
5
  end
@@ -3,5 +3,5 @@
3
3
  require 'active_model'
4
4
  require 'active_model/validations/reflection'
5
5
 
6
- module ActiveModelValidationsReflection
6
+ module ActiveModelValidationsReflection # :nodoc:
7
7
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_model_validations_reflection
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gaël-Ian Havard
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2021-05-06 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activemodel
@@ -72,56 +71,14 @@ dependencies:
72
71
  requirements:
73
72
  - - "~>"
74
73
  - !ruby/object:Gem::Version
75
- version: 3.10.0
74
+ version: 3.13.0
76
75
  type: :development
77
76
  prerelease: false
78
77
  version_requirements: !ruby/object:Gem::Requirement
79
78
  requirements:
80
79
  - - "~>"
81
80
  - !ruby/object:Gem::Version
82
- version: 3.10.0
83
- - !ruby/object:Gem::Dependency
84
- name: rubocop
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: rubocop-rake
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: rubocop-rspec
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: '0'
81
+ version: 3.13.0
125
82
  description: An ActiveModel extension for more expressive validations reflection
126
83
  email:
127
84
  - gael-ian@notus.sh
@@ -129,15 +86,9 @@ executables: []
129
86
  extensions: []
130
87
  extra_rdoc_files: []
131
88
  files:
132
- - ".gitignore"
133
- - ".rspec"
134
- - ".rubocop.yml"
135
- - ".travis.yml"
136
- - Gemfile
137
- - Gemfile.lock
89
+ - CHANGELOG.md
138
90
  - LICENSE
139
91
  - README.md
140
- - Rakefile
141
92
  - active_model_validations_reflection.gemspec
142
93
  - lib/active_model/validations/reflection.rb
143
94
  - lib/active_model_validations_reflection.rb
@@ -147,7 +98,12 @@ licenses:
147
98
  - Apache-2.0
148
99
  metadata:
149
100
  allowed_push_host: https://rubygems.org
150
- post_install_message:
101
+ rubygems_mfa_required: 'true'
102
+ bug_tracker_uri: https://github.com/notus-sh/active_model_validations_reflection/issues
103
+ changelog_uri: https://github.com/notus-sh/active_model_validations_reflection/blob/main/CHANGELOG.md
104
+ homepage_uri: https://github.com/notus-sh/active_model_validations_reflection
105
+ source_code_uri: https://github.com/notus-sh/active_model_validations_reflection
106
+ funding_uri: https://opencollective.com/notus-sh
151
107
  rdoc_options: []
152
108
  require_paths:
153
109
  - lib
@@ -155,15 +111,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
155
111
  requirements:
156
112
  - - ">="
157
113
  - !ruby/object:Gem::Version
158
- version: 2.6.0
114
+ version: '3.1'
159
115
  required_rubygems_version: !ruby/object:Gem::Requirement
160
116
  requirements:
161
117
  - - ">="
162
118
  - !ruby/object:Gem::Version
163
119
  version: '0'
164
120
  requirements: []
165
- rubygems_version: 3.2.3
166
- signing_key:
121
+ rubygems_version: 3.6.9
167
122
  specification_version: 4
168
123
  summary: ActiveModel extension on validations reflection
169
124
  test_files: []
data/.gitignore DELETED
@@ -1,11 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
-
10
- # rspec failure tracking
11
- .rspec_status
data/.rspec DELETED
@@ -1 +0,0 @@
1
- --require spec_helper
data/.rubocop.yml DELETED
@@ -1,11 +0,0 @@
1
- require:
2
- - rubocop-rake
3
- - rubocop-rspec
4
-
5
- AllCops:
6
- NewCops: enable
7
-
8
- # DSLs produce long blocks
9
- Metrics/BlockLength:
10
- Exclude:
11
- - 'spec/**/*_spec.rb'
data/.travis.yml DELETED
@@ -1,11 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
- sudo: false
4
-
5
- rvm:
6
- - 2.6
7
- - 2.7
8
- - 3.0
9
-
10
- gemfile:
11
- - Gemfile
data/Gemfile DELETED
@@ -1,6 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- # Specify your gem's dependencies in active_model_validations_reflection.gemspec
6
- gemspec
data/Gemfile.lock DELETED
@@ -1,80 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- active_model_validations_reflection (0.1.2)
5
- activemodel (>= 3.2)
6
- activesupport (>= 3.2)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- activemodel (6.1.3.2)
12
- activesupport (= 6.1.3.2)
13
- activesupport (6.1.3.2)
14
- concurrent-ruby (~> 1.0, >= 1.0.2)
15
- i18n (>= 1.6, < 2)
16
- minitest (>= 5.1)
17
- tzinfo (~> 2.0)
18
- zeitwerk (~> 2.3)
19
- ast (2.4.2)
20
- concurrent-ruby (1.1.8)
21
- diff-lcs (1.4.4)
22
- i18n (1.8.10)
23
- concurrent-ruby (~> 1.0)
24
- minitest (5.14.4)
25
- parallel (1.20.1)
26
- parser (3.0.1.1)
27
- ast (~> 2.4.1)
28
- rainbow (3.0.0)
29
- rake (13.0.3)
30
- regexp_parser (2.1.1)
31
- rexml (3.2.5)
32
- rspec (3.10.0)
33
- rspec-core (~> 3.10.0)
34
- rspec-expectations (~> 3.10.0)
35
- rspec-mocks (~> 3.10.0)
36
- rspec-core (3.10.1)
37
- rspec-support (~> 3.10.0)
38
- rspec-expectations (3.10.1)
39
- diff-lcs (>= 1.2.0, < 2.0)
40
- rspec-support (~> 3.10.0)
41
- rspec-mocks (3.10.2)
42
- diff-lcs (>= 1.2.0, < 2.0)
43
- rspec-support (~> 3.10.0)
44
- rspec-support (3.10.2)
45
- rubocop (1.14.0)
46
- parallel (~> 1.10)
47
- parser (>= 3.0.0.0)
48
- rainbow (>= 2.2.2, < 4.0)
49
- regexp_parser (>= 1.8, < 3.0)
50
- rexml
51
- rubocop-ast (>= 1.5.0, < 2.0)
52
- ruby-progressbar (~> 1.7)
53
- unicode-display_width (>= 1.4.0, < 3.0)
54
- rubocop-ast (1.5.0)
55
- parser (>= 3.0.1.1)
56
- rubocop-rake (0.5.1)
57
- rubocop
58
- rubocop-rspec (2.3.0)
59
- rubocop (~> 1.0)
60
- rubocop-ast (>= 1.1.0)
61
- ruby-progressbar (1.11.0)
62
- tzinfo (2.0.4)
63
- concurrent-ruby (~> 1.0)
64
- unicode-display_width (2.0.0)
65
- zeitwerk (2.4.2)
66
-
67
- PLATFORMS
68
- x86_64-linux
69
-
70
- DEPENDENCIES
71
- active_model_validations_reflection!
72
- bundler (~> 2.1)
73
- rake (~> 13.0)
74
- rspec (~> 3.10.0)
75
- rubocop
76
- rubocop-rake
77
- rubocop-rspec
78
-
79
- BUNDLED WITH
80
- 2.2.3
data/Rakefile DELETED
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bundler/gem_tasks'
4
-
5
- require 'rspec/core/rake_task'
6
- RSpec::Core::RakeTask.new
7
-
8
- require 'rubocop/rake_task'
9
- RuboCop::RakeTask.new
10
-
11
- task default: :spec