sorbet-runtime 0.6.13347 → 0.6.13354
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/lib/types/configuration.rb +0 -49
- data/lib/types/props/serializable.rb +3 -20
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1938d486d2226b40719917def21aa4eaf182b7dfbd82f19966b4090ecce26f43
|
|
4
|
+
data.tar.gz: 118531cfaf22868bb646a4df967f0ec6b9afcea5f44d83b3926f05600f6f98a1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6253b4f793cf92e4e407262309a4e4960fb6463e3614ff11b1eace47cae30f4dcb5c8f73359846f92c6c685148b2ecd3eb31d5ef9716880226d81ec529412b35
|
|
7
|
+
data.tar.gz: 530aba99e7c885045dac5682d3dacbf1c22f0b12e285716328babad62c82216ea3ced97390069a322565f42fe196e7308c3d9719d58da69ae16d5b0eac33e0e9
|
data/lib/types/configuration.rb
CHANGED
|
@@ -337,41 +337,6 @@ module T::Configuration
|
|
|
337
337
|
end
|
|
338
338
|
end
|
|
339
339
|
|
|
340
|
-
@hard_assert_handler = nil
|
|
341
|
-
# Set a handler for hard assertions
|
|
342
|
-
#
|
|
343
|
-
# These generally should stop execution of the program, and optionally inform
|
|
344
|
-
# some party of the assertion.
|
|
345
|
-
#
|
|
346
|
-
# @param [Lambda, Proc, Object, nil] value Proc that handles the error
|
|
347
|
-
# report (pass nil to reset to default behavior)
|
|
348
|
-
#
|
|
349
|
-
# Parameters passed to value.call:
|
|
350
|
-
#
|
|
351
|
-
# @param [String] str Assertion message
|
|
352
|
-
# @param [Hash] extra A hash containing additional parameters to be passed along to the handler.
|
|
353
|
-
#
|
|
354
|
-
# @example
|
|
355
|
-
# T::Configuration.hard_assert_handler = lambda do |str, extra|
|
|
356
|
-
# raise "#{str}, context: #{extra}"
|
|
357
|
-
# end
|
|
358
|
-
def self.hard_assert_handler=(value)
|
|
359
|
-
validate_lambda_given!(value)
|
|
360
|
-
@hard_assert_handler = value
|
|
361
|
-
end
|
|
362
|
-
|
|
363
|
-
private_class_method def self.hard_assert_handler_default(str, _)
|
|
364
|
-
raise str
|
|
365
|
-
end
|
|
366
|
-
|
|
367
|
-
def self.hard_assert_handler(str, extra={})
|
|
368
|
-
if @hard_assert_handler
|
|
369
|
-
@hard_assert_handler.call(str, extra)
|
|
370
|
-
else
|
|
371
|
-
hard_assert_handler_default(str, extra)
|
|
372
|
-
end
|
|
373
|
-
end
|
|
374
|
-
|
|
375
340
|
@scalar_types = nil
|
|
376
341
|
# Set a list of class strings that are to be considered scalar.
|
|
377
342
|
# (pass nil to reset to default behavior)
|
|
@@ -461,20 +426,6 @@ module T::Configuration
|
|
|
461
426
|
@redaction_handler
|
|
462
427
|
end
|
|
463
428
|
|
|
464
|
-
@class_owner_finder = nil
|
|
465
|
-
# Set to a function which can get the 'owner' of a class. This is
|
|
466
|
-
# used in reporting deserialization errors
|
|
467
|
-
#
|
|
468
|
-
# @param [Lambda, Proc, nil] handler Proc that takes a class and
|
|
469
|
-
# produces its owner, or `nil` if it does not have one.
|
|
470
|
-
def self.class_owner_finder=(handler)
|
|
471
|
-
@class_owner_finder = handler
|
|
472
|
-
end
|
|
473
|
-
|
|
474
|
-
def self.class_owner_finder
|
|
475
|
-
@class_owner_finder
|
|
476
|
-
end
|
|
477
|
-
|
|
478
429
|
# Temporarily disable ruby warnings while executing the given block. This is
|
|
479
430
|
# useful when doing something that would normally cause a warning to be
|
|
480
431
|
# emitted in Ruby verbose mode ($VERBOSE = true).
|
|
@@ -269,26 +269,9 @@ module T::Props::Serializable::DecoratorMethods
|
|
|
269
269
|
end
|
|
270
270
|
|
|
271
271
|
def raise_nil_deserialize_error(hkey)
|
|
272
|
-
|
|
273
|
-
"
|
|
274
|
-
"
|
|
275
|
-
"for more details). If this is already the case, you probably "\
|
|
276
|
-
"omitted a required prop from the `fields:` option when doing a "\
|
|
277
|
-
"partial load."
|
|
278
|
-
storytime = {prop: hkey, klass: decorated_class.name}
|
|
279
|
-
|
|
280
|
-
# Notify the model owner if it exists, and always notify the API owner.
|
|
281
|
-
begin
|
|
282
|
-
if T::Configuration.class_owner_finder && (owner = T::Configuration.class_owner_finder.call(decorated_class))
|
|
283
|
-
T::Configuration.hard_assert_handler(
|
|
284
|
-
msg,
|
|
285
|
-
storytime: storytime,
|
|
286
|
-
project: owner
|
|
287
|
-
)
|
|
288
|
-
end
|
|
289
|
-
ensure
|
|
290
|
-
T::Configuration.hard_assert_handler(msg, storytime: storytime)
|
|
291
|
-
end
|
|
272
|
+
raise "Tried to deserialize a required prop from a nil value. " \
|
|
273
|
+
"You should provide a `default: or factory:` for this prop. " \
|
|
274
|
+
"prop=#{hkey} klass=#{decorated_class.name}"
|
|
292
275
|
end
|
|
293
276
|
|
|
294
277
|
def prop_validate_definition!(name, cls, rules, type)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sorbet-runtime
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.13354
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stripe
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-07-
|
|
11
|
+
date: 2026-07-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: benchmark
|