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 +4 -4
- data/lib/types/non_forcing_constants.rb +11 -3
- 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: 128e0eaa77e3d2059287e0f6b3043def77793175dee927957303a0ec73f030eb
|
4
|
+
data.tar.gz: 578279c64cf9fac63c720871c1b1c325c0f6dfb0b2ada27ec26757953b24eb6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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-
|
11
|
+
date: 2021-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|