sealink-param-validation 0.4.0 → 0.4.1
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/CHANGELOG.md +6 -0
- data/CLAUDE.md +36 -0
- data/lib/sealink_param_validation/version.rb +1 -1
- data/sealink_param_validation.gemspec +2 -1
- data/spec/spec_helper.rb +1 -1
- metadata +21 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 91fcc915de81a06eb86ec0cb48450a5a20ecdb06a89482a2ebeeaa356377af60
|
|
4
|
+
data.tar.gz: ca757a397d0ef962647886143e504a9df9f57f5f557d0763246d43c02a072308
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 33444146ba69316039d29c44be04b8248fe7d26e11c9e205f6d531d4657c7f1f5cdbea3cc3e2a010be9dcddfc07b2de65af656c166feb27d90aa2bc77ffea31b
|
|
7
|
+
data.tar.gz: d31be6a8d8dd1011e780f3d9564bc6ff145800c3512af6caaa9f29f760676818cdbdbf5ed99f879835fe0928db725d3db21ce2ada6efa4b985fe95bd04ead841
|
data/CHANGELOG.md
CHANGED
data/CLAUDE.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
Ruby gem (`sealink-param-validation`) that provides Rails controller parameter validation using dry-schema. Controllers include `SealinkParamValidation::Concern` and declare schemas per action via `schema_for`. Invalid params return 422 with error messages.
|
|
8
|
+
|
|
9
|
+
## Commands
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
bundle install # Install dependencies
|
|
13
|
+
bundle exec rspec # Run all tests
|
|
14
|
+
bundle exec rspec spec/helper_spec.rb # Run a single spec file
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Architecture
|
|
18
|
+
|
|
19
|
+
- **`lib/sealink_param_validation/concern.rb`** — ActiveSupport::Concern included in controllers. `schema_for(action, schema)` registers a dry-schema per action and adds a `before_action` that validates params. Two validation paths: `ensure_schema` (renders 422 JSON) and `ensure_schema!` (raises `InvalidInputError`).
|
|
20
|
+
- **`lib/sealink_param_validation/helper.rb`** — Formats dry-schema validation errors into strings. `generate_error_message` returns full error paths; `generate_humanized_error_message` returns humanized field names with `to_sentence`.
|
|
21
|
+
- **`lib/sealink_param_validation/error.rb`** — `InvalidInputError` exception class.
|
|
22
|
+
|
|
23
|
+
## Key Dependencies
|
|
24
|
+
|
|
25
|
+
- `rails` (ActiveSupport::Concern, ActionController)
|
|
26
|
+
- `dry-schema` (>= 1.0.0) for param validation schemas
|
|
27
|
+
|
|
28
|
+
## Testing
|
|
29
|
+
|
|
30
|
+
Tests use `rspec-rails` with a minimal Rails application defined in `spec/spec_helper.rb`. The validation spec creates a `DummyController` with routes to test the concern end-to-end.
|
|
31
|
+
|
|
32
|
+
## Release Process
|
|
33
|
+
|
|
34
|
+
1. Update version in `lib/sealink_param_validation/version.rb` and `CHANGELOG.md`
|
|
35
|
+
2. Create a git tag in format `v0.1.0`
|
|
36
|
+
3. Push — GitHub Actions handles the build/publish
|
|
@@ -20,7 +20,8 @@ Gem::Specification.new do |spec|
|
|
|
20
20
|
spec.require_paths = ['lib']
|
|
21
21
|
spec.required_ruby_version = '>= 3.0'
|
|
22
22
|
|
|
23
|
-
spec.add_dependency '
|
|
23
|
+
spec.add_dependency 'activesupport'
|
|
24
|
+
spec.add_dependency 'actionpack'
|
|
24
25
|
spec.add_dependency 'dry-schema', '>= 1.0.0'
|
|
25
26
|
|
|
26
27
|
spec.add_development_dependency 'bundler'
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,17 +1,31 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sealink-param-validation
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sean Earle
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-03-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
|
-
name:
|
|
14
|
+
name: activesupport
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '0'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ">="
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '0'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: actionpack
|
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
|
16
30
|
requirements:
|
|
17
31
|
- - ">="
|
|
@@ -121,6 +135,7 @@ files:
|
|
|
121
135
|
- ".gitignore"
|
|
122
136
|
- ".ruby-version"
|
|
123
137
|
- CHANGELOG.md
|
|
138
|
+
- CLAUDE.md
|
|
124
139
|
- Gemfile
|
|
125
140
|
- README.md
|
|
126
141
|
- Rakefile
|
|
@@ -142,7 +157,7 @@ homepage: http://github.com/sealink/sealink-param-validation
|
|
|
142
157
|
licenses:
|
|
143
158
|
- MIT
|
|
144
159
|
metadata: {}
|
|
145
|
-
post_install_message:
|
|
160
|
+
post_install_message:
|
|
146
161
|
rdoc_options: []
|
|
147
162
|
require_paths:
|
|
148
163
|
- lib
|
|
@@ -158,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
158
173
|
version: '0'
|
|
159
174
|
requirements: []
|
|
160
175
|
rubygems_version: 3.4.1
|
|
161
|
-
signing_key:
|
|
176
|
+
signing_key:
|
|
162
177
|
specification_version: 4
|
|
163
178
|
summary: This is some logic we want to use across many projects so we have extracted
|
|
164
179
|
it into a gem.
|