sorbet-runtime 0.0.1.pre.prealpha → 0.4.4253
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 +5 -5
- data/lib/sorbet-runtime.rb +100 -0
- data/lib/types/_types.rb +245 -0
- data/lib/types/abstract_utils.rb +50 -0
- data/lib/types/boolean.rb +8 -0
- data/lib/types/compatibility_patches.rb +37 -0
- data/lib/types/configuration.rb +368 -0
- data/lib/types/generic.rb +23 -0
- data/lib/types/helpers.rb +31 -0
- data/lib/types/interface_wrapper.rb +158 -0
- data/lib/types/private/abstract/data.rb +36 -0
- data/lib/types/private/abstract/declare.rb +39 -0
- data/lib/types/private/abstract/hooks.rb +43 -0
- data/lib/types/private/abstract/validate.rb +128 -0
- data/lib/types/private/casts.rb +22 -0
- data/lib/types/private/class_utils.rb +102 -0
- data/lib/types/private/decl_state.rb +18 -0
- data/lib/types/private/error_handler.rb +37 -0
- data/lib/types/private/methods/_methods.rb +344 -0
- data/lib/types/private/methods/call_validation.rb +1177 -0
- data/lib/types/private/methods/decl_builder.rb +275 -0
- data/lib/types/private/methods/modes.rb +18 -0
- data/lib/types/private/methods/signature.rb +196 -0
- data/lib/types/private/methods/signature_validation.rb +232 -0
- data/lib/types/private/mixins/mixins.rb +27 -0
- data/lib/types/private/runtime_levels.rb +41 -0
- data/lib/types/private/types/not_typed.rb +23 -0
- data/lib/types/private/types/string_holder.rb +26 -0
- data/lib/types/private/types/void.rb +33 -0
- data/lib/types/profile.rb +27 -0
- data/lib/types/props/_props.rb +165 -0
- data/lib/types/props/constructor.rb +20 -0
- data/lib/types/props/custom_type.rb +84 -0
- data/lib/types/props/decorator.rb +826 -0
- data/lib/types/props/errors.rb +8 -0
- data/lib/types/props/optional.rb +73 -0
- data/lib/types/props/plugin.rb +15 -0
- data/lib/types/props/pretty_printable.rb +106 -0
- data/lib/types/props/serializable.rb +376 -0
- data/lib/types/props/type_validation.rb +98 -0
- data/lib/types/props/utils.rb +49 -0
- data/lib/types/props/weak_constructor.rb +30 -0
- data/lib/types/runtime_profiled.rb +36 -0
- data/lib/types/sig.rb +28 -0
- data/lib/types/struct.rb +8 -0
- data/lib/types/types/base.rb +141 -0
- data/lib/types/types/class_of.rb +38 -0
- data/lib/types/types/enum.rb +42 -0
- data/lib/types/types/fixed_array.rb +60 -0
- data/lib/types/types/fixed_hash.rb +59 -0
- data/lib/types/types/intersection.rb +36 -0
- data/lib/types/types/noreturn.rb +25 -0
- data/lib/types/types/proc.rb +51 -0
- data/lib/types/types/self_type.rb +31 -0
- data/lib/types/types/simple.rb +33 -0
- data/lib/types/types/type_member.rb +7 -0
- data/lib/types/types/type_parameter.rb +23 -0
- data/lib/types/types/type_template.rb +7 -0
- data/lib/types/types/type_variable.rb +31 -0
- data/lib/types/types/typed_array.rb +20 -0
- data/lib/types/types/typed_enumerable.rb +141 -0
- data/lib/types/types/typed_enumerator.rb +22 -0
- data/lib/types/types/typed_hash.rb +29 -0
- data/lib/types/types/typed_range.rb +22 -0
- data/lib/types/types/typed_set.rb +22 -0
- data/lib/types/types/union.rb +59 -0
- data/lib/types/types/untyped.rb +25 -0
- data/lib/types/utils.rb +223 -0
- metadata +122 -15
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# typed: true
|
3
|
+
|
4
|
+
module T::Types
|
5
|
+
class TypedEnumerator < TypedEnumerable
|
6
|
+
attr_reader :type
|
7
|
+
|
8
|
+
# @override Base
|
9
|
+
def name
|
10
|
+
"T::Enumerator[#{@type.name}]"
|
11
|
+
end
|
12
|
+
|
13
|
+
# @override Base
|
14
|
+
def valid?(obj)
|
15
|
+
obj.is_a?(Enumerator) && super
|
16
|
+
end
|
17
|
+
|
18
|
+
def new(*args, &blk) # rubocop:disable PrisonGuard/BanBuiltinMethodOverride
|
19
|
+
T.unsafe(Enumerator).new(*args, &blk)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# typed: true
|
3
|
+
|
4
|
+
module T::Types
|
5
|
+
class TypedHash < TypedEnumerable
|
6
|
+
# Technically we don't need these, but they are a nice api
|
7
|
+
attr_reader :keys, :values
|
8
|
+
|
9
|
+
def initialize(keys:, values:)
|
10
|
+
@keys = T::Utils.coerce(keys)
|
11
|
+
@values = T::Utils.coerce(values)
|
12
|
+
@type = T::Utils.coerce([keys, values])
|
13
|
+
end
|
14
|
+
|
15
|
+
# @override Base
|
16
|
+
def name
|
17
|
+
"T::Hash[#{@keys.name}, #{@values.name}]"
|
18
|
+
end
|
19
|
+
|
20
|
+
# @override Base
|
21
|
+
def valid?(obj)
|
22
|
+
obj.is_a?(Hash) && super
|
23
|
+
end
|
24
|
+
|
25
|
+
def new(*args, &blk) # rubocop:disable PrisonGuard/BanBuiltinMethodOverride
|
26
|
+
Hash.new(*T.unsafe(args), &blk) # rubocop:disable PrisonGuard/RestrictHashDefaults
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# typed: true
|
3
|
+
|
4
|
+
module T::Types
|
5
|
+
class TypedRange < TypedEnumerable
|
6
|
+
attr_reader :type
|
7
|
+
|
8
|
+
# @override Base
|
9
|
+
def name
|
10
|
+
"T::Range[#{@type.name}]"
|
11
|
+
end
|
12
|
+
|
13
|
+
# @override Base
|
14
|
+
def valid?(obj)
|
15
|
+
obj.is_a?(Range) && super
|
16
|
+
end
|
17
|
+
|
18
|
+
def new(*args) # rubocop:disable PrisonGuard/BanBuiltinMethodOverride
|
19
|
+
T.unsafe(Range).new(*args)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# typed: true
|
3
|
+
|
4
|
+
module T::Types
|
5
|
+
class TypedSet < TypedEnumerable
|
6
|
+
attr_reader :type
|
7
|
+
|
8
|
+
# @override Base
|
9
|
+
def name
|
10
|
+
"T::Set[#{@type.name}]"
|
11
|
+
end
|
12
|
+
|
13
|
+
# @override Base
|
14
|
+
def valid?(obj)
|
15
|
+
obj.is_a?(Set) && super
|
16
|
+
end
|
17
|
+
|
18
|
+
def new(*args) # rubocop:disable PrisonGuard/BanBuiltinMethodOverride
|
19
|
+
Set.new(*T.unsafe(args))
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# typed: true
|
3
|
+
|
4
|
+
module T::Types
|
5
|
+
# Takes a list of types. Validates that an object matches at least one of the types.
|
6
|
+
class Union < Base
|
7
|
+
attr_reader :types
|
8
|
+
|
9
|
+
def initialize(types)
|
10
|
+
@types = types.flat_map do |type|
|
11
|
+
if type.is_a?(Union)
|
12
|
+
# Simplify nested unions (mostly so `name` returns a nicer value)
|
13
|
+
type.types
|
14
|
+
else
|
15
|
+
T::Utils.coerce(type)
|
16
|
+
end
|
17
|
+
end.uniq
|
18
|
+
end
|
19
|
+
|
20
|
+
# @override Base
|
21
|
+
def name
|
22
|
+
type_shortcuts(@types)
|
23
|
+
end
|
24
|
+
|
25
|
+
private def type_shortcuts(types)
|
26
|
+
if types.size == 1
|
27
|
+
return types[0].name
|
28
|
+
end
|
29
|
+
nilable = T::Utils.coerce(NilClass)
|
30
|
+
trueclass = T::Utils.coerce(TrueClass)
|
31
|
+
falseclass = T::Utils.coerce(FalseClass)
|
32
|
+
if types.any? {|t| t == nilable}
|
33
|
+
remaining_types = types.reject {|t| t == nilable}
|
34
|
+
"T.nilable(#{type_shortcuts(remaining_types)})"
|
35
|
+
elsif types.any? {|t| t == trueclass} && types.any? {|t| t == falseclass}
|
36
|
+
remaining_types = types.reject {|t| t == trueclass || t == falseclass}
|
37
|
+
type_shortcuts([T::Private::Types::StringHolder.new("T::Boolean")] + remaining_types)
|
38
|
+
else
|
39
|
+
names = types.map(&:name).compact.sort
|
40
|
+
"T.any(#{names.join(', ')})"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# @override Base
|
45
|
+
def valid?(obj)
|
46
|
+
@types.each do |type|
|
47
|
+
return true if type.valid?(obj)
|
48
|
+
end
|
49
|
+
|
50
|
+
false
|
51
|
+
end
|
52
|
+
|
53
|
+
# @override Base
|
54
|
+
private def subtype_of_single?(other)
|
55
|
+
raise "This should never be reached if you're going through `subtype_of?` (and you should be)"
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# typed: true
|
3
|
+
|
4
|
+
module T::Types
|
5
|
+
# A dynamic type, which permits whatever
|
6
|
+
class Untyped < Base
|
7
|
+
|
8
|
+
def initialize; end
|
9
|
+
|
10
|
+
# @override Base
|
11
|
+
def name
|
12
|
+
"T.untyped"
|
13
|
+
end
|
14
|
+
|
15
|
+
# @override Base
|
16
|
+
def valid?(obj)
|
17
|
+
true
|
18
|
+
end
|
19
|
+
|
20
|
+
# @override Base
|
21
|
+
private def subtype_of_single?(other)
|
22
|
+
true
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/types/utils.rb
ADDED
@@ -0,0 +1,223 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# typed: true
|
3
|
+
|
4
|
+
module T::Utils
|
5
|
+
# Used to convert from a type specification to a `T::Types::Base`.
|
6
|
+
def self.coerce(val)
|
7
|
+
if val.is_a?(T::Types::Base)
|
8
|
+
val
|
9
|
+
elsif val == ::Array
|
10
|
+
T::Array[T.untyped]
|
11
|
+
elsif val == ::Set
|
12
|
+
T::Set[T.untyped]
|
13
|
+
elsif val == ::Hash
|
14
|
+
T::Hash[T.untyped, T.untyped]
|
15
|
+
elsif val == ::Enumerable
|
16
|
+
T::Enumerable[T.untyped]
|
17
|
+
elsif val == ::Enumerator
|
18
|
+
T::Enumerator[T.untyped]
|
19
|
+
elsif val == ::Range
|
20
|
+
T::Range[T.untyped]
|
21
|
+
elsif val.is_a?(Module)
|
22
|
+
T::Types::Simple.new(val) # rubocop:disable PrisonGuard/UseOpusTypesShortcut
|
23
|
+
elsif val.is_a?(::Array)
|
24
|
+
T::Types::FixedArray.new(val) # rubocop:disable PrisonGuard/UseOpusTypesShortcut
|
25
|
+
elsif val.is_a?(::Hash)
|
26
|
+
T::Types::FixedHash.new(val) # rubocop:disable PrisonGuard/UseOpusTypesShortcut
|
27
|
+
elsif val.is_a?(T::Private::Methods::DeclBuilder)
|
28
|
+
T::Private::Methods.finalize_proc(val.decl)
|
29
|
+
else
|
30
|
+
raise "Invalid value for type constraint. Must be an #{T::Types::Base}, a " \
|
31
|
+
"class/module, or an array. Got a `#{val.class}`."
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# Returns the set of all methods (public, protected, private) defined on a module or its
|
36
|
+
# ancestors, excluding Object and its ancestors. Overrides of methods from Object (and its
|
37
|
+
# ancestors) are included.
|
38
|
+
def self.methods_excluding_object(mod)
|
39
|
+
# We can't just do mod.instance_methods - Object.instance_methods, because that would leave out
|
40
|
+
# any methods from Object that are overridden in mod.
|
41
|
+
mod.ancestors.flat_map do |ancestor|
|
42
|
+
# equivalent to checking Object.ancestors.include?(ancestor)
|
43
|
+
next [] if Object <= ancestor
|
44
|
+
ancestor.instance_methods(false) + ancestor.private_instance_methods(false)
|
45
|
+
end.uniq
|
46
|
+
end
|
47
|
+
|
48
|
+
# Associates a signature with a forwarder method that matches the signature of the method it
|
49
|
+
# forwards to. This is necessary because forwarder methods are often declared with catch-all
|
50
|
+
# splat parameters, rather than the exact set of parameters ultimately used by the target method,
|
51
|
+
# so they cannot be validated as strictly.
|
52
|
+
#
|
53
|
+
# The caller of this method must ensure that the forwarder method properly forwards all parameters
|
54
|
+
# such that the signature is accurate.
|
55
|
+
def self.register_forwarder(from_method, to_method, remove_first_param: false)
|
56
|
+
T::Private::Methods.register_forwarder(
|
57
|
+
from_method, to_method, remove_first_param: remove_first_param
|
58
|
+
)
|
59
|
+
end
|
60
|
+
|
61
|
+
# Returns the signature for the instance method on the supplied module, or nil if it's not found or not typed.
|
62
|
+
#
|
63
|
+
# @example T::Utils.signature_for_instance_method(MyClass, :my_method)
|
64
|
+
def self.signature_for_instance_method(mod, method_name)
|
65
|
+
T::Private::Methods.signature_for_method(mod.instance_method(method_name))
|
66
|
+
end
|
67
|
+
|
68
|
+
def self.wrap_method_with_call_validation_if_needed(mod, method_sig, original_method)
|
69
|
+
T::Private::Methods::CallValidation.wrap_method_if_needed(mod, method_sig, original_method)
|
70
|
+
end
|
71
|
+
|
72
|
+
# Unwraps all the sigs.
|
73
|
+
def self.run_all_sig_blocks
|
74
|
+
T::Private::Methods.run_all_sig_blocks
|
75
|
+
end
|
76
|
+
|
77
|
+
# This can be called in a wholesome test to make sure all the `sig`s are well
|
78
|
+
# formed.
|
79
|
+
def self.validate_sigs
|
80
|
+
exceptions = []
|
81
|
+
run_all_sig_blocks
|
82
|
+
ObjectSpace.each_object(Module) do |mod| # rubocop:disable PrisonGuard/NoDynamicConstAccess
|
83
|
+
begin
|
84
|
+
T::Private::Abstract::Validate.validate_subclass(mod)
|
85
|
+
if T::AbstractUtils.abstract_module?(mod)
|
86
|
+
T::Private::Abstract::Validate.validate_abstract_module(mod)
|
87
|
+
end
|
88
|
+
rescue => e
|
89
|
+
exceptions << e
|
90
|
+
end
|
91
|
+
end
|
92
|
+
if !exceptions.empty?
|
93
|
+
raise "#{exceptions.count} exception thrown during validation:\n\n#{exceptions.map(&:message).sort.join("\n\n")}"
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
# Give a type which is a subclass of T::Types::Base, determines if the type is a simple nilable type (union of NilClass and something else).
|
98
|
+
# If so, returns the T::Types::Base of the something else. Otherwise, returns nil.
|
99
|
+
def self.unwrap_nilable(type)
|
100
|
+
case type
|
101
|
+
when T::Types::Union
|
102
|
+
non_nil_types = type.types.reject {|t| t == T::Utils.coerce(NilClass)}
|
103
|
+
if non_nil_types.length == 1
|
104
|
+
non_nil_types.first
|
105
|
+
else
|
106
|
+
nil
|
107
|
+
end
|
108
|
+
else
|
109
|
+
nil
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
def self.DANGER_enable_checking_in_tests
|
114
|
+
T::Private::RuntimeLevels.enable_checking_in_tests
|
115
|
+
end
|
116
|
+
|
117
|
+
# Returns the arity of a method, unwrapping the sig if needed
|
118
|
+
def self.arity(method)
|
119
|
+
arity = method.arity # rubocop:disable PrisonGuard/NoArity
|
120
|
+
return arity if arity != -1 || method.is_a?(Proc)
|
121
|
+
sig = T::Private::Methods.signature_for_method(method)
|
122
|
+
sig ? sig.method.arity : arity # rubocop:disable PrisonGuard/NoArity
|
123
|
+
end
|
124
|
+
|
125
|
+
# Elide the middle of a string as needed and replace it with an ellipsis.
|
126
|
+
# Keep the given number of characters at the start and end of the string.
|
127
|
+
#
|
128
|
+
# This method operates on string length, not byte length.
|
129
|
+
#
|
130
|
+
# If the string is shorter than the requested truncation length, return it
|
131
|
+
# without adding an ellipsis. This method may return a longer string than
|
132
|
+
# the original if the characters removed are shorter than the ellipsis.
|
133
|
+
#
|
134
|
+
# @param [String] str
|
135
|
+
#
|
136
|
+
# @param [Fixnum] start_len The length of string before the ellipsis
|
137
|
+
# @param [Fixnum] end_len The length of string after the ellipsis
|
138
|
+
#
|
139
|
+
# @param [String] ellipsis The string to add in place of the elided text
|
140
|
+
#
|
141
|
+
# @return [String]
|
142
|
+
#
|
143
|
+
def self.string_truncate_middle(str, start_len, end_len, ellipsis='...')
|
144
|
+
return unless str
|
145
|
+
|
146
|
+
raise ArgumentError.new('must provide start_len') unless start_len
|
147
|
+
raise ArgumentError.new('must provide end_len') unless end_len
|
148
|
+
|
149
|
+
raise ArgumentError.new('start_len must be >= 0') if start_len < 0
|
150
|
+
raise ArgumentError.new('end_len must be >= 0') if end_len < 0
|
151
|
+
|
152
|
+
str = str.to_s
|
153
|
+
return str if str.length <= start_len + end_len
|
154
|
+
|
155
|
+
start_part = str[0...start_len - ellipsis.length]
|
156
|
+
end_part = end_len == 0 ? '' : str[-end_len..-1]
|
157
|
+
|
158
|
+
"#{start_part}#{ellipsis}#{end_part}"
|
159
|
+
end
|
160
|
+
|
161
|
+
module Props
|
162
|
+
def self.required_prop?(prop_rules)
|
163
|
+
# Clients should never reference :_tnilable as the implementation can change.
|
164
|
+
!prop_rules[:_tnilable]
|
165
|
+
end
|
166
|
+
|
167
|
+
def self.optional_prop?(prop_rules)
|
168
|
+
# Clients should never reference :_tnilable as the implementation can change.
|
169
|
+
!!prop_rules[:_tnilable]
|
170
|
+
end
|
171
|
+
|
172
|
+
def self.merge_serialized_optional_rule(prop_rules)
|
173
|
+
{'_tnilable' => true}.merge(prop_rules.merge('_tnilable' => true))
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
module Nilable
|
178
|
+
# :is_union_type, T::Boolean: whether the type is an T::Types::Union type
|
179
|
+
# :non_nilable_type, Class: if it is an T.nilable type, the corresponding underlying type; otherwise, nil.
|
180
|
+
TypeInfo = Struct.new(:is_union_type, :non_nilable_type)
|
181
|
+
|
182
|
+
def self.get_type_info(prop_type)
|
183
|
+
if prop_type.is_a?(T::Types::Union)
|
184
|
+
non_nilable_type = T::Utils.unwrap_nilable(prop_type)
|
185
|
+
if non_nilable_type && non_nilable_type.is_a?(T::Types::Simple)
|
186
|
+
non_nilable_type = non_nilable_type.raw_type
|
187
|
+
end
|
188
|
+
TypeInfo.new(true, non_nilable_type)
|
189
|
+
else
|
190
|
+
TypeInfo.new(false, nil)
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
# Get the underlying type inside prop_type:
|
195
|
+
# - if the type is A, the function returns A
|
196
|
+
# - if the type is T.nilable(A), the function returns A
|
197
|
+
def self.get_underlying_type(prop_type)
|
198
|
+
type_info = get_type_info(prop_type)
|
199
|
+
if type_info.is_union_type
|
200
|
+
type_info.non_nilable_type || prop_type
|
201
|
+
elsif prop_type.is_a?(T::Types::Simple)
|
202
|
+
prop_type.raw_type
|
203
|
+
else
|
204
|
+
prop_type
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
# The difference between this function and the above function is that the Sorbet type, like T::Types::Simple
|
209
|
+
# is preserved.
|
210
|
+
def self.get_underlying_type_object(prop_type)
|
211
|
+
T::Utils.unwrap_nilable(prop_type) || prop_type
|
212
|
+
end
|
213
|
+
|
214
|
+
def self.is_union_with_nilclass(prop_type)
|
215
|
+
case prop_type
|
216
|
+
when T::Types::Union
|
217
|
+
prop_type.types.any? {|t| t == T::Utils.coerce(NilClass)}
|
218
|
+
else
|
219
|
+
false
|
220
|
+
end
|
221
|
+
end
|
222
|
+
end
|
223
|
+
end
|
metadata
CHANGED
@@ -1,27 +1,133 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sorbet-runtime
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.4253
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
8
|
-
- Nelson Elhage
|
9
|
-
- Paul Tarjan
|
7
|
+
- Stripe
|
10
8
|
autorequire:
|
11
9
|
bindir: bin
|
12
10
|
cert_chain: []
|
13
|
-
date: 2019-
|
14
|
-
dependencies:
|
15
|
-
|
16
|
-
|
17
|
-
|
11
|
+
date: 2019-06-20 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: minitest
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '5.11'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '5.11'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: mocha
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.7'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.7'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: Sorbet's runtime type checking component
|
56
|
+
email:
|
18
57
|
executables: []
|
19
58
|
extensions: []
|
20
59
|
extra_rdoc_files: []
|
21
|
-
files:
|
60
|
+
files:
|
61
|
+
- lib/sorbet-runtime.rb
|
62
|
+
- lib/types/_types.rb
|
63
|
+
- lib/types/abstract_utils.rb
|
64
|
+
- lib/types/boolean.rb
|
65
|
+
- lib/types/compatibility_patches.rb
|
66
|
+
- lib/types/configuration.rb
|
67
|
+
- lib/types/generic.rb
|
68
|
+
- lib/types/helpers.rb
|
69
|
+
- lib/types/interface_wrapper.rb
|
70
|
+
- lib/types/private/abstract/data.rb
|
71
|
+
- lib/types/private/abstract/declare.rb
|
72
|
+
- lib/types/private/abstract/hooks.rb
|
73
|
+
- lib/types/private/abstract/validate.rb
|
74
|
+
- lib/types/private/casts.rb
|
75
|
+
- lib/types/private/class_utils.rb
|
76
|
+
- lib/types/private/decl_state.rb
|
77
|
+
- lib/types/private/error_handler.rb
|
78
|
+
- lib/types/private/methods/_methods.rb
|
79
|
+
- lib/types/private/methods/call_validation.rb
|
80
|
+
- lib/types/private/methods/decl_builder.rb
|
81
|
+
- lib/types/private/methods/modes.rb
|
82
|
+
- lib/types/private/methods/signature.rb
|
83
|
+
- lib/types/private/methods/signature_validation.rb
|
84
|
+
- lib/types/private/mixins/mixins.rb
|
85
|
+
- lib/types/private/runtime_levels.rb
|
86
|
+
- lib/types/private/types/not_typed.rb
|
87
|
+
- lib/types/private/types/string_holder.rb
|
88
|
+
- lib/types/private/types/void.rb
|
89
|
+
- lib/types/profile.rb
|
90
|
+
- lib/types/props/_props.rb
|
91
|
+
- lib/types/props/constructor.rb
|
92
|
+
- lib/types/props/custom_type.rb
|
93
|
+
- lib/types/props/decorator.rb
|
94
|
+
- lib/types/props/errors.rb
|
95
|
+
- lib/types/props/optional.rb
|
96
|
+
- lib/types/props/plugin.rb
|
97
|
+
- lib/types/props/pretty_printable.rb
|
98
|
+
- lib/types/props/serializable.rb
|
99
|
+
- lib/types/props/type_validation.rb
|
100
|
+
- lib/types/props/utils.rb
|
101
|
+
- lib/types/props/weak_constructor.rb
|
102
|
+
- lib/types/runtime_profiled.rb
|
103
|
+
- lib/types/sig.rb
|
104
|
+
- lib/types/struct.rb
|
105
|
+
- lib/types/types/base.rb
|
106
|
+
- lib/types/types/class_of.rb
|
107
|
+
- lib/types/types/enum.rb
|
108
|
+
- lib/types/types/fixed_array.rb
|
109
|
+
- lib/types/types/fixed_hash.rb
|
110
|
+
- lib/types/types/intersection.rb
|
111
|
+
- lib/types/types/noreturn.rb
|
112
|
+
- lib/types/types/proc.rb
|
113
|
+
- lib/types/types/self_type.rb
|
114
|
+
- lib/types/types/simple.rb
|
115
|
+
- lib/types/types/type_member.rb
|
116
|
+
- lib/types/types/type_parameter.rb
|
117
|
+
- lib/types/types/type_template.rb
|
118
|
+
- lib/types/types/type_variable.rb
|
119
|
+
- lib/types/types/typed_array.rb
|
120
|
+
- lib/types/types/typed_enumerable.rb
|
121
|
+
- lib/types/types/typed_enumerator.rb
|
122
|
+
- lib/types/types/typed_hash.rb
|
123
|
+
- lib/types/types/typed_range.rb
|
124
|
+
- lib/types/types/typed_set.rb
|
125
|
+
- lib/types/types/union.rb
|
126
|
+
- lib/types/types/untyped.rb
|
127
|
+
- lib/types/utils.rb
|
22
128
|
homepage: https://sorbet.run
|
23
129
|
licenses:
|
24
|
-
-
|
130
|
+
- Apache-2.0
|
25
131
|
metadata: {}
|
26
132
|
post_install_message:
|
27
133
|
rdoc_options: []
|
@@ -34,12 +140,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
34
140
|
version: '0'
|
35
141
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
36
142
|
requirements:
|
37
|
-
- - "
|
143
|
+
- - ">="
|
38
144
|
- !ruby/object:Gem::Version
|
39
|
-
version:
|
145
|
+
version: '0'
|
40
146
|
requirements: []
|
41
|
-
|
147
|
+
rubyforge_project:
|
148
|
+
rubygems_version: 2.6.14
|
42
149
|
signing_key:
|
43
150
|
specification_version: 4
|
44
|
-
summary:
|
151
|
+
summary: Sorbet runtime
|
45
152
|
test_files: []
|