sorbet-runtime 0.5.11279 → 0.5.11284

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: e32785464719386a3e5be9aa05279ad8cb28a9fd3bac6d207c448f1db48e75a3
4
- data.tar.gz: 6b3baa936054a0e5e8bdd731ead9ead595d51486a08f2b4283c9a77b55580005
3
+ metadata.gz: 2deda57643f57884b85d8c0544ed76bd19a245fff3f0b8f1b8cd2a08aa0de3b2
4
+ data.tar.gz: 35c1bf1463274877ee9f28c74aa5f3819d8c933b9a66fc435335759da46bd50f
5
5
  SHA512:
6
- metadata.gz: 4e0f058b268639d3ded476f5b80738321a95655ac6be5bb4e1915708d9421c365d0b9aadc3711ba3d20aa62369daa574a270cc50f49b734549e2c9628768f88a
7
- data.tar.gz: 54341ccebbe77e37811cd9ed2d81807872145fea29cd423394d03449bbfe749de71c8f5cc97270b2aefcafce9e6f16546511e8d3b4e1f3b8bafa936b1e8f292b
6
+ metadata.gz: 6187bf3923ede05c40383d8e03f333d6fbc0ba1581eef0583fadd109d80036bbe89f0efe88705e408a9e72a077b3a499395da921483f6a57445f9c0547edf633
7
+ data.tar.gz: 958ab206494917fe9d25ed35ae9cb182f8968ebf911f80a91ab11d77c47a64f875605355c9a3861e01996b988506ed8438b902dca4c87b3293355bb27ff8500d
@@ -4,20 +4,13 @@
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, package: T.nilable(String)).returns(T::Boolean)}
8
- def self.non_forcing_is_a?(val, klass, package: nil)
7
+ T::Sig::WithoutRuntime.sig {params(val: BasicObject, klass: String).returns(T::Boolean)}
8
+ def self.non_forcing_is_a?(val, klass)
9
9
  method_name = "T::NonForcingConstants.non_forcing_is_a?"
10
10
  if klass.empty?
11
11
  raise ArgumentError.new("The string given to `#{method_name}` must not be empty")
12
12
  end
13
13
 
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}"
19
- end
20
-
21
14
  current_klass = T.let(nil, T.nilable(Module))
22
15
  current_prefix = T.let(nil, T.nilable(String))
23
16
 
@@ -25,10 +18,7 @@ module T::NonForcingConstants
25
18
  parts.each do |part|
26
19
  if current_klass.nil?
27
20
  # First iteration
28
- if part != "" && package.nil?
29
- # if we've supplied a package, we're probably running in
30
- # package mode, which means absolute references are
31
- # meaningless
21
+ if part != ""
32
22
  raise ArgumentError.new("The string given to `#{method_name}` must be an absolute constant reference that starts with `::`")
33
23
  end
34
24
 
@@ -37,7 +27,7 @@ module T::NonForcingConstants
37
27
 
38
28
  # if this had a :: prefix, then there's no more loading to
39
29
  # do---skip to the next one
40
- next if part == ""
30
+ next
41
31
  end
42
32
 
43
33
  if current_klass.autoload?(part)
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.11279
4
+ version: 0.5.11284
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-29 00:00:00.000000000 Z
11
+ date: 2024-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest