stack_trace-viz 0.1.0 → 0.3.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 +14 -9
- data/lib/stack_trace/viz/version.rb +1 -1
- data/lib/stack_trace/viz.rb +4 -2
- 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: bfa55f7d4332565e082fb0fdf9091156ea0f0927e5c739d0c9733ce45e6ea214
|
4
|
+
data.tar.gz: 5a1bbdd5cd0681c489594ad9bc7c4d80fa20c2a30f5f6b6b6959acdd1887f532
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb9c137e44a346f067d2b444391d727cc064d18cddb6e0d6793fcdba84bc7e1c6f8230da0386a678300ff1721b847838d9c4daca2b0feb98f4abc2b82a079e06
|
7
|
+
data.tar.gz: 2517defbfd270f8a8113768f9779d476989a36f20ae1f3f39309ede79e9743bd226f282fac666b2a70dde4cc8b0cedc19959cdabe5f6295fdb2299d5f1249baa
|
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.3.0)
|
5
|
+
stack_trace (~> 0.4)
|
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.4.0)
|
26
26
|
|
27
27
|
PLATFORMS
|
28
28
|
arm64-darwin-21
|
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
|
data/stack_trace-viz.gemspec
CHANGED
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.3.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
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.4'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.4'
|
27
27
|
description:
|
28
28
|
email:
|
29
29
|
- mehmetemininac@gmail.com
|