sorbet-runtime 0.5.11303 → 0.5.11307
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/types/props/pretty_printable.rb +6 -6
- data/lib/types/props/serializable.rb +9 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39fbad0b3588d00cefdc5fa5ccc639644608a4b020bd63c91a5155dc58570176
|
4
|
+
data.tar.gz: 32f476420b21b2575e84e9cf1fc71efdb364d714e8bf2292cd536ec40309d823
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5862485c4255e9e7d419131f94d72c6a490a94745224c56f7249e8ecaf9aef1f5da24d2281857f6693635c7406a7d4fd001b63eed2a17b05b03aa9b3074053b2
|
7
|
+
data.tar.gz: b7dd71b602d6b5ac66ffa8ceccbe74d53aeea41b86f88e8760d6781f2021577aedc0f1bc7d69a4fdb25114fe6701af101120488579e3b3f2755eb83778163235
|
@@ -7,13 +7,13 @@ module T::Props::PrettyPrintable
|
|
7
7
|
|
8
8
|
# Override the PP gem with something that's similar, but gives us a hook to do redaction and customization
|
9
9
|
def pretty_print(pp)
|
10
|
-
|
10
|
+
klass = T.unsafe(T.cast(self, Object).class).decorator
|
11
11
|
multiline = pp.is_a?(PP)
|
12
|
-
pp.group(1, "<#{
|
13
|
-
|
12
|
+
pp.group(1, "<#{klass.inspect_class_with_decoration(self)}", ">") do
|
13
|
+
klass.all_props.sort.each do |prop|
|
14
14
|
pp.breakable
|
15
|
-
val =
|
16
|
-
rules =
|
15
|
+
val = klass.get(self, prop)
|
16
|
+
rules = klass.prop_rules(prop)
|
17
17
|
pp.text("#{prop}=")
|
18
18
|
if (custom_inspect = rules[:inspect])
|
19
19
|
inspected = if T::Utils.arity(custom_inspect) == 1
|
@@ -28,7 +28,7 @@ module T::Props::PrettyPrintable
|
|
28
28
|
val.pretty_print(pp)
|
29
29
|
end
|
30
30
|
end
|
31
|
-
|
31
|
+
klass.pretty_print_extra(self, pp)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
@@ -261,11 +261,16 @@ module T::Props::Serializable::DecoratorMethods
|
|
261
261
|
end
|
262
262
|
|
263
263
|
def message_with_generated_source_context(error, generated_method, generate_source_method)
|
264
|
-
|
265
|
-
|
266
|
-
return unless line_loc
|
264
|
+
line_label = error.backtrace.find {|l| l.end_with?("in `#{generated_method}'")}
|
265
|
+
return unless line_label
|
267
266
|
|
268
|
-
line_num =
|
267
|
+
line_num = if line_label.start_with?("(eval)")
|
268
|
+
# (eval):13:in `__t_props_generated_serialize'
|
269
|
+
line_label.split(':')[1]&.to_i
|
270
|
+
else
|
271
|
+
# (eval at /Users/jez/stripe/sorbet/gems/sorbet-runtime/lib/types/props/has_lazily_specialized_methods.rb:65):13:in `__t_props_generated_serialize'
|
272
|
+
line_label.split(':')[2]&.to_i
|
273
|
+
end
|
269
274
|
return unless line_num
|
270
275
|
|
271
276
|
source_lines = self.send(generate_source_method).split("\n")
|
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.11307
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|