sorbet-runtime 0.5.5923 → 0.5.5935
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 +9 -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: 65574adf5815ae5f4d9b1b84bc57b3d5c03a20158899092080d84046c272d3f1
|
4
|
+
data.tar.gz: 9d9a18876e1ff249786972959ee4dab6a3e5c3eb638c7d8686315429d0b60c38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b955633f3066864c897bb67ef74bc27fc7eef5b85e1af5447c50ca522fd4f4d7e01a7f7b3f872768ff0707a59af97f1fd396d81fc3a72cc82abc24e512309d4
|
7
|
+
data.tar.gz: f03bb89469daf5e53d89343eb05274427582f39620f0ae90e24a50264a314caeb13e2ff1de1584772875ab6860186fe8990b007df8f562a28f6b1984181068cd
|
@@ -4,8 +4,11 @@
|
|
4
4
|
module T::NonForcingConstants
|
5
5
|
# NOTE: This method is documented on the RBI in Sorbet's payload, so that it
|
6
6
|
# shows up in the hover/completion documentation via LSP.
|
7
|
-
T::Sig::WithoutRuntime.sig {params(val: BasicObject, klass: String).returns(T::Boolean)}
|
8
|
-
def self.non_forcing_is_a?(val, klass)
|
7
|
+
T::Sig::WithoutRuntime.sig {params(val: BasicObject, klass: String, package: T.nilable(String)).returns(T::Boolean)}
|
8
|
+
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.
|
9
12
|
method_name = "T::NonForcingConstants.non_forcing_is_a?"
|
10
13
|
if klass.empty?
|
11
14
|
raise ArgumentError.new("The string given to `#{method_name}` must not be empty")
|
@@ -18,7 +21,10 @@ module T::NonForcingConstants
|
|
18
21
|
parts.each do |part|
|
19
22
|
if current_klass.nil?
|
20
23
|
# First iteration
|
21
|
-
if part != ""
|
24
|
+
if part != "" && package.nil?
|
25
|
+
# if we've supplied a package, we're probably running in
|
26
|
+
# package mode, which means absolute references are
|
27
|
+
# meaningless
|
22
28
|
raise ArgumentError.new("The string given to `#{method_name}` must be an absolute constant reference that starts with `::`")
|
23
29
|
end
|
24
30
|
|
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.5935
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|