console 1.23.0 → 1.23.2

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: d9f91e3e103d4d8999923473901b90855e7c8ee5a2f1bf5fa7be4b87a435e0e2
4
- data.tar.gz: 78cc14aa29facd5ef1909fc08bcd255d11c251f1075dbe92692f26a249557cbf
3
+ metadata.gz: d9984686df55cf08a23326ad2399c96583b822bf45762224a30e071a8d9b20a1
4
+ data.tar.gz: 6febeee8181c2d113705133e364853adec8a7c2c2ee5499e98dc7662fc66d2ed
5
5
  SHA512:
6
- metadata.gz: bda52b2ed24d9825905e8e929809d9629ba61755059d7e00ef8ceb693839a191d98647bc13fd2c3a7699f8f664560e4f35c316e21bb9e37c24b8d1265c31dd91
7
- data.tar.gz: 22a7f6c0be0617140c608b5063c25d3dd220670afc570860f0cd54fea36f889c3b128d168f9dd6bf92c01c271e335b4d73dfd06cfe918f2360911aa8991fcfba
6
+ metadata.gz: 0a31fc4b37d62d7456b80091c74735c5fab350baf3a2fc280c351a52d5219b0cfbe6871bf835ed636df15d5da68def019980f351327d5ab547971fd896f62253
7
+ data.tar.gz: d9a1dc792ba4e6d97f7a6d2998a2795668ec26aaa05b27b65e89f706f0b98c80e904b0d9f916b83982bbb015a0e6e59845a23289377dc38194f156ecec28bf48
checksums.yaml.gz.sig CHANGED
Binary file
@@ -18,14 +18,47 @@ module Console
18
18
 
19
19
  def dump(object)
20
20
  @format.dump(object, @limit)
21
- rescue => error
21
+ rescue SystemStackError, StandardError => error
22
22
  @format.dump(safe_dump(object, error))
23
23
  end
24
24
 
25
25
  private
26
26
 
27
- def default_objects
28
- Hash.new.compare_by_identity
27
+ def filter_backtrace(error)
28
+ frames = error.backtrace
29
+ filtered = {}
30
+ filtered_count = nil
31
+ skipped = nil
32
+
33
+ frames = frames.filter_map do |frame|
34
+ if filtered[frame]
35
+ if filtered_count == nil
36
+ filtered_count = 1
37
+ skipped = frame.dup
38
+ else
39
+ filtered_count += 1
40
+ nil
41
+ end
42
+ else
43
+ if skipped
44
+ if filtered_count > 1
45
+ skipped.replace("[... #{filtered_count} frames skipped ...]")
46
+ end
47
+
48
+ filtered_count = nil
49
+ skipped = nil
50
+ end
51
+
52
+ filtered[frame] = true
53
+ frame
54
+ end
55
+ end
56
+
57
+ if skipped && filtered_count > 1
58
+ skipped.replace("[... #{filtered_count} frames skipped ...]")
59
+ end
60
+
61
+ return frames
29
62
  end
30
63
 
31
64
  def safe_dump(object, error)
@@ -35,6 +68,7 @@ module Console
35
68
  object[:error] = {
36
69
  class: safe_dump_recurse(error.class.name),
37
70
  message: safe_dump_recurse(error.message),
71
+ backtrace: safe_dump_recurse(filter_backtrace(error)),
38
72
  }
39
73
 
40
74
  return object
@@ -51,6 +85,10 @@ module Console
51
85
  end
52
86
  end
53
87
 
88
+ def default_objects
89
+ Hash.new.compare_by_identity
90
+ end
91
+
54
92
  # This will recursively generate a safe version of the object.
55
93
  # Nested hashes and arrays will be transformed recursively.
56
94
  # Strings will be encoded with the given encoding.
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2019-2023, by Samuel Williams.
5
5
 
6
6
  module Console
7
- VERSION = "1.23.0"
7
+ VERSION = "1.23.2"
8
8
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: console
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.23.0
4
+ version: 1.23.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -46,7 +46,7 @@ cert_chain:
46
46
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
47
47
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
48
48
  -----END CERTIFICATE-----
49
- date: 2023-08-11 00:00:00.000000000 Z
49
+ date: 2023-08-15 00:00:00.000000000 Z
50
50
  dependencies:
51
51
  - !ruby/object:Gem::Dependency
52
52
  name: fiber-annotation
metadata.gz.sig CHANGED
@@ -1,3 +1,3 @@
1
- G)Q�f���&5Te��� �t<��ӗoⰲV��Z��#�o
2
- #�*O~��Ѩip&;��N��~����q%�t0�<�d��^m5V2fגQ�~t/��e�el�U@��m�lB��zWx+��\ 2�nτaI{�n*Go��X(�+5���J$d7�S ���3��~w���5�{`�x�d?";'⹐��Ptпf���t%��
3
- NR��=�9΃�(Z��H'�`xI(2Gɂa��u�d��V0�p�Y�v��Ews�����'���� ·���ğ���[J��bi;q�\N�6�5���Hc|YYBo�׏Lbmp؃.>{Q-��E
1
+ �<��Y+s��rhm�ǥ��;?�px%X9�ۥ��nǷ?�T�� X��]A��aM�$��bY!�Λ�+�F5UX�<�lߛ���'�vY6�R�6��ޕM�E��C�9�W�7�����n�R&�f������e $AV�9�A,���o��m��!�����
2
+ �:,Cng����AOsL�t��j��:���Ezr�*㉇�4��z
3
+ <��9Z�rf�|�I+yvP�k;�hC�A�B¶><���gɩlJ�Ss�d/�������p{����w���D�~���89$��v{Oz��pBH�j6��zfLΊ7 LV"���,��;lh�A]c��������'�V�F.x