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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/console/format/safe.rb +41 -3
- data/lib/console/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9984686df55cf08a23326ad2399c96583b822bf45762224a30e071a8d9b20a1
|
4
|
+
data.tar.gz: 6febeee8181c2d113705133e364853adec8a7c2c2ee5499e98dc7662fc66d2ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a31fc4b37d62d7456b80091c74735c5fab350baf3a2fc280c351a52d5219b0cfbe6871bf835ed636df15d5da68def019980f351327d5ab547971fd896f62253
|
7
|
+
data.tar.gz: d9a1dc792ba4e6d97f7a6d2998a2795668ec26aaa05b27b65e89f706f0b98c80e904b0d9f916b83982bbb015a0e6e59845a23289377dc38194f156ecec28bf48
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/console/format/safe.rb
CHANGED
@@ -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
|
28
|
-
|
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.
|
data/lib/console/version.rb
CHANGED
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.
|
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-
|
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
|
-
|
2
|
-
|
3
|
-
|
1
|
+
�<��Y+s��rhm�ǥ��;?�px%X9�ۥ��nǷ?�T�� X��]A��aM�$��b�Y!�Λ�+�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
|
+
<��9� Z�rf�|�I+y�vP�k;�hC�A�B¶><���gɩlJ�Ss�d/�������p{����w���D�~���8�9$��v{Oz��pB�H�j6��zfLΊ7 �L�V"���,��;lh�A]c��������'�V�F.x
|