sorbet-runtime 0.5.9222 → 0.5.9242
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/_types.rb +2 -1
- data/lib/types/non_forcing_constants.rb +5 -9
- data/lib/types/props/decorator.rb +2 -2
- data/lib/types/props/private/serde_transform.rb +3 -3
- data/lib/types/types/enum.rb +1 -1
- data/lib/types/utils.rb +1 -1
- 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: 2f78eb2d24250f5eb1bc4a801420e2da6c6b74b19fda4e224f9fb8d9cdf42519
|
4
|
+
data.tar.gz: b87974528c14420bea219e5f49354b479aa7316e4ed5612b35ecd43aa1c6410c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c0b1f68146d4fe7c9eb3bea296f9c485b9646453cde5ede3cda15cfebd0e260b25623422aa4d613c705221f57b17429925632831643054e6a5112a81d71ad1e
|
7
|
+
data.tar.gz: 19d9ea0ade0208562dd8e23180c1ff601844014f8613b1cc6e8396f0435157c4b2de1dd96d92b81658437247b50734488c1766c4e27eb8533aa40908f0527e35
|
data/lib/types/_types.rb
CHANGED
@@ -2,11 +2,6 @@
|
|
2
2
|
# typed: strict
|
3
3
|
|
4
4
|
module T::NonForcingConstants
|
5
|
-
T::Sig::WithoutRuntime.sig {returns(T::Boolean)}
|
6
|
-
private_class_method def self.stripe_packages_enabled?
|
7
|
-
const_defined?('StripePackages') && const_get('StripePackages').enabled?
|
8
|
-
end
|
9
|
-
|
10
5
|
# NOTE: This method is documented on the RBI in Sorbet's payload, so that it
|
11
6
|
# shows up in the hover/completion documentation via LSP.
|
12
7
|
T::Sig::WithoutRuntime.sig {params(val: BasicObject, klass: String, package: T.nilable(String)).returns(T::Boolean)}
|
@@ -16,10 +11,11 @@ module T::NonForcingConstants
|
|
16
11
|
raise ArgumentError.new("The string given to `#{method_name}` must not be empty")
|
17
12
|
end
|
18
13
|
|
19
|
-
#
|
20
|
-
#
|
21
|
-
|
22
|
-
|
14
|
+
# We don't treat packages differently at runtime, but the static
|
15
|
+
# type-checker still needs to have the package and constant
|
16
|
+
# separated out. This just re-assembles the string as needed
|
17
|
+
if !package.nil?
|
18
|
+
klass = "::#{package}::#{klass}"
|
23
19
|
end
|
24
20
|
|
25
21
|
current_klass = T.let(nil, T.nilable(Module))
|
@@ -406,9 +406,9 @@ class T::Props::Decorator
|
|
406
406
|
else
|
407
407
|
nonnil_type = T::Utils.unwrap_nilable(type)
|
408
408
|
if nonnil_type
|
409
|
-
T.nilable(T.all(nonnil_type, T.
|
409
|
+
T.nilable(T.all(nonnil_type, T.deprecated_enum(enum)))
|
410
410
|
else
|
411
|
-
T.all(type, T.
|
411
|
+
T.all(type, T.deprecated_enum(enum))
|
412
412
|
end
|
413
413
|
end
|
414
414
|
end
|
@@ -139,9 +139,9 @@ module T::Props
|
|
139
139
|
dynamic_fallback
|
140
140
|
else
|
141
141
|
# This is probably something like `T.all(String, SomeMarker)` or
|
142
|
-
# `T.all(SomeEnum, T.
|
143
|
-
# like String or SomeEnum even if we don't know what to do
|
144
|
-
# the rest of the type.
|
142
|
+
# `T.all(SomeEnum, T.deprecated_enum(SomeEnum::FOO))` and we should
|
143
|
+
# treat it like String or SomeEnum even if we don't know what to do
|
144
|
+
# with the rest of the type.
|
145
145
|
inner_known.first
|
146
146
|
end
|
147
147
|
when T::Types::Enum
|
data/lib/types/types/enum.rb
CHANGED
data/lib/types/utils.rb
CHANGED
@@ -145,7 +145,7 @@ module T::Utils
|
|
145
145
|
|
146
146
|
def self.lift_enum(enum)
|
147
147
|
unless enum.is_a?(T::Types::Enum)
|
148
|
-
raise ArgumentError.new("#{enum.inspect} is not a T.
|
148
|
+
raise ArgumentError.new("#{enum.inspect} is not a T.deprecated_enum")
|
149
149
|
end
|
150
150
|
|
151
151
|
classes = enum.values.map(&:class).uniq
|
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.5.
|
4
|
+
version: 0.5.9242
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|