sorbet-runtime 0.5.11276 → 0.5.11282

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: 4dfb157871827b8c1b05a2fea04867db5359ee288fc8162ad9658245e205575f
4
- data.tar.gz: e406c1460b0636a35c04fee6e13382a8170441016e3184d4388ce69ea2c3c182
3
+ metadata.gz: 8f3dc44edaa916c8d1ebce5f42ad81c54ca802e8b11306c56a20ddc9bc9a1b6d
4
+ data.tar.gz: f7467f96884f376874ef2c9f537cebcd3e7bd2e111abcd44824e70f0c3cfb186
5
5
  SHA512:
6
- metadata.gz: 2aabe65d954cd5ba388eda9c1cfa05792d8bb868303e41f11d8645963bc87043be44c46d5ff133111d26711529fec1df71bd05722d3c261417a3037ed513f101
7
- data.tar.gz: ab9947c27d5c9a65339b04508232af270b18b93ee61b260ebf5cdddb5bf9b0ce38fe7b0b79c17334da8c94a72ad5c349abc9415f927092f43573df63be3c0871
6
+ metadata.gz: 18ae1906f6ef7dc08da2b4669701226ed46916f91c256710f971cfa8898c3979a425b5f31a74ff5b9a30869a36564827577f92134c0e0ddba7eb1ff8a530c0b4
7
+ data.tar.gz: 45513381a5a3692e27f7b000f612d3034b08e723e795acde0be811bbd7750e36394a8a43ba1b4c78460aeebdb5d22a406a8a55a97c8537b83e934788427918fe
@@ -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.11276
4
+ version: 0.5.11282
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-28 00:00:00.000000000 Z
11
+ date: 2024-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest