sorbet-runtime 0.4.4308 → 0.4.4309
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/types/configuration.rb +15 -0
- data/lib/types/utils.rb +0 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32d48ba7766e8fecc62f28ebcea3d7198767f66d
|
4
|
+
data.tar.gz: 66d65f707e0efb75283c4a7aa66f9811041d019a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88984c4781452bc16fd7cd56ae0221937d29a1c614ae18c2495df14ea2750bb5154e71fcbe964ebad1ad68159f83f45e5912ac6400efe067aaf69c238e3f04f4
|
7
|
+
data.tar.gz: c60d8937796a9e787033d8a1e90629bca4d62d6e71a5378e5b3da62c572f270006fcda67b884daf76b944520da272231564f305cf0d9a2eb0742c775e9fdbe06
|
data/lib/types/configuration.rb
CHANGED
@@ -2,6 +2,21 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module T::Configuration
|
5
|
+
# Announces to Sorbet that we are currently in a test environment, so it
|
6
|
+
# should treat any sigs which are marked `.checked(:tests)` as if they were
|
7
|
+
# just a normal sig.
|
8
|
+
#
|
9
|
+
# If this method is not called, sigs marked `.checked(:tests)` will not be
|
10
|
+
# checked. In fact, such methods won't even be wrapped--the runtime will put
|
11
|
+
# back the original method.
|
12
|
+
#
|
13
|
+
# Note: Due to the way sigs are evaluated and methods are wrapped, this
|
14
|
+
# method MUST be called before any code calls `sig`. This method raises if
|
15
|
+
# it has been called too late.
|
16
|
+
def self.enable_checking_for_sigs_marked_checked_tests
|
17
|
+
T::Private::RuntimeLevels.enable_checking_in_tests
|
18
|
+
end
|
19
|
+
|
5
20
|
# Set a handler to handle `TypeError`s raised by any in-line type assertions,
|
6
21
|
# including `T.must`, `T.let`, `T.cast`, and `T.assert_type!`.
|
7
22
|
#
|
data/lib/types/utils.rb
CHANGED
@@ -110,10 +110,6 @@ module T::Utils
|
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
113
|
-
def self.DANGER_enable_checking_in_tests
|
114
|
-
T::Private::RuntimeLevels.enable_checking_in_tests
|
115
|
-
end
|
116
|
-
|
117
113
|
# Returns the arity of a method, unwrapping the sig if needed
|
118
114
|
def self.arity(method)
|
119
115
|
arity = method.arity # rubocop:disable PrisonGuard/NoArity
|