validated_object 2.3.2 → 2.3.4
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/.rubocop.yml +14 -0
- data/CLAUDE.md +67 -0
- data/README.md +15 -2
- data/lib/validated_object/simplified_api.rb +35 -4
- data/lib/validated_object/version.rb +1 -2
- data/lib/validated_object.rb +98 -35
- data/script/demo.rb +2 -2
- data/validated_object.gemspec +6 -7
- metadata +28 -30
- data/sorbet/config +0 -2
- data/sorbet/rbi/gems/activemodel.rbi +0 -210
- data/sorbet/rbi/gems/activesupport.rbi +0 -902
- data/sorbet/rbi/gems/concurrent-ruby.rbi +0 -1590
- data/sorbet/rbi/gems/i18n.rbi +0 -133
- data/sorbet/rbi/gems/rake.rbi +0 -645
- data/sorbet/rbi/gems/rspec-core.rbi +0 -1889
- data/sorbet/rbi/gems/rspec-expectations.rbi +0 -1125
- data/sorbet/rbi/gems/rspec-mocks.rbi +0 -1099
- data/sorbet/rbi/gems/rspec-support.rbi +0 -280
- data/sorbet/rbi/gems/rspec.rbi +0 -15
- data/sorbet/rbi/gems/site_ruby.rbi +0 -1862
- data/sorbet/rbi/gems/thread_safe.rbi +0 -82
- data/sorbet/rbi/gems/tzinfo.rbi +0 -408
- data/sorbet/rbi/sorbet-typed/lib/activemodel/all/activemodel.rbi +0 -597
- data/sorbet/rbi/sorbet-typed/lib/activesupport/>=6/activesupport.rbi +0 -36
- data/sorbet/rbi/sorbet-typed/lib/activesupport/all/activesupport.rbi +0 -1431
- data/sorbet/rbi/sorbet-typed/lib/minitest/all/minitest.rbi +0 -108
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8938191d6ee1e84b60f0c659674952d9fbb56c7ea01bc2672194c8aee3120bf4
|
4
|
+
data.tar.gz: 2dd18069152f37b629030d10e0d46408bdec7369c36ed4407cbaa36baf2ff297
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: beb309f24b778cf42ea63d503669a68ff71d0bc2432fb961ce32bfb1f84b32bf9a7fe8acf1a62dc00f84aaf5cbaa95954720d4a22faf5e9b4dda439d6ef425a3
|
7
|
+
data.tar.gz: 5e8b97e5ff1e46279b0e81da5b7e7a110732c7c68507638e822f39fff3059f7da02d619a33ba1fb403bdfe21d8c9b5f4b4ce77f7fac9adf4048f6d2199ba7561
|
data/.rubocop.yml
ADDED
data/CLAUDE.md
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
# CLAUDE.md
|
2
|
+
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
4
|
+
|
5
|
+
## Commands
|
6
|
+
|
7
|
+
### Development Setup
|
8
|
+
- `bin/setup` - Install dependencies (runs `bundle install`)
|
9
|
+
- `bin/console` - Start an interactive console with the gem loaded
|
10
|
+
|
11
|
+
### Testing and Quality
|
12
|
+
- `rake spec` or `bundle exec rspec` - Run the test suite
|
13
|
+
- `bundle exec rubocop` - Run code linting (with rubocop-rspec and rubocop-rake plugins)
|
14
|
+
- `rake` - Default task (runs specs)
|
15
|
+
|
16
|
+
### Gem Development
|
17
|
+
- `bundle exec rake install` - Install gem locally for testing
|
18
|
+
- `bundle exec rake release` - Release new version (updates version, creates git tag, pushes to rubygems.org)
|
19
|
+
|
20
|
+
## Architecture
|
21
|
+
|
22
|
+
This is a Ruby gem that provides self-validating Plain Old Ruby Objects using ActiveModel validations. The core architecture consists of:
|
23
|
+
|
24
|
+
### Main Components
|
25
|
+
|
26
|
+
**ValidatedObject::Base** (`lib/validated_object.rb`):
|
27
|
+
- The main class that objects inherit from to gain validation capabilities
|
28
|
+
- Includes `ActiveModel::Validations` for standard Rails validation methods
|
29
|
+
- Automatically validates objects during instantiation via `initialize`
|
30
|
+
- Provides `check_validations!` method for explicit validation with clear error messages
|
31
|
+
- Contains a custom `TypeValidator` that supports type checking including arrays and pseudo-boolean validation
|
32
|
+
|
33
|
+
**ValidatedObject::SimplifiedApi** (`lib/validated_object/simplified_api.rb`):
|
34
|
+
- Provides convenience methods like `validates_attr` that combine `attr_reader` and `validates`
|
35
|
+
- Supports streamlined array element type validation with `[ElementType]` syntax
|
36
|
+
- Allows `validated` as synonym for `validates`
|
37
|
+
|
38
|
+
### Key Features
|
39
|
+
|
40
|
+
- **Type Validation**: Custom `TypeValidator` supports class validation, pseudo-boolean (`Boolean` class), and array element type checking
|
41
|
+
- **Array Element Validation**: Two syntaxes supported:
|
42
|
+
- `validates_attr :tags, type: Array, element_type: String`
|
43
|
+
- `validates_attr :tags, type: [String]` (streamlined syntax)
|
44
|
+
- **Immutable Objects**: Uses `attr_reader` with instance variable setting to create read-only validated objects
|
45
|
+
- **Clear Error Messages**: Validation failures provide descriptive messages like "Birthday is a String, not a Date"
|
46
|
+
|
47
|
+
### Validation Patterns
|
48
|
+
|
49
|
+
The gem follows a declarative pattern where classes define their validation rules upfront:
|
50
|
+
|
51
|
+
```ruby
|
52
|
+
class Dog < ValidatedObject::Base
|
53
|
+
validates_attr :name, presence: true
|
54
|
+
validates_attr :birthday, type: Date, allow_nil: true
|
55
|
+
validates_attr :tags, type: [String], allow_nil: true
|
56
|
+
end
|
57
|
+
```
|
58
|
+
|
59
|
+
Objects validate themselves during instantiation and raise `ArgumentError` with detailed messages if invalid.
|
60
|
+
|
61
|
+
## Development Notes
|
62
|
+
|
63
|
+
- Requires Ruby 3.1+
|
64
|
+
- Uses RSpec for testing with color output enabled
|
65
|
+
- RuboCop configured with rspec and rake plugins
|
66
|
+
- Gem specification allows pushing to rubygems.org
|
67
|
+
- Demo script available at `script/demo.rb`
|
data/README.md
CHANGED
@@ -12,7 +12,7 @@ class Person < ValidatedObject::Base
|
|
12
12
|
end
|
13
13
|
|
14
14
|
# Instantiating it runs the validations.
|
15
|
-
me = Person.new(name: '
|
15
|
+
me = Person.new(name: 'Robert')
|
16
16
|
you = Person.new(name: '') # => ArgumentError: "Name can't be blank"
|
17
17
|
```
|
18
18
|
|
@@ -82,6 +82,19 @@ validates :premium_membership, type: Boolean
|
|
82
82
|
#...
|
83
83
|
```
|
84
84
|
|
85
|
+
|
86
|
+
### Array element type validation
|
87
|
+
|
88
|
+
You can validate that an attribute is an array of a specific type using array syntax:
|
89
|
+
|
90
|
+
```ruby
|
91
|
+
# Validate that names is an array of String objects.
|
92
|
+
validates_attr :names, type: [String]
|
93
|
+
```
|
94
|
+
|
95
|
+
If the array contains any elements that are not of the specified type, validation will fail with a clear error message.
|
96
|
+
|
97
|
+
|
85
98
|
### Instantiating and automatically validating
|
86
99
|
|
87
100
|
```ruby
|
@@ -141,7 +154,7 @@ the data.
|
|
141
154
|
|
142
155
|
### Use in code generation
|
143
156
|
|
144
|
-
|
157
|
+
The [Schema.org structured data gem](https://github.com/public-law/schema-dot-org) uses ValidatedObjects to recursively create well formed HTML / JSON-LD.
|
145
158
|
|
146
159
|
## Installation
|
147
160
|
|
@@ -1,8 +1,10 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'active_support/concern'
|
2
4
|
|
3
|
-
# Enable a simplified API for the common case of
|
4
|
-
# read-only ValidatedObjects.
|
5
5
|
module ValidatedObject
|
6
|
+
# Enable a simplified API for the common case of
|
7
|
+
# read-only ValidatedObjects.
|
6
8
|
module SimplifiedApi
|
7
9
|
extend ActiveSupport::Concern
|
8
10
|
|
@@ -10,6 +12,7 @@ module ValidatedObject
|
|
10
12
|
# Simply delegate to `attr_reader` and `validates`.
|
11
13
|
def validated_attr(attribute, *options)
|
12
14
|
attr_reader attribute
|
15
|
+
|
13
16
|
validates attribute, *options
|
14
17
|
end
|
15
18
|
|
@@ -17,7 +20,35 @@ module ValidatedObject
|
|
17
20
|
def validated(*args, **kwargs, &block)
|
18
21
|
validates(*args, **kwargs, &block)
|
19
22
|
end
|
20
|
-
end
|
21
23
|
|
24
|
+
def validates_attr(attribute, *options, **kwargs)
|
25
|
+
attr_reader attribute
|
26
|
+
|
27
|
+
if kwargs[:type]
|
28
|
+
type_val = kwargs.delete(:type)
|
29
|
+
element_type = kwargs.delete(:element_type)
|
30
|
+
|
31
|
+
# Handle Union types - pass them through directly
|
32
|
+
if type_val.is_a?(ValidatedObject::Base::Union)
|
33
|
+
opts = { type: { with: type_val } }
|
34
|
+
validates attribute, opts.merge(kwargs)
|
35
|
+
# Parse Array[ElementType] syntax
|
36
|
+
elsif type_val.is_a?(Array) && type_val.length == 1 && type_val[0].is_a?(Class)
|
37
|
+
# This handles Array[Comment] syntax
|
38
|
+
element_type = type_val[0]
|
39
|
+
type_val = Array
|
40
|
+
opts = { type: { with: type_val } }
|
41
|
+
opts[:type][:element_type] = element_type if element_type
|
42
|
+
validates attribute, opts.merge(kwargs)
|
43
|
+
else
|
44
|
+
opts = { type: { with: type_val } }
|
45
|
+
opts[:type][:element_type] = element_type if element_type
|
46
|
+
validates attribute, opts.merge(kwargs)
|
47
|
+
end
|
48
|
+
else
|
49
|
+
validates attribute, *options, **kwargs
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
22
53
|
end
|
23
54
|
end
|
data/lib/validated_object.rb
CHANGED
@@ -1,12 +1,9 @@
|
|
1
|
-
# typed: true
|
2
1
|
# frozen_string_literal: true
|
3
2
|
|
4
3
|
require 'active_model'
|
5
|
-
require 'sorbet-runtime'
|
6
4
|
require 'validated_object/version'
|
7
5
|
require 'validated_object/simplified_api'
|
8
6
|
|
9
|
-
|
10
7
|
module ValidatedObject
|
11
8
|
# @abstract Subclass and add `attr_accessor` and validations
|
12
9
|
# to create custom validating objects.
|
@@ -46,11 +43,8 @@ module ValidatedObject
|
|
46
43
|
class Base
|
47
44
|
include ActiveModel::Validations
|
48
45
|
include SimplifiedApi
|
49
|
-
extend T::Sig
|
50
|
-
|
51
|
-
SymbolHash = T.type_alias { T::Hash[Symbol, T.untyped] }
|
52
46
|
|
53
|
-
EMPTY_HASH =
|
47
|
+
EMPTY_HASH = {}.freeze
|
54
48
|
|
55
49
|
# A private class definition, not intended to
|
56
50
|
# be used directly. Implements a pseudo-boolean class
|
@@ -60,21 +54,35 @@ module ValidatedObject
|
|
60
54
|
class Boolean
|
61
55
|
end
|
62
56
|
|
57
|
+
# A private class definition for union types.
|
58
|
+
# Stores multiple allowed types for validation.
|
59
|
+
# Created via ValidatedObject::Base.union(*types)
|
60
|
+
#
|
61
|
+
# @example
|
62
|
+
# validates :id, type: union(String, Integer)
|
63
|
+
# validates :data, type: union(Hash, [Hash])
|
64
|
+
class Union
|
65
|
+
attr_reader :types
|
66
|
+
|
67
|
+
def initialize(*types)
|
68
|
+
@types = types
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
63
72
|
# Instantiate and validate a new object.
|
64
73
|
# @example
|
65
74
|
# maru = Dog.new(birthday: Date.today, name: 'Maru')
|
66
75
|
#
|
67
76
|
# @raise [ArgumentError] if the object is not valid at the
|
68
77
|
# end of initialization or `attributes` is not a Hash.
|
69
|
-
sig { params(attributes: SymbolHash).void }
|
70
78
|
def initialize(attributes = EMPTY_HASH)
|
71
79
|
set_instance_variables from_hash: attributes
|
72
80
|
check_validations!
|
73
|
-
nil
|
74
81
|
end
|
75
82
|
|
76
83
|
def validated_attr(attribute_name, **validation_options)
|
77
84
|
attr_reader attribute_name
|
85
|
+
|
78
86
|
validates attribute_name, validation_options
|
79
87
|
end
|
80
88
|
|
@@ -82,7 +90,6 @@ module ValidatedObject
|
|
82
90
|
#
|
83
91
|
# @raise [ArgumentError] if any validations fail.
|
84
92
|
# @return [ValidatedObject::Base] the receiver
|
85
|
-
sig { returns(ValidatedObject::Base) }
|
86
93
|
def check_validations!
|
87
94
|
raise ArgumentError, errors.full_messages.join('; ') if invalid?
|
88
95
|
|
@@ -102,22 +109,30 @@ module ValidatedObject
|
|
102
109
|
# validates :neutered, type: Boolean, allow_nil: true # Typed but optional
|
103
110
|
# end
|
104
111
|
class TypeValidator < ActiveModel::EachValidator
|
105
|
-
extend T::Sig
|
106
|
-
|
107
112
|
# @return [nil]
|
108
|
-
sig do
|
109
|
-
params(
|
110
|
-
record: T.untyped,
|
111
|
-
attribute: T.untyped,
|
112
|
-
value: T.untyped
|
113
|
-
)
|
114
|
-
.void
|
115
|
-
end
|
116
113
|
def validate_each(record, attribute, value)
|
117
|
-
validation_options =
|
118
|
-
|
114
|
+
validation_options = options
|
119
115
|
expected_class = validation_options[:with]
|
120
116
|
|
117
|
+
# Support union types
|
118
|
+
if expected_class.is_a?(Union)
|
119
|
+
return if validate_union_type(record, attribute, value, expected_class, validation_options)
|
120
|
+
|
121
|
+
save_union_error(record, attribute, value, expected_class, validation_options)
|
122
|
+
return
|
123
|
+
end
|
124
|
+
|
125
|
+
# Support type: Array, element_type: ElementType
|
126
|
+
if expected_class == Array && validation_options[:element_type]
|
127
|
+
return save_error(record, attribute, value, validation_options) unless value.is_a?(Array)
|
128
|
+
|
129
|
+
element_type = validation_options[:element_type]
|
130
|
+
unless value.all? { |el| el.is_a?(element_type) }
|
131
|
+
record.errors.add attribute, validation_options[:message] || "contains non-#{element_type} elements"
|
132
|
+
end
|
133
|
+
return
|
134
|
+
end
|
135
|
+
|
121
136
|
return if pseudo_boolean?(expected_class, value) ||
|
122
137
|
expected_class?(expected_class, value)
|
123
138
|
|
@@ -126,34 +141,71 @@ module ValidatedObject
|
|
126
141
|
|
127
142
|
private
|
128
143
|
|
129
|
-
sig { params(expected_class: T.untyped, value: T.untyped).returns(T.untyped) }
|
130
144
|
def pseudo_boolean?(expected_class, value)
|
131
145
|
expected_class == Boolean && boolean?(value)
|
132
146
|
end
|
133
147
|
|
134
|
-
sig { params(expected_class: T.untyped, value: T.untyped).returns(T.untyped) }
|
135
148
|
def expected_class?(expected_class, value)
|
136
149
|
value.is_a?(expected_class)
|
137
150
|
end
|
138
151
|
|
139
|
-
sig { params(value: T.untyped).returns(T.untyped) }
|
140
152
|
def boolean?(value)
|
141
153
|
value.is_a?(TrueClass) || value.is_a?(FalseClass)
|
142
154
|
end
|
143
155
|
|
144
|
-
sig do
|
145
|
-
params(
|
146
|
-
record: T.untyped,
|
147
|
-
attribute: T.untyped,
|
148
|
-
value: T.untyped,
|
149
|
-
validation_options: SymbolHash
|
150
|
-
)
|
151
|
-
.void
|
152
|
-
end
|
153
156
|
def save_error(record, attribute, value, validation_options)
|
154
157
|
record.errors.add attribute,
|
155
158
|
validation_options[:message] || "is a #{value.class}, not a #{validation_options[:with]}"
|
156
159
|
end
|
160
|
+
|
161
|
+
def validate_union_type(_record, _attribute, value, union, _validation_options)
|
162
|
+
union.types.any? do |type_spec|
|
163
|
+
if type_spec.is_a?(Array) && type_spec.length == 1
|
164
|
+
# Handle [ElementType] syntax within union
|
165
|
+
validate_array_element_type(value, type_spec[0])
|
166
|
+
elsif type_spec.is_a?(Class) || type_spec == Boolean
|
167
|
+
# Handle class types (String, Integer, etc.) and pseudo-boolean
|
168
|
+
pseudo_boolean?(type_spec, value) || expected_class?(type_spec, value)
|
169
|
+
else
|
170
|
+
# Handle literal values (symbols, strings, numbers, etc.)
|
171
|
+
value == type_spec
|
172
|
+
end
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
def validate_array_element_type(value, element_type)
|
177
|
+
return false unless value.is_a?(Array)
|
178
|
+
|
179
|
+
value.all? { |el| el.is_a?(element_type) }
|
180
|
+
end
|
181
|
+
|
182
|
+
def save_union_error(record, attribute, value, union, validation_options)
|
183
|
+
return if validation_options[:message]
|
184
|
+
|
185
|
+
type_names = union.types.map do |type_spec|
|
186
|
+
if type_spec.is_a?(Array) && type_spec.length == 1
|
187
|
+
"Array of #{type_spec[0]}"
|
188
|
+
elsif type_spec.is_a?(Class) || type_spec == Boolean
|
189
|
+
type_spec.to_s
|
190
|
+
else
|
191
|
+
# For literal values like :active, show them as-is
|
192
|
+
type_spec.inspect
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
message = if type_names.length == 1
|
197
|
+
"is a #{value.class}, not one of #{type_names.first}"
|
198
|
+
else
|
199
|
+
"is a #{value.class}, not one of #{type_names.join(', ')}"
|
200
|
+
end
|
201
|
+
|
202
|
+
record.errors.add attribute, message
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
# Register the TypeValidator with ActiveModel so `type:` validation option works
|
207
|
+
unless ActiveModel::Validations.const_defined?(:TypeValidator)
|
208
|
+
ActiveModel::Validations.const_set(:TypeValidator, TypeValidator)
|
157
209
|
end
|
158
210
|
|
159
211
|
# Allow 'validated' as a synonym for 'validates'
|
@@ -161,10 +213,21 @@ module ValidatedObject
|
|
161
213
|
validates(*args, **kwargs, &block)
|
162
214
|
end
|
163
215
|
|
216
|
+
# Create a union type specification for validation
|
217
|
+
# @param types [Array] The types that are allowed
|
218
|
+
# @return [Union] A union type specification
|
219
|
+
# @example
|
220
|
+
# validates :id, type: union(String, Integer)
|
221
|
+
# validates :data, type: union(Hash, [Hash])
|
222
|
+
def self.union(*types)
|
223
|
+
Union.new(*types)
|
224
|
+
end
|
225
|
+
|
164
226
|
private
|
165
227
|
|
166
|
-
sig { params(from_hash: SymbolHash).void }
|
167
228
|
def set_instance_variables(from_hash:)
|
229
|
+
raise TypeError, "#{from_hash} is not a hash" unless from_hash.is_a?(Hash)
|
230
|
+
|
168
231
|
from_hash.each do |variable_name, variable_value|
|
169
232
|
# Test for the attribute reader
|
170
233
|
send variable_name.to_sym
|
data/script/demo.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
# typed: ignore
|
2
1
|
require 'date'
|
3
2
|
require 'validated_object'
|
4
3
|
|
5
4
|
class Dog < ValidatedObject::Base
|
6
5
|
attr_reader :name, :birthday
|
6
|
+
|
7
7
|
validates :name, presence: true
|
8
8
|
validates :birthday, type: Date, allow_nil: true
|
9
9
|
end
|
@@ -15,4 +15,4 @@ maru = Dog.new(birthday: Date.today, name: 'Maru')
|
|
15
15
|
puts maru.inspect
|
16
16
|
|
17
17
|
hiro = Dog.new(birthday: 'today')
|
18
|
-
puts hiro.inspect
|
18
|
+
puts hiro.inspect
|
data/validated_object.gemspec
CHANGED
@@ -19,11 +19,9 @@ Gem::Specification.new do |spec|
|
|
19
19
|
|
20
20
|
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
21
21
|
# delete this section to allow pushing this gem to any host.
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
|
26
|
-
end
|
22
|
+
raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.' unless spec.respond_to?(:metadata)
|
23
|
+
|
24
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
27
25
|
|
28
26
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
29
27
|
spec.bindir = 'exe'
|
@@ -32,8 +30,9 @@ Gem::Specification.new do |spec|
|
|
32
30
|
|
33
31
|
spec.add_development_dependency 'rake', '>= 12.3.3'
|
34
32
|
spec.add_development_dependency 'rspec', '>= 3.9.0'
|
35
|
-
spec.add_development_dependency '
|
33
|
+
spec.add_development_dependency 'rubocop', '>= 1.80.0'
|
34
|
+
spec.add_development_dependency 'rubocop-rake', '>= 0.0.0'
|
35
|
+
spec.add_development_dependency 'rubocop-rspec', '>= 0.0.0'
|
36
36
|
|
37
37
|
spec.add_runtime_dependency 'activemodel', '>= 3.2.21'
|
38
|
-
spec.add_runtime_dependency 'sorbet-runtime', '>= 0.5.5890'
|
39
38
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: validated_object
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robb Shecter
|
@@ -38,47 +38,61 @@ dependencies:
|
|
38
38
|
- !ruby/object:Gem::Version
|
39
39
|
version: 3.9.0
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
|
-
name:
|
41
|
+
name: rubocop
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
46
|
+
version: 1.80.0
|
47
47
|
type: :development
|
48
48
|
prerelease: false
|
49
49
|
version_requirements: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
53
|
+
version: 1.80.0
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
|
-
name:
|
55
|
+
name: rubocop-rake
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version:
|
61
|
-
type: :
|
60
|
+
version: 0.0.0
|
61
|
+
type: :development
|
62
62
|
prerelease: false
|
63
63
|
version_requirements: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
65
|
- - ">="
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version:
|
67
|
+
version: 0.0.0
|
68
68
|
- !ruby/object:Gem::Dependency
|
69
|
-
name:
|
69
|
+
name: rubocop-rspec
|
70
70
|
requirement: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - ">="
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: 0.
|
74
|
+
version: 0.0.0
|
75
|
+
type: :development
|
76
|
+
prerelease: false
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: 0.0.0
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: activemodel
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: 3.2.21
|
75
89
|
type: :runtime
|
76
90
|
prerelease: false
|
77
91
|
version_requirements: !ruby/object:Gem::Requirement
|
78
92
|
requirements:
|
79
93
|
- - ">="
|
80
94
|
- !ruby/object:Gem::Version
|
81
|
-
version:
|
95
|
+
version: 3.2.21
|
82
96
|
description: A small wrapper around ActiveModel Validations.
|
83
97
|
email:
|
84
98
|
- robb@public.law
|
@@ -89,7 +103,9 @@ files:
|
|
89
103
|
- ".github/workflows/ruby.yml"
|
90
104
|
- ".gitignore"
|
91
105
|
- ".rspec"
|
106
|
+
- ".rubocop.yml"
|
92
107
|
- ".travis.yml"
|
108
|
+
- CLAUDE.md
|
93
109
|
- Gemfile
|
94
110
|
- HISTORY.md
|
95
111
|
- LICENSE.txt
|
@@ -101,24 +117,6 @@ files:
|
|
101
117
|
- lib/validated_object/simplified_api.rb
|
102
118
|
- lib/validated_object/version.rb
|
103
119
|
- script/demo.rb
|
104
|
-
- sorbet/config
|
105
|
-
- sorbet/rbi/gems/activemodel.rbi
|
106
|
-
- sorbet/rbi/gems/activesupport.rbi
|
107
|
-
- sorbet/rbi/gems/concurrent-ruby.rbi
|
108
|
-
- sorbet/rbi/gems/i18n.rbi
|
109
|
-
- sorbet/rbi/gems/rake.rbi
|
110
|
-
- sorbet/rbi/gems/rspec-core.rbi
|
111
|
-
- sorbet/rbi/gems/rspec-expectations.rbi
|
112
|
-
- sorbet/rbi/gems/rspec-mocks.rbi
|
113
|
-
- sorbet/rbi/gems/rspec-support.rbi
|
114
|
-
- sorbet/rbi/gems/rspec.rbi
|
115
|
-
- sorbet/rbi/gems/site_ruby.rbi
|
116
|
-
- sorbet/rbi/gems/thread_safe.rbi
|
117
|
-
- sorbet/rbi/gems/tzinfo.rbi
|
118
|
-
- sorbet/rbi/sorbet-typed/lib/activemodel/all/activemodel.rbi
|
119
|
-
- sorbet/rbi/sorbet-typed/lib/activesupport/>=6/activesupport.rbi
|
120
|
-
- sorbet/rbi/sorbet-typed/lib/activesupport/all/activesupport.rbi
|
121
|
-
- sorbet/rbi/sorbet-typed/lib/minitest/all/minitest.rbi
|
122
120
|
- validated_object.gemspec
|
123
121
|
homepage: https://github.com/public-law/validated_object
|
124
122
|
licenses:
|
@@ -139,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
137
|
- !ruby/object:Gem::Version
|
140
138
|
version: '0'
|
141
139
|
requirements: []
|
142
|
-
rubygems_version: 3.
|
140
|
+
rubygems_version: 3.7.1
|
143
141
|
specification_version: 4
|
144
142
|
summary: Self-validating plain Ruby objects.
|
145
143
|
test_files: []
|
data/sorbet/config
DELETED