sorbet-runtime 0.5.10600 → 0.5.10607
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sorbet-runtime.rb +1 -0
- data/lib/types/_types.rb +10 -0
- data/lib/types/types/typed_enumerable.rb +5 -0
- data/lib/types/types/typed_enumerator_chain.rb +41 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c81e8f2b45d764b95ea4d57594ae978c725f95e155b93ab9b7bfbda13c09372
|
4
|
+
data.tar.gz: 6de6380311aea02b00a0ddacd9ddfb1b5d7c432de366e61ed12b4191c3f40a91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19868caac696c2b23b9764869c07ec800b70e911c04b02eef058d66ec06c914fb7d75b97d9318736be725dd526e6da5a846bc60517abd4ab05d2348b10b33044
|
7
|
+
data.tar.gz: 95cd398249a3d5dd840afce4b2efb57e697c1e865e81a7bc26fec061cacf37d5e8b488680f4af64de9324d6c75ca778ce58c3eb2ac32618bfd8928c0cc744094
|
data/lib/sorbet-runtime.rb
CHANGED
@@ -45,6 +45,7 @@ require_relative 'types/types/t_enum'
|
|
45
45
|
require_relative 'types/types/type_parameter'
|
46
46
|
require_relative 'types/types/typed_array'
|
47
47
|
require_relative 'types/types/typed_enumerator'
|
48
|
+
require_relative 'types/types/typed_enumerator_chain'
|
48
49
|
require_relative 'types/types/typed_enumerator_lazy'
|
49
50
|
require_relative 'types/types/typed_hash'
|
50
51
|
require_relative 'types/types/typed_range'
|
data/lib/types/_types.rb
CHANGED
@@ -324,6 +324,16 @@ module T
|
|
324
324
|
end
|
325
325
|
end
|
326
326
|
end
|
327
|
+
|
328
|
+
module Chain
|
329
|
+
def self.[](type)
|
330
|
+
if type.is_a?(T::Types::Untyped)
|
331
|
+
T::Types::TypedEnumeratorChain::Untyped.new
|
332
|
+
else
|
333
|
+
T::Types::TypedEnumeratorChain.new(type)
|
334
|
+
end
|
335
|
+
end
|
336
|
+
end
|
327
337
|
end
|
328
338
|
|
329
339
|
module Range
|
@@ -54,6 +54,9 @@ module T::Types
|
|
54
54
|
when Enumerator::Lazy
|
55
55
|
# Enumerators can be unbounded: see `[:foo, :bar].cycle`
|
56
56
|
true
|
57
|
+
when Enumerator::Chain
|
58
|
+
# Enumerators can be unbounded: see `[:foo, :bar].cycle`
|
59
|
+
true
|
57
60
|
when Enumerator
|
58
61
|
# Enumerators can be unbounded: see `[:foo, :bar].cycle`
|
59
62
|
true
|
@@ -145,6 +148,8 @@ module T::Types
|
|
145
148
|
end
|
146
149
|
when Enumerator::Lazy
|
147
150
|
T::Enumerator::Lazy[type_from_instances(obj)]
|
151
|
+
when Enumerator::Chain
|
152
|
+
T::Enumerator::Chain[type_from_instances(obj)]
|
148
153
|
when Enumerator
|
149
154
|
T::Enumerator[type_from_instances(obj)]
|
150
155
|
when Set
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# typed: true
|
3
|
+
|
4
|
+
module T::Types
|
5
|
+
class TypedEnumeratorChain < TypedEnumerable
|
6
|
+
attr_reader :type
|
7
|
+
|
8
|
+
def underlying_class
|
9
|
+
Enumerator::Chain
|
10
|
+
end
|
11
|
+
|
12
|
+
# overrides Base
|
13
|
+
def name
|
14
|
+
"T::Enumerator::Chain[#{@type.name}]"
|
15
|
+
end
|
16
|
+
|
17
|
+
# overrides Base
|
18
|
+
def recursively_valid?(obj)
|
19
|
+
obj.is_a?(Enumerator::Chain) && super
|
20
|
+
end
|
21
|
+
|
22
|
+
# overrides Base
|
23
|
+
def valid?(obj)
|
24
|
+
obj.is_a?(Enumerator::Chain)
|
25
|
+
end
|
26
|
+
|
27
|
+
def new(*args, &blk)
|
28
|
+
T.unsafe(Enumerator::Chain).new(*args, &blk)
|
29
|
+
end
|
30
|
+
|
31
|
+
class Untyped < TypedEnumeratorChain
|
32
|
+
def initialize
|
33
|
+
super(T.untyped)
|
34
|
+
end
|
35
|
+
|
36
|
+
def valid?(obj)
|
37
|
+
obj.is_a?(Enumerator::Chain)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
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.10607
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -234,6 +234,7 @@ files:
|
|
234
234
|
- lib/types/types/typed_array.rb
|
235
235
|
- lib/types/types/typed_enumerable.rb
|
236
236
|
- lib/types/types/typed_enumerator.rb
|
237
|
+
- lib/types/types/typed_enumerator_chain.rb
|
237
238
|
- lib/types/types/typed_enumerator_lazy.rb
|
238
239
|
- lib/types/types/typed_hash.rb
|
239
240
|
- lib/types/types/typed_range.rb
|