console 1.23.1 → 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: f053978f1ebc28b2973844d0ef018eeb200651ffb9bf00702a09ca3b04614fce
4
- data.tar.gz: 4f8177c79c3e0d4f9b43e0e4b2c3f02e72837ca7d31e76a6eff308b41848e064
3
+ metadata.gz: d9984686df55cf08a23326ad2399c96583b822bf45762224a30e071a8d9b20a1
4
+ data.tar.gz: 6febeee8181c2d113705133e364853adec8a7c2c2ee5499e98dc7662fc66d2ed
5
5
  SHA512:
6
- metadata.gz: 01bed9d6648e51ca76c7af4944f640eff416510bd7160ce9e9fd54c6c6397a213b45cfe8b4628d0e2071716b2651362e187f119d82053b85a7c4e5bb06d66fed
7
- data.tar.gz: 80de59979995f867f791052666b20d5d1f50ed01a74af4529797b604934b3f18e064f113963b55014c5f90497b40be82ba124443036f8cb34414b48e6c6bc50b
6
+ metadata.gz: 0a31fc4b37d62d7456b80091c74735c5fab350baf3a2fc280c351a52d5219b0cfbe6871bf835ed636df15d5da68def019980f351327d5ab547971fd896f62253
7
+ data.tar.gz: d9a1dc792ba4e6d97f7a6d2998a2795668ec26aaa05b27b65e89f706f0b98c80e904b0d9f916b83982bbb015a0e6e59845a23289377dc38194f156ecec28bf48
checksums.yaml.gz.sig CHANGED
Binary file
@@ -24,22 +24,38 @@ module Console
24
24
 
25
25
  private
26
26
 
27
- def default_objects
28
- Hash.new.compare_by_identity
29
- end
30
-
31
- # The first N frames, noting that the last frame is a placeholder for all the skipped frames:
32
- FIRST_N_FRAMES = 10 + 1
33
- LAST_N_FRAMES = 20
34
- MAXIMUM_FRAMES = FIRST_N_FRAMES + LAST_N_FRAMES
35
-
36
27
  def filter_backtrace(error)
37
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
38
56
 
39
- # Select only the first and last few frames:
40
- if frames.size > MAXIMUM_FRAMES
41
- frames[FIRST_N_FRAMES-1] = "[... #{frames.size - (MAXIMUM_FRAMES-1)} frames ...]"
42
- frames.slice!(FIRST_N_FRAMES...-LAST_N_FRAMES)
57
+ if skipped && filtered_count > 1
58
+ skipped.replace("[... #{filtered_count} frames skipped ...]")
43
59
  end
44
60
 
45
61
  return frames
@@ -69,6 +85,10 @@ module Console
69
85
  end
70
86
  end
71
87
 
88
+ def default_objects
89
+ Hash.new.compare_by_identity
90
+ end
91
+
72
92
  # This will recursively generate a safe version of the object.
73
93
  # Nested hashes and arrays will be transformed recursively.
74
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.1"
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.1
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
Binary file