sorbet-schema 0.9.0 → 0.9.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 +7 -0
- data/Gemfile.lock +1 -1
- data/lib/sorbet-schema/t/struct.rb +2 -10
- data/lib/sorbet-schema/version.rb +1 -1
- data/rbi/sorbet-schema.rbi +21 -0
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ca90775e4837946637599b38d56387f984dd670ccf40b10b4e99c5ac83f6bb51
|
|
4
|
+
data.tar.gz: 571a777f61bc5e01529ce32b3b4fe7f38a224b36f0aff511b569beec9b68d28d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cc598d7b96ca9afed3c662b8cbd2473e5c49254b55249439efe3d4407088dca7f12ad683d010d05af17db95dbac7afaa8994066d54d5032db0ed1f811e6cdc41
|
|
7
|
+
data.tar.gz: e01498f7da67da3f49114775c22b799d93630d6205ca95ff5197e11b21bb55069c67a01f007f0e7e609c7f2848ef3f783e3cdb2afd9d9a0901bb7fab63430c8a
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [0.9.1](https://github.com/maxveldink/sorbet-schema/compare/v0.9.0...v0.9.1) (2024-08-14)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* add sorbet-schema shim for better T:Struct extension compatability ([#123](https://github.com/maxveldink/sorbet-schema/issues/123)) ([b47cafb](https://github.com/maxveldink/sorbet-schema/commit/b47cafb9820141c7e8e7759e3a561f23bc01f9aa))
|
|
13
|
+
|
|
7
14
|
## [0.9.0](https://github.com/maxveldink/sorbet-schema/compare/v0.8.0...v0.9.0) (2024-08-05)
|
|
8
15
|
|
|
9
16
|
|
data/Gemfile.lock
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
# typed:
|
|
1
|
+
# typed: true
|
|
2
2
|
|
|
3
3
|
module T
|
|
4
4
|
class Struct
|
|
5
|
-
extend T::Sig
|
|
6
|
-
|
|
7
5
|
class << self
|
|
8
|
-
extend T::Sig
|
|
9
|
-
|
|
10
|
-
sig { overridable.returns(Typed::Schema) }
|
|
11
6
|
def schema
|
|
12
7
|
Typed::Schema.from_struct(self)
|
|
13
8
|
end
|
|
14
9
|
|
|
15
|
-
sig { params(type: Symbol, options: T::Hash[Symbol, T.untyped]).returns(Typed::Serializer[T.untyped, T.untyped]) }
|
|
16
10
|
def serializer(type, options: {})
|
|
17
11
|
case type
|
|
18
12
|
when :hash
|
|
@@ -24,13 +18,11 @@ module T
|
|
|
24
18
|
end
|
|
25
19
|
end
|
|
26
20
|
|
|
27
|
-
sig { params(serializer_type: Symbol, source: T.untyped, options: T::Hash[Symbol, T.untyped]).returns(Typed::Serializer::DeserializeResult) }
|
|
28
21
|
def deserialize_from(serializer_type, source, options: {})
|
|
29
|
-
serializer(serializer_type, options:).deserialize(source)
|
|
22
|
+
T.unsafe(serializer(serializer_type, options:).deserialize(source))
|
|
30
23
|
end
|
|
31
24
|
end
|
|
32
25
|
|
|
33
|
-
sig { params(serializer_type: Symbol, options: T::Hash[Symbol, T.untyped]).returns(Typed::Result[T.untyped, Typed::SerializeError]) }
|
|
34
26
|
def serialize_to(serializer_type, options: {})
|
|
35
27
|
self.class.serializer(serializer_type, options:).serialize(self)
|
|
36
28
|
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# typed: strict
|
|
2
|
+
|
|
3
|
+
class T::Struct
|
|
4
|
+
class << self
|
|
5
|
+
sig { overridable.returns(Typed::Schema) }
|
|
6
|
+
def schema
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
sig { params(type: Symbol, options: T::Hash[Symbol, T.untyped]).returns(Typed::Serializer[T.untyped, T.untyped]) }
|
|
10
|
+
def serializer(type, options: {})
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
sig { params(serializer_type: Symbol, source: T.untyped, options: T::Hash[Symbol, T.untyped]).returns(Typed::Result[T.attached_class, Typed::DeserializeError]) }
|
|
14
|
+
def deserialize_from(serializer_type, source, options: {})
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
sig { params(serializer_type: Symbol, options: T::Hash[Symbol, T.untyped]).returns(Typed::Result[T.untyped, Typed::SerializeError]) }
|
|
19
|
+
def serialize_to(serializer_type, options: {})
|
|
20
|
+
end
|
|
21
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sorbet-schema
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.9.
|
|
4
|
+
version: 0.9.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Max VelDink
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-08-
|
|
11
|
+
date: 2024-08-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: sorbet-result
|
|
@@ -121,6 +121,7 @@ files:
|
|
|
121
121
|
- lib/typed/validations/validated_value.rb
|
|
122
122
|
- lib/typed/validations/validation_error.rb
|
|
123
123
|
- lib/typed/validations/validation_results.rb
|
|
124
|
+
- rbi/sorbet-schema.rbi
|
|
124
125
|
- release-please-config.json
|
|
125
126
|
- release-please-manifest.json
|
|
126
127
|
- sorbet/config
|
|
@@ -182,6 +183,7 @@ post_install_message:
|
|
|
182
183
|
rdoc_options: []
|
|
183
184
|
require_paths:
|
|
184
185
|
- lib
|
|
186
|
+
- rbi
|
|
185
187
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
186
188
|
requirements:
|
|
187
189
|
- - ">="
|