stack_trace-viz 0.5.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/lib/stack_trace/viz/html.rb +11 -2
- data/lib/stack_trace/viz/version.rb +1 -1
- data/public/main.html.erb +1 -1
- data/stack_trace-viz.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 259e8ee7fefe6f8b12b9221a6407edb6342a742b46afb092b19bc49753b8e00d
|
4
|
+
data.tar.gz: 567ff41d9a93f3575d918a831860a225e77957bff5c0403bec554f713403b06d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 715ffff46e4da444e333b144705c4f807a618c1db2950f8dfae3645641161afc5d839ce2faaef72a9a8845c3ef60e76c3922ead7dafa4c9cd3f36d1d77ea9e00
|
7
|
+
data.tar.gz: 625aec58ac43a4d63727c1b68f4a58e26660fd552e5bdc8d63d208dbf20b20893618c19433cf5ac989de23b0044bb2c46bfc9ddfbff7627260a03d6dbc011d42
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
stack_trace-viz (0.
|
5
|
-
stack_trace (~> 0.
|
4
|
+
stack_trace-viz (0.7.0)
|
5
|
+
stack_trace (~> 0.7)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
@@ -22,7 +22,7 @@ GEM
|
|
22
22
|
diff-lcs (>= 1.2.0, < 2.0)
|
23
23
|
rspec-support (~> 3.12.0)
|
24
24
|
rspec-support (3.12.0)
|
25
|
-
stack_trace (0.
|
25
|
+
stack_trace (0.7.0)
|
26
26
|
|
27
27
|
PLATFORMS
|
28
28
|
arm64-darwin-21
|
data/lib/stack_trace/viz/html.rb
CHANGED
@@ -3,11 +3,14 @@
|
|
3
3
|
require "erb"
|
4
4
|
require "json"
|
5
5
|
require "securerandom"
|
6
|
+
require "stringio"
|
6
7
|
|
7
8
|
module StackTrace
|
8
9
|
module Viz
|
9
10
|
class HTML
|
10
11
|
LAYOUT_FILE = "../../public/main.html.erb"
|
12
|
+
MAX_WRITE_BYTES = 64
|
13
|
+
MAX_JSON_NESTING = 1_000
|
11
14
|
|
12
15
|
def initialize
|
13
16
|
@traces = []
|
@@ -16,7 +19,9 @@ module StackTrace
|
|
16
19
|
def save(file_path)
|
17
20
|
file_path ||= default_file_path
|
18
21
|
|
19
|
-
File.open(file_path, "w")
|
22
|
+
File.open(file_path, "w") do |f|
|
23
|
+
content_io.each_line(MAX_WRITE_BYTES) { |chunk| f.write(chunk) }
|
24
|
+
end
|
20
25
|
|
21
26
|
file_path
|
22
27
|
end
|
@@ -33,12 +38,16 @@ module StackTrace
|
|
33
38
|
|
34
39
|
attr_reader :traces
|
35
40
|
|
41
|
+
def content_io
|
42
|
+
StringIO.new(content)
|
43
|
+
end
|
44
|
+
|
36
45
|
def content
|
37
46
|
erb.result_with_hash({ trace_data: trace_data })
|
38
47
|
end
|
39
48
|
|
40
49
|
def trace_data
|
41
|
-
JSON.generate(traces)
|
50
|
+
JSON.generate(traces, max_nesting: MAX_JSON_NESTING)
|
42
51
|
end
|
43
52
|
|
44
53
|
def erb
|