sorbet-runtime 0.5.6300 → 0.5.6303

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 42bb5dc2bac9a729a674f1acc718f65bf21569a3f30059eb6e70bb708c399f09
4
- data.tar.gz: 5ca2ad1aebe9b9c25ec2f74c316b6bc5dfb28a0432046dbb475055143545237f
3
+ metadata.gz: 128e0eaa77e3d2059287e0f6b3043def77793175dee927957303a0ec73f030eb
4
+ data.tar.gz: 578279c64cf9fac63c720871c1b1c325c0f6dfb0b2ada27ec26757953b24eb6d
5
5
  SHA512:
6
- metadata.gz: ca04cc3d6a2aec318c0ce4f131ddba85a5c024846f8daf82733a6c291afa15a89516413e8842085e0720b95a96cd717b853664cdbbb69a01923353b1a24d9e1c
7
- data.tar.gz: a1406ca1482a4d5db675e6294061518e787bb45f30fee18ca89cf4d47c1c49c1583cc0dde4c060500a8118a5c3bf96677dd2096466bd4f187ab4bdbfdb543c39
6
+ metadata.gz: 2436330c01d899e7e7cacedbe5bfb337f1ada71219e1c1a670f11452dbefc12aa2b4f0554fd2a39167b448d4c36297693b75c2a0ecf3c5f8e1cd1022f56f4138
7
+ data.tar.gz: 7c3929b40f9cafb2d1a25cf6585284df7752e862e5043fe4dda228220376e6dd63024ed8f48c0f9a7630b778cef9cae5e77d66b4e926715d8ca4a4f438917623
@@ -2,18 +2,26 @@
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
+
5
10
  # NOTE: This method is documented on the RBI in Sorbet's payload, so that it
6
11
  # shows up in the hover/completion documentation via LSP.
7
12
  T::Sig::WithoutRuntime.sig {params(val: BasicObject, klass: String, package: T.nilable(String)).returns(T::Boolean)}
8
13
  def self.non_forcing_is_a?(val, klass, package: nil)
9
- # TODO(gdritter): once we have a runtime implementation of
10
- # packages, we'll need to actually handle the `package` argument
11
- # here.
12
14
  method_name = "T::NonForcingConstants.non_forcing_is_a?"
13
15
  if klass.empty?
14
16
  raise ArgumentError.new("The string given to `#{method_name}` must not be empty")
15
17
  end
16
18
 
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}"
23
+ end
24
+
17
25
  current_klass = T.let(nil, T.nilable(Module))
18
26
  current_prefix = T.let(nil, T.nilable(String))
19
27
 
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.6300
4
+ version: 0.5.6303
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-24 00:00:00.000000000 Z
11
+ date: 2021-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest