stack_trace-viz 0.1.0 → 0.2.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 +1 -1
- data/lib/stack_trace/viz/html.rb +14 -9
- data/lib/stack_trace/viz/version.rb +1 -1
- data/lib/stack_trace/viz.rb +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03df308cf1ce77b8db23a292b58ef5864911f67a8e0fdeedfd8102877b246c3a
|
4
|
+
data.tar.gz: b75d9416b8fab39ce8029dfaae876cd86eb8cbb995286191b284c050132bac70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18044b403e3121a166e79821ff0e784e0b6ab03ee5a358c13f6cdee7e6e4dbcc948e2fc1c2a63f712fa67aed60ecf3ed71d57688c7ddc8b6c9afea5ee08dfc1d
|
7
|
+
data.tar.gz: 3f6cc6632f536919d94b16140f3429388cbe794f84a43a9c4375ba4e26d2e06dcdd9b32e19be6b5d1d7012ba224e1aad8a4ade795b79e8ecf6aaf4eb27d4a75a
|
data/Gemfile.lock
CHANGED
data/lib/stack_trace/viz/html.rb
CHANGED
@@ -9,31 +9,36 @@ module StackTrace
|
|
9
9
|
class HTML
|
10
10
|
LAYOUT_FILE = "../../public/main.html.erb"
|
11
11
|
|
12
|
-
def initialize
|
13
|
-
@
|
14
|
-
@extra = extra
|
12
|
+
def initialize
|
13
|
+
@traces = []
|
15
14
|
end
|
16
15
|
|
17
16
|
def save(file_path)
|
18
17
|
file_path ||= default_file_path
|
19
18
|
|
20
19
|
File.open(file_path, "w") { |f| f.write(content) }
|
20
|
+
|
21
|
+
file_path
|
22
|
+
end
|
23
|
+
|
24
|
+
def add(trace, **extra)
|
25
|
+
traces << {
|
26
|
+
description: "Generated by StackTrace::Viz",
|
27
|
+
**extra,
|
28
|
+
trace: trace
|
29
|
+
}
|
21
30
|
end
|
22
31
|
|
23
32
|
private
|
24
33
|
|
25
|
-
attr_reader :
|
34
|
+
attr_reader :traces
|
26
35
|
|
27
36
|
def content
|
28
37
|
erb.result_with_hash({ trace_data: trace_data })
|
29
38
|
end
|
30
39
|
|
31
40
|
def trace_data
|
32
|
-
JSON.generate(
|
33
|
-
description: "Generated by StackTrace::Viz",
|
34
|
-
**extra,
|
35
|
-
trace: trace
|
36
|
-
})
|
41
|
+
JSON.generate(traces)
|
37
42
|
end
|
38
43
|
|
39
44
|
def erb
|
data/lib/stack_trace/viz.rb
CHANGED
@@ -12,8 +12,10 @@ module StackTrace
|
|
12
12
|
LAYOUT_FILE = "../public/main.html.erb"
|
13
13
|
|
14
14
|
class << self
|
15
|
-
def save_current!(file_path
|
16
|
-
HTML.new
|
15
|
+
def save_current!(file_path: nil, **extra)
|
16
|
+
html = HTML.new
|
17
|
+
html.add(StackTrace.current, **extra)
|
18
|
+
html.save(file_path)
|
17
19
|
end
|
18
20
|
|
19
21
|
def as_json
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stack_trace-viz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mehmet Emin INAC
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: stack_trace
|