sorbet-runtime 0.5.5924 → 0.5.5937

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: aae0b67bb5b3929ed87ead6de676f5611436fc2381a0f917adee1ab6a4ff9ef7
4
- data.tar.gz: 1de28d9620fe28cbb9fb05afd81c5026d6e428f051868c03476fc213c2e3ad36
3
+ metadata.gz: 5454eb320d7222eb9238c489de4b21bc5ecc39b2b86a6ff6c750f5e22a571b16
4
+ data.tar.gz: d75c5a1bfcf183e70bfe15129f08a66ecc3edf7faca88647e007ff91581c940c
5
5
  SHA512:
6
- metadata.gz: e8611e148a7b0174f36b67a108cfa1196403f3fc9a2ac368ebdc1ca73c359322f2da997b6542e5df6aea91ad1ddeed555262c43a9490e0230d0b42327d13af2f
7
- data.tar.gz: 158f321cdae1e59774565b9c52072072a36cdd42bfe58109b203147b4fe1e7c68381dca5f56e67dac0c1016d6936c6e24ddf6b9bf8261ee8fe3f65e24b6b73fc
6
+ metadata.gz: d48a6f79d0e445ee25e57e031cc3c24ff39e7b3a85d0d2930226d2f5090d66a006fec347425fd528fda5c9323fe0d7384340b131d06eca45a3914de19a2b8f52
7
+ data.tar.gz: e29d640cc39e122b5cf2ee5f9ccbb6266db58e148d72e9d09310fd70846756b159cb741393e6444527e2eb4987fca149acef2a040618644d5450f6cbb8246b41
@@ -57,6 +57,17 @@ class T::Enum
57
57
  @values
58
58
  end
59
59
 
60
+ # This exists for compatibility with the interface of `Hash` & mostly to support
61
+ # the HashEachMethods Rubocop.
62
+ sig {params(blk: T.nilable(T.proc.params(arg0: T.attached_class).void)).returns(T.any(T::Enumerator[T.attached_class], T::Array[T.attached_class]))}
63
+ def self.each_value(&blk)
64
+ if blk
65
+ values.each(&blk)
66
+ else
67
+ values.each
68
+ end
69
+ end
70
+
60
71
  # Convert from serialized value to enum instance
61
72
  #
62
73
  # Note: It would have been nice to make this method final before people started overriding it.
@@ -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.5924
4
+ version: 0.5.5937
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-29 00:00:00.000000000 Z
11
+ date: 2020-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest