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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2804e93c849ae225b0e969c926e6d45598d046cba32597de495fbbf2c9403e05
4
- data.tar.gz: c05a05390f42cc2ccb023fa5cd162544e6797acfdf7e5166169389e018d2ac91
3
+ metadata.gz: ca90775e4837946637599b38d56387f984dd670ccf40b10b4e99c5ac83f6bb51
4
+ data.tar.gz: 571a777f61bc5e01529ce32b3b4fe7f38a224b36f0aff511b569beec9b68d28d
5
5
  SHA512:
6
- metadata.gz: 64b8c9f6c3178a37403f53e8117f417fa3de6f9ec867fc32abf11693e9a547effedce3602325518d539a27e342670ceaf2a6bd52096c69f8c082a819f838d177
7
- data.tar.gz: 948b563c632f8f599035ff93a17f779c1c18ecf002c484bfda3667874f83a41408ae3c5434d8122dc8f7cf085cf948f271ecd598219fb4e7b93eea5e8e174c55
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,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sorbet-schema (0.9.0)
4
+ sorbet-schema (0.9.1)
5
5
  sorbet-result (~> 1.1)
6
6
  sorbet-runtime (~> 0.5)
7
7
  sorbet-struct-comparable (~> 1.3)
@@ -1,18 +1,12 @@
1
- # typed: strict
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
@@ -1,5 +1,5 @@
1
1
  # typed: strict
2
2
 
3
3
  module SorbetSchema
4
- VERSION = "0.9.0"
4
+ VERSION = "0.9.1"
5
5
  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.0
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-05 00:00:00.000000000 Z
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
  - - ">="