validation_hints 8.1.20 → 8.1.40
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 +4 -4
- data/.forgejo/workflows/ci.yml +42 -0
- data/.rubocop.yml +12 -0
- data/CHANGELOG.md +120 -0
- data/Rakefile +1 -1
- data/lib/active_model/hints.rb +1 -1
- data/lib/validation_hints/version.rb +2 -1
- data/test/active_model/hints_test.rb +2 -2
- data/test/active_model/i18n_test.rb +4 -4
- data/test/validation_hints_test.rb +3 -1
- data/validation_hints.gemspec +5 -3
- metadata +17 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4d3499b128bcdf011fbf3d685043b4803fb8b809f6a940ce6e23f75fd66d867f
|
|
4
|
+
data.tar.gz: 5b6248a572ebb0cc9892208149a8915dbab9d9dbf714ebfa943ada466274922d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bb243d53700a013175156448d3fc9377c00577f436f4bb8c9c7eb82457f25e986e78e93cd88ede0c765354719aa60a1d9083bf7f0c5b167cde007695b4779f50
|
|
7
|
+
data.tar.gz: 24468f5b74c7967900d22985fd33b756a10168f764fe64cbe77ba9cfa30aefb31d9a6a1ca51433b72b842154748004d5d4cdb4f303dff99bfeadf7d6af33e7e1
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# CI for Forgejo Actions (runner on dev02; same pattern as inline_forms and
|
|
2
|
+
# Papiamentu: runner label `docker`, shared image, vendor/bundle cache).
|
|
3
|
+
# No GitHub workflows exist — pushing to GitHub triggers nothing.
|
|
4
|
+
name: CI
|
|
5
|
+
|
|
6
|
+
# Push triggers on EVERY branch (inline_forms stuff/prompt/workflow.md:
|
|
7
|
+
# "every commit runs through CI") — feature branches were silently skipping
|
|
8
|
+
# CI when this was `branches: [master]`.
|
|
9
|
+
on:
|
|
10
|
+
push:
|
|
11
|
+
pull_request:
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
test:
|
|
15
|
+
runs-on: docker
|
|
16
|
+
container:
|
|
17
|
+
image: papiamentu-ci:ruby-4.0.4-node20
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Cache gems
|
|
22
|
+
uses: actions/cache@v4
|
|
23
|
+
with:
|
|
24
|
+
path: vendor/bundle
|
|
25
|
+
key: gems-validation_hints-${{ hashFiles('Gemfile', 'validation_hints.gemspec') }}
|
|
26
|
+
restore-keys: gems-validation_hints-
|
|
27
|
+
|
|
28
|
+
- name: Install gems
|
|
29
|
+
run: |
|
|
30
|
+
bundle config set --local path vendor/bundle
|
|
31
|
+
bundle install --jobs 4
|
|
32
|
+
|
|
33
|
+
- name: Tests
|
|
34
|
+
run: bundle exec rake test
|
|
35
|
+
|
|
36
|
+
- name: RuboCop
|
|
37
|
+
run: bundle exec rubocop
|
|
38
|
+
|
|
39
|
+
- name: bundler-audit
|
|
40
|
+
run: |
|
|
41
|
+
gem install bundler-audit --no-document
|
|
42
|
+
bundle-audit check --update
|
data/.rubocop.yml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# RuboCop with the Rails "omakase" preset (same recipe as Papiamentu and
|
|
2
|
+
# inline_forms). The codebase is fully clean — no .rubocop_todo.yml baseline.
|
|
3
|
+
# Run with: bundle exec rubocop
|
|
4
|
+
inherit_gem:
|
|
5
|
+
rubocop-rails-omakase: rubocop.yml
|
|
6
|
+
|
|
7
|
+
AllCops:
|
|
8
|
+
TargetRubyVersion: 3.3
|
|
9
|
+
Exclude:
|
|
10
|
+
- "pkg/**/*"
|
|
11
|
+
- "vendor/**/*"
|
|
12
|
+
- "stuff/**/*"
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,126 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented here.
|
|
4
4
|
|
|
5
|
+
## 8.1.40
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- **Version numbering:** aligned with **inline_forms** / **inline_forms_installer** **8.1.40** (companion release: example app gains Apartment → Photo → Comment nesting-in-nesting demo; no API changes in validation_hints).
|
|
10
|
+
|
|
11
|
+
## 8.1.39
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- **Version numbering:** aligned with **inline_forms** / **inline_forms_installer** **8.1.39** (companion release: "open after create" — top-level create of a model with an `:associated` panel opens the new row via Turbo Streams; no API changes in validation_hints).
|
|
16
|
+
|
|
17
|
+
## 8.1.38
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- **Version numbering:** aligned with **inline_forms** / **inline_forms_installer** **8.1.38** (companion release: inline_forms RuboCop todo shrunk 590 → 196, heredoc-free files all clean; no API changes in validation_hints).
|
|
22
|
+
|
|
23
|
+
## 8.1.37
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- **RuboCop: zero offenses, todo file eliminated.** All 22 grandfathered offenses fixed via safe autocorrect: array-bracket spacing per omakase style (`[ "lib" ]`) in the Rakefile, both test files and the gemspec; a blank line after the encoding magic comment in `version.rb`; one trailing array comma in `lib/active_model/hints.rb`. Style-only — no behavior change (26 runs, 59 assertions, green). `.rubocop_todo.yml` deleted and `inherit_from` dropped, so RuboCop now runs against the bare omakase config. Version aligned with **inline_forms** / **inline_forms_installer** **8.1.37**.
|
|
28
|
+
|
|
29
|
+
## 8.1.36
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
|
|
33
|
+
- **Version numbering:** aligned with **inline_forms** / **inline_forms_installer** **8.1.36** (companion release: force_ssl in generated apps, Brakeman baseline enforced; no API changes in validation_hints).
|
|
34
|
+
|
|
35
|
+
## 8.1.35
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
|
|
39
|
+
- **Version numbering:** aligned with **inline_forms** / **inline_forms_installer** **8.1.35** (companion release: seed images shipped with the installer; no API changes in validation_hints).
|
|
40
|
+
|
|
41
|
+
## 8.1.34
|
|
42
|
+
|
|
43
|
+
### Added
|
|
44
|
+
|
|
45
|
+
- **Forgejo Actions CI** (`.forgejo/workflows/ci.yml`: tests, RuboCop, bundler-audit on the dev02 runner) and **RuboCop** (Rails omakase + `.rubocop_todo.yml` grandfathering the 22 pre-existing offenses). No GitHub workflows — pushing to GitHub triggers nothing. Version aligned with **inline_forms** / **inline_forms_installer** **8.1.34**.
|
|
46
|
+
|
|
47
|
+
## 8.1.33
|
|
48
|
+
|
|
49
|
+
### Changed
|
|
50
|
+
|
|
51
|
+
- **Version numbering:** aligned with **inline_forms** / **inline_forms_installer** **8.1.33** (companion release: README refresh; no API changes in validation_hints).
|
|
52
|
+
|
|
53
|
+
## 8.1.32
|
|
54
|
+
|
|
55
|
+
### Changed
|
|
56
|
+
|
|
57
|
+
- **Version numbering:** aligned with **inline_forms** / **inline_forms_installer** **8.1.32** (companion release: Pattern 2 per-user color overrides + color_field element; no API changes in validation_hints).
|
|
58
|
+
|
|
59
|
+
## 8.1.31
|
|
60
|
+
|
|
61
|
+
### Changed
|
|
62
|
+
|
|
63
|
+
- **Version numbering:** aligned with **inline_forms** / **inline_forms_installer** **8.1.31** (companion release: per-user locale; no API changes in validation_hints).
|
|
64
|
+
|
|
65
|
+
## 8.1.30
|
|
66
|
+
|
|
67
|
+
### Changed
|
|
68
|
+
|
|
69
|
+
- **Version numbering:** aligned with **inline_forms** / **inline_forms_installer** **8.1.30** (companion release: question_list/dnsrecords archived; no API changes in validation_hints).
|
|
70
|
+
|
|
71
|
+
## 8.1.29
|
|
72
|
+
|
|
73
|
+
### Changed
|
|
74
|
+
|
|
75
|
+
- **Version numbering:** aligned with **inline_forms** / **inline_forms_installer** **8.1.29** (companion release: per-user preset themes; no API changes in validation_hints).
|
|
76
|
+
|
|
77
|
+
## 8.1.28
|
|
78
|
+
|
|
79
|
+
### Changed
|
|
80
|
+
|
|
81
|
+
- **Version numbering:** aligned with **inline_forms** / **inline_forms_installer** **8.1.28** (companion release: multi_image_field showcase + fixes; no API changes in validation_hints).
|
|
82
|
+
|
|
83
|
+
## 8.1.27
|
|
84
|
+
|
|
85
|
+
### Changed
|
|
86
|
+
|
|
87
|
+
- **Version numbering:** aligned with **inline_forms** / **inline_forms_installer** **8.1.27** (companion release: engine test/dummy harness + CI; no API changes in validation_hints).
|
|
88
|
+
|
|
89
|
+
## 8.1.26
|
|
90
|
+
|
|
91
|
+
### Changed
|
|
92
|
+
|
|
93
|
+
- **Version numbering:** aligned with **inline_forms** / **inline_forms_installer** **8.1.26** (companion release: jQuery UI fully removed; no API changes in validation_hints).
|
|
94
|
+
|
|
95
|
+
## 8.1.25
|
|
96
|
+
|
|
97
|
+
### Changed
|
|
98
|
+
|
|
99
|
+
- **Version numbering:** aligned with **inline_forms** / **inline_forms_installer** **8.1.25** (companion release: native date/time/month inputs replace jQuery UI pickers; no API changes in validation_hints).
|
|
100
|
+
|
|
101
|
+
## 8.1.24
|
|
102
|
+
|
|
103
|
+
### Changed
|
|
104
|
+
|
|
105
|
+
- **Version numbering:** aligned with **inline_forms** / **inline_forms_installer** **8.1.24** (companion release: CSS custom-property theme bridge; no API changes in validation_hints).
|
|
106
|
+
|
|
107
|
+
## 8.1.23
|
|
108
|
+
|
|
109
|
+
### Changed
|
|
110
|
+
|
|
111
|
+
- **Version numbering:** aligned with **inline_forms** / **inline_forms_installer** **8.1.23** (companion release: tabs_on_rails dependency vendored into the engine as `InlineForms::Tabs`; no API changes in validation_hints).
|
|
112
|
+
|
|
113
|
+
## 8.1.22
|
|
114
|
+
|
|
115
|
+
### Changed
|
|
116
|
+
|
|
117
|
+
- **Version numbering:** aligned with **inline_forms** / **inline_forms_installer** **8.1.22** (companion release: Trix vendored off the unpkg CDN, Open Sans self-hosted, Foundation Icons `@font-face` 404 fixed, installer Gemfile pins completed; no API changes in validation_hints).
|
|
118
|
+
|
|
119
|
+
## 8.1.21
|
|
120
|
+
|
|
121
|
+
### Changed
|
|
122
|
+
|
|
123
|
+
- **Version numbering:** aligned with **inline_forms** / **inline_forms_installer** **8.1.21** (companion release: CKEditor-era form elements `:ckeditor` and `:text_area_without_ckeditor` retired; no API changes in validation_hints).
|
|
124
|
+
|
|
5
125
|
## 8.1.20
|
|
6
126
|
|
|
7
127
|
### Fixed
|
data/Rakefile
CHANGED
data/lib/active_model/hints.rb
CHANGED
|
@@ -275,7 +275,7 @@ module ActiveModel
|
|
|
275
275
|
|
|
276
276
|
if validator_key == "length"
|
|
277
277
|
[
|
|
278
|
-
generate_message(attribute, "#{validator_key}.within", minimum: minimum, maximum: maximum)
|
|
278
|
+
generate_message(attribute, "#{validator_key}.within", minimum: minimum, maximum: maximum)
|
|
279
279
|
]
|
|
280
280
|
else
|
|
281
281
|
[
|
|
@@ -14,7 +14,7 @@ class ActiveModelHintsTest < Minitest::Test
|
|
|
14
14
|
|
|
15
15
|
def test_full_messages_for_includes_human_attribute_name
|
|
16
16
|
messages = @person.hints.full_messages_for(:name)
|
|
17
|
-
assert_equal ["Name can't be blank"], messages
|
|
17
|
+
assert_equal [ "Name can't be blank" ], messages
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
def test_has_validations_for
|
|
@@ -48,7 +48,7 @@ class ActiveModelHintsTest < Minitest::Test
|
|
|
48
48
|
end
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
-
assert_equal ["must be a number"], model.new.hints[:age]
|
|
51
|
+
assert_equal [ "must be a number" ], model.new.hints[:age]
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
def test_numericality_range_options_keep_their_messages
|
|
@@ -36,13 +36,13 @@ class ActiveModelHintsI18nTest < Minitest::Test
|
|
|
36
36
|
}
|
|
37
37
|
)
|
|
38
38
|
|
|
39
|
-
assert_equal ["needs a name"], @person.hints[:name]
|
|
39
|
+
assert_equal [ "needs a name" ], @person.hints[:name]
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
def test_hints_attributes_override
|
|
43
43
|
@kv.store_translations(:en, hints: { attributes: { name: { presence: "name hint" } } })
|
|
44
44
|
|
|
45
|
-
assert_equal ["name hint"], @person.hints[:name]
|
|
45
|
+
assert_equal [ "name hint" ], @person.hints[:name]
|
|
46
46
|
end
|
|
47
47
|
|
|
48
48
|
def test_top_level_hints_messages_override
|
|
@@ -54,12 +54,12 @@ class ActiveModelHintsI18nTest < Minitest::Test
|
|
|
54
54
|
def test_full_message_uses_activerecord_human_attribute_name
|
|
55
55
|
@kv.store_translations(:en, activerecord: { attributes: { person: { name: "Your name" } } })
|
|
56
56
|
|
|
57
|
-
assert_equal ["Your name can't be blank"], @person.hints.full_messages_for(:name)
|
|
57
|
+
assert_equal [ "Your name can't be blank" ], @person.hints.full_messages_for(:name)
|
|
58
58
|
end
|
|
59
59
|
|
|
60
60
|
def test_full_message_format_override
|
|
61
61
|
@kv.store_translations(:en, activerecord: { hints: { format: "%{attribute}: %{message}" } })
|
|
62
62
|
|
|
63
|
-
assert_equal ["Name: can't be blank"], @person.hints.full_messages_for(:name)
|
|
63
|
+
assert_equal [ "Name: can't be blank" ], @person.hints.full_messages_for(:name)
|
|
64
64
|
end
|
|
65
65
|
end
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
require "test_helper"
|
|
4
4
|
|
|
5
5
|
class ValidationHintsTest < Minitest::Test
|
|
6
|
+
# Lockstep releases bump VERSION without touching this gem's code, so pin the
|
|
7
|
+
# 8.1 line rather than an exact patch (which broke on the 8.1.21 bump).
|
|
6
8
|
def test_version
|
|
7
|
-
|
|
9
|
+
assert_match(/\A8\.1\.\d+\z/, ValidationHints::VERSION)
|
|
8
10
|
end
|
|
9
11
|
|
|
10
12
|
def test_locale_path_exists
|
data/validation_hints.gemspec
CHANGED
|
@@ -6,8 +6,8 @@ Gem::Specification.new do |s|
|
|
|
6
6
|
s.name = "validation_hints"
|
|
7
7
|
s.version = ValidationHints::VERSION
|
|
8
8
|
s.platform = Gem::Platform::RUBY
|
|
9
|
-
s.authors = ["Ace Suares"]
|
|
10
|
-
s.email = ["ace@suares.com"]
|
|
9
|
+
s.authors = [ "Ace Suares" ]
|
|
10
|
+
s.email = [ "ace@suares.com" ]
|
|
11
11
|
s.homepage = "https://github.com/acesuares/validation_hints"
|
|
12
12
|
s.summary = "Proactive validation hints derived from model validators"
|
|
13
13
|
s.description = "Shows what a field expects before validation fails — complementary to ActiveModel errors."
|
|
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
|
|
|
26
26
|
s.test_files = Dir.glob("{test,spec}/**/*", base: __dir__)
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
s.require_paths = ["lib"]
|
|
29
|
+
s.require_paths = [ "lib" ]
|
|
30
30
|
|
|
31
31
|
s.add_dependency "activerecord", ">= 8.1", "< 8.2"
|
|
32
32
|
|
|
@@ -36,4 +36,6 @@ Gem::Specification.new do |s|
|
|
|
36
36
|
s.add_development_dependency "minitest", "~> 5.0"
|
|
37
37
|
s.add_development_dependency "rake", "~> 13.0"
|
|
38
38
|
s.add_development_dependency "bundler", ">= 2.0"
|
|
39
|
+
# Rails omakase style; offenses grandfathered in .rubocop_todo.yml.
|
|
40
|
+
s.add_development_dependency "rubocop-rails-omakase"
|
|
39
41
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: validation_hints
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 8.1.
|
|
4
|
+
version: 8.1.40
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ace Suares
|
|
@@ -125,6 +125,20 @@ dependencies:
|
|
|
125
125
|
- - ">="
|
|
126
126
|
- !ruby/object:Gem::Version
|
|
127
127
|
version: '2.0'
|
|
128
|
+
- !ruby/object:Gem::Dependency
|
|
129
|
+
name: rubocop-rails-omakase
|
|
130
|
+
requirement: !ruby/object:Gem::Requirement
|
|
131
|
+
requirements:
|
|
132
|
+
- - ">="
|
|
133
|
+
- !ruby/object:Gem::Version
|
|
134
|
+
version: '0'
|
|
135
|
+
type: :development
|
|
136
|
+
prerelease: false
|
|
137
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
138
|
+
requirements:
|
|
139
|
+
- - ">="
|
|
140
|
+
- !ruby/object:Gem::Version
|
|
141
|
+
version: '0'
|
|
128
142
|
description: Shows what a field expects before validation fails — complementary to
|
|
129
143
|
ActiveModel errors.
|
|
130
144
|
email:
|
|
@@ -134,7 +148,9 @@ extensions: []
|
|
|
134
148
|
extra_rdoc_files: []
|
|
135
149
|
files:
|
|
136
150
|
- ".document"
|
|
151
|
+
- ".forgejo/workflows/ci.yml"
|
|
137
152
|
- ".gitignore"
|
|
153
|
+
- ".rubocop.yml"
|
|
138
154
|
- ".ruby-version"
|
|
139
155
|
- CHANGELOG.md
|
|
140
156
|
- Gemfile
|