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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 80d86feff2d97f3117a87bbbae84bf02d3ae12920f0c32a5d467f2c3d6553704
4
- data.tar.gz: 78ce63cc220673005ccdb2dd3c2343dbf06f1a870a2d7c90b0980ee131566dba
3
+ metadata.gz: 2f78eb2d24250f5eb1bc4a801420e2da6c6b74b19fda4e224f9fb8d9cdf42519
4
+ data.tar.gz: b87974528c14420bea219e5f49354b479aa7316e4ed5612b35ecd43aa1c6410c
5
5
  SHA512:
6
- metadata.gz: d94e4823882911b50e6ef57c55228a85a1e13ad1579b80b009338349b13aad7765ad2d6a3a568d95579aebf9973b6decdcff053c179f963d26b6c83c77c5c9ec
7
- data.tar.gz: 823a78ef822be64c9793bd5a71fd98ce59c498e03543781dc0e7e37ac24ede2820528d1135797608b97e6fa28df883459bd936420b9f374ed5359e88ee61f55d
6
+ metadata.gz: 5c0b1f68146d4fe7c9eb3bea296f9c485b9646453cde5ede3cda15cfebd0e260b25623422aa4d613c705221f57b17429925632831643054e6a5112a81d71ad1e
7
+ data.tar.gz: 19d9ea0ade0208562dd8e23180c1ff601844014f8613b1cc6e8396f0435157c4b2de1dd96d92b81658437247b50734488c1766c4e27eb8533aa40908f0527e35
data/lib/types/_types.rb CHANGED
@@ -53,7 +53,8 @@ module T
53
53
  end
54
54
 
55
55
  # Matches any of the listed values
56
- def self.enum(values)
56
+ # @deprecated Use T::Enum instead.
57
+ def self.deprecated_enum(values)
57
58
  T::Types::Enum.new(values)
58
59
  end
59
60
 
@@ -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
- # TODO(gdritter): this might not be want we want in a multipackage
20
- # world; revisit this implementation we move on from the monopackage
21
- if stripe_packages_enabled?
22
- klass = "PkgRegistry::#{package}::#{klass}"
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.enum(enum)))
409
+ T.nilable(T.all(nonnil_type, T.deprecated_enum(enum)))
410
410
  else
411
- T.all(type, T.enum(enum))
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.enum(SomeEnum::FOO))` and we should treat it
143
- # like String or SomeEnum even if we don't know what to do with
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
@@ -31,7 +31,7 @@ module T::Types
31
31
 
32
32
  # overrides Base
33
33
  def name
34
- "T.enum([#{@values.map(&:inspect).join(', ')}])"
34
+ "T.deprecated_enum([#{@values.map(&:inspect).join(', ')}])"
35
35
  end
36
36
 
37
37
  # overrides Base
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.enum")
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.9222
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-12 00:00:00.000000000 Z
11
+ date: 2021-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest