validation_hints 0.2.3 → 6.1.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: 70e978eeafefe43ecdd6e839270b02dcce985559b5e53f74f25f78554c2d7797
4
- data.tar.gz: 1bbfb375b4ca43456e823ff30bd0d98ac6719114055276cdafb8f9bb121436d8
3
+ metadata.gz: '093064f733917dd331d9ecaa77e6a9204dbff272010de712ae70c05965f5b271'
4
+ data.tar.gz: 0b33c6d54febdd3dab42c30230deb3df6d5a9f3e5dd1ed24110d70e7e616e207
5
5
  SHA512:
6
- metadata.gz: 53067b662b9c4db01b83319d0f09bbceb09153f1c63c57e8a64905e858fa1bcdd20dc237a43ef02c36bba69838d30c03bfb717c2528a674b62b118f46895b32a
7
- data.tar.gz: bcfa1937c2d921c549375d7a3543f4a7f278f17e9f447e7b67b867a8788561538ed483b8253bf296f1f0fb8733d8e5d195e21db8bf63c756421972827fdde919
6
+ metadata.gz: c74d07e79ea487b1f81559dd0b92fc887f38f3483a0c99593453c61957b82ee3fdabdc0b762c3e28cd40247df788d161b77557e7908a8928a4471888dc188f25
7
+ data.tar.gz: 944ce03510f53c545b27bf9c813649fb8994a7cf64e200693b93a4fbe363b11eb60f14eea93cd7600f032ae5af0719a37614dc1fc39504b59343dbd82f27d860
data/.gitignore CHANGED
@@ -15,4 +15,6 @@ capybara-*.html
15
15
  rerun.txt
16
16
  pickle-email-*.html
17
17
  /pkg
18
+ *.gem
18
19
  .rvmrc
20
+ /stuff/
data/CHANGELOG.md ADDED
@@ -0,0 +1,63 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here.
4
+
5
+ ## 6.1.0
6
+
7
+ Rails 7 compatibility for `ActiveModel::Hints` and expanded test coverage (Phase 1).
8
+
9
+ ### Added
10
+
11
+ - `test/active_model/hints_test.rb` — presence, length, numericality, inclusion, virtual attributes, `empty?`, `add`/`added?`.
12
+ - In-memory SQLite ActiveRecord setup in `test/test_helper.rb`.
13
+ - `normalize_message` for mutable hint APIs (`add`, `added?`).
14
+ - `length.within` locale key with `%{minimum}` / `%{maximum}` interpolation.
15
+ - Default hint messages: `invalid`, `blank`, `empty`.
16
+
17
+ ### Changed
18
+
19
+ - `ActiveModel::Hints` modernized for Rails 7:
20
+ - plain `Hash` instead of `OrderedHash`
21
+ - fixed `empty?` / `blank?`
22
+ - `generate_message` aligned with Rails 7 I18n chain and interpolation
23
+ - validator keys via `demodulize.underscore.delete_suffix("_validator")`
24
+ - attribute discovery includes virtual attributes from validators
25
+ - length min+max combined into a single `within` hint
26
+ - presence hint suppressed when validator has `allow_blank: true`
27
+ - `locale/en.yml` cleaned up (removed stray keys; format copy → “must match the required format”).
28
+ - Documented behavior: conditional validators (`:if`, `:unless`, `:on`) are not evaluated.
29
+
30
+ ## 6.0.0
31
+
32
+ Modernize the gem for **Ruby 3.2+** and **Rails 7.0.x**, targeting use with **inline_forms 7.x**.
33
+
34
+ ### Breaking changes
35
+
36
+ - Requires **Ruby >= 3.2** and **Active Record 7.0.x** (`>= 7.0`, `< 7.1`).
37
+ - Version jump from **0.2.x** to **6.0.0** signals a full modernization.
38
+ - Public API used by inline_forms is preserved: `hints`, `full_messages_for`, `has_validations?`, `has_validations_for?`.
39
+
40
+ ### Added
41
+
42
+ - `ValidationHints::Railtie` — registers I18n and patches `ActiveModel::Validations` via `ActiveSupport.on_load(:active_model)`.
43
+ - `ValidationHints::ValidationsPatch` — extracted module for `has_validations*` and `hints`.
44
+ - `ValidationHints.load_i18n!` — idempotent locale registration.
45
+ - Runtime dependency on `activerecord` 7.0.x.
46
+ - Minitest harness (`test/`) and `rake test` as the default Rake task.
47
+ - `CHANGELOG.md`.
48
+ - `rake release` / gem packaging tasks via `Bundler::GemHelper`.
49
+
50
+ ### Changed
51
+
52
+ - Gemspec rewritten for current RubyGems / Bundler.
53
+ - `Gemfile` source updated to `https://rubygems.org`.
54
+ - Entry point refactored: Railtie in Rails, direct `active_model` load outside Rails.
55
+
56
+ ### Removed
57
+
58
+ - Obsolete development dependencies: jeweler, rcov, shoulda, rspec-rails, bundler ~> 1.0 pin.
59
+ - Inline `ActiveModel::Validations` patch from main entry file (moved to `validations_patch.rb`).
60
+
61
+ ## 0.2.3
62
+
63
+ - Legacy release (Rails 3.2 era).
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
- source "http://rubygems.org"
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
2
4
 
