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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 07ed5ea6e511eaddacff9e029a67e7ae27322c2ce73c59e0e19f9f68c0d08201
4
- data.tar.gz: effcba7276888c5128f3da7dcd93c8a959c0bcfe17dd9768a4f7c940f191e8e3
3
+ metadata.gz: 91fcc915de81a06eb86ec0cb48450a5a20ecdb06a89482a2ebeeaa356377af60
4
+ data.tar.gz: ca757a397d0ef962647886143e504a9df9f57f5f557d0763246d43c02a072308
5
5
  SHA512:
6
- metadata.gz: af40d01a92f602ea720142fe57f7f48a2cd06c46e7dd975c437ff8a207b7e66bade4423444fb18c498c6793dddbbcad7d426ad492c378cfe1196aea209eed40d
7
- data.tar.gz: a277088e0acf3fc752c9e60da9eb88530c5ce392d942d05bd650268f8d40b6e3b6e1c6779457d24ed81362e783336fba5e3efaed5ffd895abc94bde2a81a6731
6
+ metadata.gz: 33444146ba69316039d29c44be04b8248fe7d26e11c9e205f6d531d4657c7f1f5cdbea3cc3e2a010be9dcddfc07b2de65af656c166feb27d90aa2bc77ffea31b
7
+ data.tar.gz: d31be6a8d8dd1011e780f3d9564bc6ff145800c3512af6caaa9f29f760676818cdbdbf5ed99f879835fe0928db725d3db21ce2ada6efa4b985fe95bd04ead841
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Sealink Param Validation
2
2
 
3
+ ## Unreleased
4
+
5
+ ## 0.4.1
6
+
7
+ - [TBAU-1724] Remove unused Rails dependencies
8
+
3
9
  ## 0.4.0
4
10
 
5
11
  - [PLAT-1175] Update to Ruby 3.2
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SealinkParamValidation
4
- VERSION = '0.4.0'
4
+ VERSION = '0.4.1'
5
5
  end
@@ -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 'rails'
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
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  ENV['RAILS_ENV'] ||= 'test'
4
- require 'rails'
4
+ require 'logger'
5
5
  require 'action_controller/railtie'
6
6
  require 'dry-schema'
7
7
  require 'rspec/rails'
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.0
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: 2023-01-17 00:00:00.000000000 Z
11
+ date: 2026-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rails
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.