tracia 0.2.1 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tracia/default_logger.rb +0 -14
- data/lib/tracia/frame.rb +1 -1
- data/lib/tracia/version.rb +1 -1
- data/lib/tracia.rb +3 -3
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd11b2221dbdd8fe58cc1ff87b096fa4df1cb6731cafddfef9d17ada8a2a812c
|
4
|
+
data.tar.gz: 4f37c6bd988831d7f672fa91607e4de4216a7661e4317e514322e80b80f56c95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c41f9213fd72b995f4a1ff06e2881354835f173c7af6e95d70a7fcd2a67d1fa382819d9823edc8fe20429e9e7b97fe46878be06858521fe7f167b49d7d06270
|
7
|
+
data.tar.gz: 272914638a974b686fc85e359215b2117be14c4807a5bd58c036325c301822dd457f2fb9e99484308021e426e49b81883036903abd5febafcab1d491bd2506d8
|
@@ -1,19 +1,5 @@
|
|
1
1
|
class Tracia
|
2
2
|
class DefaultLogger
|
3
|
-
NO_CHILD = []
|
4
|
-
|
5
|
-
class << self
|
6
|
-
def tree_graph_everything!
|
7
|
-
Object.define_method(:label_for_tree_graph) do
|
8
|
-
to_s
|
9
|
-
end
|
10
|
-
|
11
|
-
Object.define_method(:children_for_tree_graph) do
|
12
|
-
NO_CHILD
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
3
|
def initialize(out: STDOUT)
|
18
4
|
@out = out
|
19
5
|
end
|
data/lib/tracia/frame.rb
CHANGED
data/lib/tracia/version.rb
CHANGED
data/lib/tracia.rb
CHANGED
@@ -18,7 +18,7 @@ class Tracia
|
|
18
18
|
def start(**opt)
|
19
19
|
trc = (Thread.current[:_tracia_] ||= new(**opt))
|
20
20
|
trc.level += 1
|
21
|
-
trc.depth = binding.frame_count
|
21
|
+
trc.depth = binding.frame_count + 1
|
22
22
|
yield
|
23
23
|
rescue StandardError => e
|
24
24
|
trc.error = e
|
@@ -36,7 +36,7 @@ class Tracia
|
|
36
36
|
trc = Thread.current[:_tracia_]
|
37
37
|
return unless trc
|
38
38
|
|
39
|
-
backtrace = binding.
|
39
|
+
backtrace = binding.partial_callers(-trc.depth)
|
40
40
|
backtrace.reverse!
|
41
41
|
backtrace.pop
|
42
42
|
trc.add(backtrace, info)
|
@@ -59,7 +59,7 @@ class Tracia
|
|
59
59
|
@trace_point = TracePoint.new(:raise) do |point|
|
60
60
|
bd = point.binding
|
61
61
|
next unless current_thread == bd.eval('Thread.current')
|
62
|
-
backtrace = bd.eval("binding.
|
62
|
+
backtrace = bd.eval("binding.partial_callers(-#{depth})")
|
63
63
|
raiser = backtrace[0]
|
64
64
|
next if raiser.klass == Tracia && raiser.frame_env == 'rescue in start'
|
65
65
|
backtrace.reverse!
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tracia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ken
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -30,28 +30,28 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.2.
|
33
|
+
version: 0.2.4
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.2.
|
40
|
+
version: 0.2.4
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: binding_of_callers
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.2.
|
47
|
+
version: 0.2.3
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.2.
|
54
|
+
version: 0.2.3
|
55
55
|
description:
|
56
56
|
email:
|
57
57
|
- block24block@gmail.com
|