3
5
  gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,273 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ validation_hints (6.1.0)
5
+ activerecord (>= 7.0, < 7.1)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actioncable (7.0.10)
11
+ actionpack (= 7.0.10)
12
+ activesupport (= 7.0.10)
13
+ nio4r (~> 2.0)
14
+ websocket-driver (>= 0.6.1)
15
+ actionmailbox (7.0.10)
16
+ actionpack (= 7.0.10)
17
+ activejob (= 7.0.10)
18
+ activerecord (= 7.0.10)
19
+ activestorage (= 7.0.10)
20
+ activesupport (= 7.0.10)
21
+ mail (>= 2.7.1)
22
+ net-imap
23
+ net-pop
24
+ net-smtp
25
+ actionmailer (7.0.10)
26
+ actionpack (= 7.0.10)
27
+ actionview (= 7.0.10)
28
+ activejob (= 7.0.10)
29
+ activesupport (= 7.0.10)
30
+ mail (~> 2.5, >= 2.5.4)
31
+ net-imap
32
+ net-pop
33
+ net-smtp
34
+ rails-dom-testing (~> 2.0)
35
+ actionpack (7.0.10)
36
+ actionview (= 7.0.10)
37
+ activesupport (= 7.0.10)
38
+ racc
39
+ rack (~> 2.0, >= 2.2.4)
40
+ rack-test (>= 0.6.3)
41
+ rails-dom-testing (~> 2.0)
42
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
43
+ actiontext (7.0.10)
44
+ actionpack (= 7.0.10)
45
+ activerecord (= 7.0.10)
46
+ activestorage (= 7.0.10)
47
+ activesupport (= 7.0.10)
48
+ globalid (>= 0.6.0)
49
+ nokogiri (>= 1.8.5)
50
+ actionview (7.0.10)
51
+ activesupport (= 7.0.10)
52
+ builder (~> 3.1)
53
+ erubi (~> 1.4)
54
+ rails-dom-testing (~> 2.0)
55
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
56
+ activejob (7.0.10)
57
+ activesupport (= 7.0.10)
58
+ globalid (>= 0.3.6)
59
+ activemodel (7.0.10)
60
+ activesupport (= 7.0.10)
61
+ activerecord (7.0.10)
62
+ activemodel (= 7.0.10)
63
+ activesupport (= 7.0.10)
64
+ activestorage (7.0.10)
65
+ actionpack (= 7.0.10)
66
+ activejob (= 7.0.10)
67
+ activerecord (= 7.0.10)
68
+ activesupport (= 7.0.10)
69
+ marcel (~> 1.0)
70
+ mini_mime (>= 1.1.0)
71
+ activesupport (7.0.10)
72
+ base64
73
+ benchmark (>= 0.3)
74
+ bigdecimal
75
+ concurrent-ruby (~> 1.0, >= 1.0.2)
76
+ drb
77
+ i18n (>= 1.6, < 2)
78
+ logger (>= 1.4.2)
79
+ minitest (>= 5.1)
80
+ mutex_m
81
+ securerandom (>= 0.3)
82
+ tzinfo (~> 2.0)
83
+ base64 (0.3.0)
84
+ benchmark (0.5.0)
85
+ bigdecimal (4.1.2)
86
+ builder (3.3.0)
87
+ concurrent-ruby (1.3.6)
88
+ crass (1.0.6)
89
+ date (3.5.1)
90
+ drb (2.2.3)
91
+ erubi (1.13.1)
92
+ globalid (1.3.0)
93
+ activesupport (>= 6.1)
94
+ i18n (1.14.8)
95
+ concurrent-ruby (~> 1.0)
96
+ logger (1.7.0)
97
+ loofah (2.25.1)
98
+ crass (~> 1.0.2)
99
+ nokogiri (>= 1.12.0)
100
+ mail (2.9.0)
101
+ logger
102
+ mini_mime (>= 0.1.1)
103
+ net-imap
104
+ net-pop
105
+ net-smtp
106
+ marcel (1.1.0)
107
+ method_source (1.1.0)
108
+ mini_mime (1.1.5)
109
+ minitest (5.27.0)
110
+ mutex_m (0.3.0)
111
+ net-imap (0.6.4)
112
+ date
113
+ net-protocol
114
+ net-pop (0.1.2)
115
+ net-protocol
116
+ net-protocol (0.2.2)
117
+ timeout
118
+ net-smtp (0.5.1)
119
+ net-protocol
120
+ nio4r (2.7.5)
121
+ nokogiri (1.19.3-aarch64-linux-gnu)
122
+ racc (~> 1.4)
123
+ nokogiri (1.19.3-aarch64-linux-musl)
124
+ racc (~> 1.4)
125
+ nokogiri (1.19.3-arm-linux-gnu)
126
+ racc (~> 1.4)
127
+ nokogiri (1.19.3-arm-linux-musl)
128
+ racc (~> 1.4)
129
+ nokogiri (1.19.3-arm64-darwin)
130
+ racc (~> 1.4)
131
+ nokogiri (1.19.3-x86_64-darwin)
132
+ racc (~> 1.4)
133
+ nokogiri (1.19.3-x86_64-linux-gnu)
134
+ racc (~> 1.4)
135
+ nokogiri (1.19.3-x86_64-linux-musl)
136
+ racc (~> 1.4)
137
+ racc (1.8.1)
138
+ rack (2.2.23)
139
+ rack-test (2.2.0)
140
+ rack (>= 1.3)
141
+ rails (7.0.10)
142
+ actioncable (= 7.0.10)
143
+ actionmailbox (= 7.0.10)
144
+ actionmailer (= 7.0.10)
145
+ actionpack (= 7.0.10)
146
+ actiontext (= 7.0.10)
147
+ actionview (= 7.0.10)
148
+ activejob (= 7.0.10)
149
+ activemodel (= 7.0.10)
150
+ activerecord (= 7.0.10)
151
+ activestorage (= 7.0.10)
152
+ activesupport (= 7.0.10)
153
+ bundler (>= 1.15.0)
154
+ railties (= 7.0.10)
155
+ rails-dom-testing (2.3.0)
156
+ activesupport (>= 5.0.0)
157
+ minitest
158
+ nokogiri (>= 1.6)
159
+ rails-html-sanitizer (1.7.0)
160
+ loofah (~> 2.25)
161
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
162
+ railties (7.0.10)
163
+ actionpack (= 7.0.10)
164
+ activesupport (= 7.0.10)
165
+ method_source
166
+ rake (>= 12.2)
167
+ thor (~> 1.0)
168
+ zeitwerk (~> 2.5)
169
+ rake (13.4.2)
170
+ securerandom (0.4.1)
171
+ sqlite3 (1.7.3-aarch64-linux)
172
+ sqlite3 (1.7.3-arm-linux)
173
+ sqlite3 (1.7.3-arm64-darwin)
174
+ sqlite3 (1.7.3-x86_64-darwin)
175
+ sqlite3 (1.7.3-x86_64-linux)
176
+ thor (1.5.0)
177
+ timeout (0.6.1)
178
+ tzinfo (2.0.6)
179
+ concurrent-ruby (~> 1.0)
180
+ websocket-driver (0.8.0)
181
+ base64
182
+ websocket-extensions (>= 0.1.0)
183
+ websocket-extensions (0.1.5)
184
+ zeitwerk (2.7.5)
185
+
186
+ PLATFORMS
187
+ aarch64-linux
188
+ aarch64-linux-gnu
189
+ aarch64-linux-musl
190
+ arm-linux
191
+ arm-linux-gnu
192
+ arm-linux-musl
193
+ arm64-darwin
194
+ x86_64-darwin
195
+ x86_64-linux-gnu
196
+ x86_64-linux-musl
197
+
198
+ DEPENDENCIES
199
+ bundler (>= 2.0)
200
+ minitest (~> 5.0)
201
+ rails (>= 7.0, < 7.1)
202
+ sqlite3 (~> 1.4)
203
+ validation_hints!
204
+
205
+ CHECKSUMS
206
+ actioncable (7.0.10) sha256=7aa02ea26d6cc21c33e604bb28a0759c5212653311bc42105f96f709e507afab
207
+ actionmailbox (7.0.10) sha256=1236f472d86db056f97b3602391becab69c84d9f79d963b9c9b50056e213c1e6
208
+ actionmailer (7.0.10) sha256=53bc7aac1659ef97a216c43002ea8286931d7b97f252b27152ac15de1b2585ef
209
+ actionpack (7.0.10) sha256=4c524b3b401cc828efb3fcd6f3de56ac1ec0180843b74f54357f58b0256f9509
210
+ actiontext (7.0.10) sha256=ffadcbb9b21c09e9bfe946a79739d92abc92a9097eb1db7675e52484804c1c8c
211
+ actionview (7.0.10) sha256=e5a9475ccfcde80dddf7ced701f44aedc4f8262286051db84ae2c48322ec000e
212
+ activejob (7.0.10) sha256=f31b974206569a362e8c6c07aa00f3099fcc0f365880929c23e79c739d90fceb
213
+ activemodel (7.0.10) sha256=e2e1e0a4664b69606363e9f6f59afadeab6fa8843c5fb73cd037bb72a40fa498
214
+ activerecord (7.0.10) sha256=63bc193d4c6944d85f53255362b67269d246a51bd664e09b1aa2cecfe5288c9a
215
+ activestorage (7.0.10) sha256=41906d59536170abcb480d05b2368ee06305307edcafc5e4891ffb7b0970eaa2
216
+ activesupport (7.0.10) sha256=01487b0774045918b36893af4f012986db8375f6c5850c0ffc75b940ede72305
217
+ base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
218
+ benchmark (0.5.0) sha256=465df122341aedcb81a2a24b4d3bd19b6c67c1530713fd533f3ff034e419236c
219
+ bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd
220
+ builder (3.3.0) sha256=497918d2f9dca528fdca4b88d84e4ef4387256d984b8154e9d5d3fe5a9c8835f
221
+ bundler (4.0.11) sha256=5bcec0fb78302e48d02ee46f10ee6e6942be647ba5b44a6d1ddfda9a240ce785
222
+ concurrent-ruby (1.3.6) sha256=6b56837e1e7e5292f9864f34b69c5a2cbc75c0cf5338f1ce9903d10fa762d5ab
223
+ crass (1.0.6) sha256=dc516022a56e7b3b156099abc81b6d2b08ea1ed12676ac7a5657617f012bd45d
224
+ date (3.5.1) sha256=750d06384d7b9c15d562c76291407d89e368dda4d4fff957eb94962d325a0dc0
225
+ drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
226
+ erubi (1.13.1) sha256=a082103b0885dbc5ecf1172fede897f9ebdb745a4b97a5e8dc63953db1ee4ad9
227
+ globalid (1.3.0) sha256=05c639ad6eb4594522a0b07983022f04aa7254626ab69445a0e493aa3786ff11
228
+ i18n (1.14.8) sha256=285778639134865c5e0f6269e0b818256017e8cde89993fdfcbfb64d088824a5
229
+ logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
230
+ loofah (2.25.1) sha256=d436c73dbd0c1147b16c4a41db097942d217303e1f7728704b37e4df9f6d2e04
231
+ mail (2.9.0) sha256=6fa6673ecd71c60c2d996260f9ee3dd387d4673b8169b502134659ece6d34941
232
+ marcel (1.1.0) sha256=fdcfcfa33cc52e93c4308d40e4090a5d4ea279e160a7f6af988260fa970e0bee
233
+ method_source (1.1.0) sha256=181301c9c45b731b4769bc81e8860e72f9161ad7d66dd99103c9ab84f560f5c5
234
+ mini_mime (1.1.5) sha256=8681b7e2e4215f2a159f9400b5816d85e9d8c6c6b491e96a12797e798f8bccef
235
+ minitest (5.27.0) sha256=2d3b17f8a36fe7801c1adcffdbc38233b938eb0b4966e97a6739055a45fa77d5
236
+ mutex_m (0.3.0) sha256=cfcb04ac16b69c4813777022fdceda24e9f798e48092a2b817eb4c0a782b0751
237
+ net-imap (0.6.4) sha256=9a5598c67a3022c284d98430ef1d4948e7dbdb62596f61081ea8ca933270a02b
238
+ net-pop (0.1.2) sha256=848b4e982013c15b2f0382792268763b748cce91c9e91e36b0f27ed26420dff3
239
+ net-protocol (0.2.2) sha256=aa73e0cba6a125369de9837b8d8ef82a61849360eba0521900e2c3713aa162a8
240
+ net-smtp (0.5.1) sha256=ed96a0af63c524fceb4b29b0d352195c30d82dd916a42f03c62a3a70e5b70736
241
+ nio4r (2.7.5) sha256=6c90168e48fb5f8e768419c93abb94ba2b892a1d0602cb06eef16d8b7df1dca1
242
+ nokogiri (1.19.3-aarch64-linux-gnu) sha256=46b89e5d7b9e844c2ee360794240c6ea2a4e6fa0c5892a4ed487db621224b639
243
+ nokogiri (1.19.3-aarch64-linux-musl) sha256=8392dfdcd21be7a94dbbe9ccc138dea01b97b24cb2dc02a114ca98bfb1d9a0b7
244
+ nokogiri (1.19.3-arm-linux-gnu) sha256=3919d5ffc334ad778a4a9eb88fda7dcb8b1fb58c8a52ac640c6dcd2f038e774f
245
+ nokogiri (1.19.3-arm-linux-musl) sha256=9ce1cb6346bb9c67b1550eb537aa183ead91e4b6eadb2f36ade02d8dd2a79fb6
246
+ nokogiri (1.19.3-arm64-darwin) sha256=71b9bd424b1b7abc18b05052a1a3cfd3627abdca62be280854cc411791357e42
247
+ nokogiri (1.19.3-x86_64-darwin) sha256=77f3fba57d46c53ab31e62fc6c28f705109d1bf6264356c76f132b2be5728d4d
248
+ nokogiri (1.19.3-x86_64-linux-gnu) sha256=2f5078620fe12e83669b5b17311b32532a8153d02eee7ad06948b926d6080976
249
+ nokogiri (1.19.3-x86_64-linux-musl) sha256=248c906d2166eca5efb56d52fdee5f9a1f51d69a72e2b64fdac647b4ce39ea3f
250
+ racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
251
+ rack (2.2.23) sha256=a8fe9d7e07064770b8ec123663fded8a59ef7e2b6db5cda7173d45a5718ab69c
252
+ rack-test (2.2.0) sha256=005a36692c306ac0b4a9350355ee080fd09ddef1148a5f8b2ac636c720f5c463
253
+ rails (7.0.10) sha256=866eb2c53d3184543fdb770d7ea308e4ee518063226a9e176229f3c7a9537c25
254
+ rails-dom-testing (2.3.0) sha256=8acc7953a7b911ca44588bf08737bc16719f431a1cc3091a292bca7317925c1d
255
+ rails-html-sanitizer (1.7.0) sha256=28b145cceaf9cc214a9874feaa183c3acba036c9592b19886e0e45efc62b1e89
256
+ railties (7.0.10) sha256=d52a8b7a61ad941121a15a6596b2150e05c70b199c3afc9e9b73e63b3b1a57a7
257
+ rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701
258
+ securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
259
+ sqlite3 (1.7.3-aarch64-linux) sha256=0ccb8c001cd2617f4801a2c816142d3c9bc299e3f3e0f49e03812f3610b0891c
260
+ sqlite3 (1.7.3-arm-linux) sha256=eb653026d44f8502b74564e585245485a5667d72f8888854e53c561f816541b0
261
+ sqlite3 (1.7.3-arm64-darwin) sha256=b956160cc882d2568f332f915c9fe27cae9a4521b202d6e7ea540171c88e4600
262
+ sqlite3 (1.7.3-x86_64-darwin) sha256=b88e117ae14b2c5b61a7eb14da24b3b0e93cd3e1c17774ff3b6e5a03ffe4e5b7
263
+ sqlite3 (1.7.3-x86_64-linux) sha256=522a3285660dec8253465880c97980e873db0d79060900be8d14194217a3ee73
264
+ thor (1.5.0) sha256=e3a9e55fe857e44859ce104a84675ab6e8cd59c650a49106a05f55f136425e73
265
+ timeout (0.6.1) sha256=78f57368a7e7bbadec56971f78a3f5ecbcfb59b7fcbb0a3ed6ddc08a5094accb
266
+ tzinfo (2.0.6) sha256=8daf828cc77bcf7d63b0e3bdb6caa47e2272dcfaf4fbfe46f8c3a9df087a829b
267
+ validation_hints (6.1.0)
268
+ websocket-driver (0.8.0) sha256=ed0dba4b943c22f17f9a734817e808bc84cdce6a7e22045f5315aa57676d4962
269
+ websocket-extensions (0.1.5) sha256=1c6ba63092cda343eb53fc657110c71c754c56484aad42578495227d717a8241
270
+ zeitwerk (2.7.5) sha256=d8da92128c09ea6ec62c949011b00ed4a20242b255293dd66bf41545398f73dd
271
+
272
+ BUNDLED WITH
273
+ 4.0.11
data/Rakefile CHANGED
@@ -1,2 +1,15 @@
1
- require 'bundler'
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/setup"
4
+ require "bundler/gem_helper"
5
+ require "rake/testtask"
6
+
2
7
  Bundler::GemHelper.install_tasks
8
+
9
+ Rake::TestTask.new(:test) do |t|
10
+ t.libs << "test"
11
+ t.libs << "lib"
12
+ t.pattern = "test/**/*_test.rb"
13
+ end
14
+
15
+ task default: :test