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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9cacbd102feb89bcc8635c8ef007666211124bcce07c519d73e21f5f2abe8a56
4
- data.tar.gz: 60221979de78d0c021ec578fcdcae70907f95cb1a83e8f02c9096445a166186a
3
+ metadata.gz: 39fbad0b3588d00cefdc5fa5ccc639644608a4b020bd63c91a5155dc58570176
4
+ data.tar.gz: 32f476420b21b2575e84e9cf1fc71efdb364d714e8bf2292cd536ec40309d823
5
5
  SHA512:
6
- metadata.gz: 3bcf71e4d74b0fe6e3f13aae5586c9c2e4ac580fbfc5ef8003ada6b886a50ba190488e0b099b9a5da90e52a7aa49f6f419a3b537c6dece4e44cf7e89c9b725c6
7
- data.tar.gz: 215905e9417a88c911c536ad034fc11395ec5fe2f245a81d803d42c98ac5d0afa7dd90b1bbd37c4d3125eb381eb0092cafedde395ca3cb720f37462d14ab9714
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
- clazz = T.unsafe(T.cast(self, Object).class).decorator
10
+ klass = T.unsafe(T.cast(self, Object).class).decorator
11
11
  multiline = pp.is_a?(PP)
12
- pp.group(1, "<#{clazz.inspect_class_with_decoration(self)}", ">") do
13
- clazz.all_props.sort.each do |prop|
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 = clazz.get(self, prop)
16
- rules = clazz.prop_rules(prop)
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
- clazz.pretty_print_extra(self, pp)
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
- generated_method = generated_method.to_s
265
- line_loc = error.backtrace_locations.find {|l| l.base_label == generated_method}
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 = line_loc.lineno
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.11303
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-21 00:00:00.000000000 Z
11
+ date: 2024-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest