sorbet-runtime 0.4.4253 → 0.4.4286
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 +4 -4
- data/lib/types/_types.rb +1 -1
- data/lib/types/private/abstract/declare.rb +4 -0
- data/lib/types/sig.rb +1 -1
- data/lib/types/struct.rb +11 -1
- metadata +6 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 58fd1f33f4010ee7ed667a320704eee0b40e9d52
|
|
4
|
+
data.tar.gz: 957e37e28a0da87dfcff6396623188d571ad1efb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 65b2b394682e14565f1fd12530c128bed0275bf520219e865cedc19c24e03e97dc83931a30649faf3cd1ad4935ca64596e58da8c51b74f9da21287c5b2e1e382
|
|
7
|
+
data.tar.gz: 618b4fc7577d7b4fef9b0f97843cc1e8dc47a3408e3904e27280b23219491dba9db8b94bd28e38494d653d93e3bf72223e10e443d4d5530e3ba6553964b5615d
|
data/lib/types/_types.rb
CHANGED
|
@@ -18,6 +18,10 @@ module T::Private::Abstract::Declare
|
|
|
18
18
|
mod.extend(T::InterfaceWrapper::Helpers)
|
|
19
19
|
|
|
20
20
|
if mod.is_a?(Class)
|
|
21
|
+
if mod < T::Struct
|
|
22
|
+
raise "#{mod.name} is a subclass of T::Struct and cannot be declared abstract"
|
|
23
|
+
end
|
|
24
|
+
|
|
21
25
|
if type == :interface
|
|
22
26
|
# Since `interface!` is just `abstract!` with some extra validation, we could technically
|
|
23
27
|
# allow this, but it's unclear there are good use cases, and it might be confusing.
|
data/lib/types/sig.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# rubocop:disable PrisonGuard/NoTopLevelDeclarations, PrisonGuard/PackageMatchesDirectory
|
|
4
4
|
|
|
5
5
|
# Used as a mixin to any class so that you can call `sig`.
|
|
6
|
-
# Docs at
|
|
6
|
+
# Docs at https://sorbet.org/docs/sigs
|
|
7
7
|
module T::Sig
|
|
8
8
|
module WithoutRuntime
|
|
9
9
|
# At runtime, does nothing, but statically it is treated exactly the same
|
data/lib/types/struct.rb
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
# typed: true
|
|
3
3
|
|
|
4
|
-
class T::
|
|
4
|
+
class T::InexactStruct
|
|
5
5
|
include T::Props
|
|
6
6
|
include T::Props::Serializable
|
|
7
7
|
include T::Props::Constructor
|
|
8
8
|
end
|
|
9
|
+
|
|
10
|
+
class T::Struct < T::InexactStruct
|
|
11
|
+
def self.inherited(subclass)
|
|
12
|
+
super(subclass)
|
|
13
|
+
T::Private::ClassUtils.replace_method(subclass.singleton_class, :inherited) do |s|
|
|
14
|
+
super(s)
|
|
15
|
+
raise "#{self.name} is a subclass of T::Struct and cannot be subclassed"
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
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.4.
|
|
4
|
+
version: 0.4.4286
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stripe
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-06-
|
|
11
|
+
date: 2019-06-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: minitest
|
|
@@ -137,7 +137,10 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
137
137
|
requirements:
|
|
138
138
|
- - ">="
|
|
139
139
|
- !ruby/object:Gem::Version
|
|
140
|
-
version:
|
|
140
|
+
version: 2.3.0
|
|
141
|
+
- - "<"
|
|
142
|
+
- !ruby/object:Gem::Version
|
|
143
|
+
version: 2.7.0.preview1
|
|
141
144
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
142
145
|
requirements:
|
|
143
146
|
- - ">="
|