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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a057298224487297c5fb36d4a5d2ca15afae37f64badea7e9dbece913d43cee1
4
- data.tar.gz: 900c6b6927dceb17767762d0624866935c68dfe27a93d053af3d0c3621d96843
3
+ metadata.gz: bd11b2221dbdd8fe58cc1ff87b096fa4df1cb6731cafddfef9d17ada8a2a812c
4
+ data.tar.gz: 4f37c6bd988831d7f672fa91607e4de4216a7661e4317e514322e80b80f56c95
5
5
  SHA512:
6
- metadata.gz: 539b4c266dfba8dd44f219f4cf3c9b52487ce20c7dac9c8d9609d162e74ead02e043b2966a537d3a220c5822dc8b92f1dc1c9ccdfe93de48c687807707827385
7
- data.tar.gz: 9a1dcc702267fd56461b7448aa4aae5ef5df83193ba82e36b36c57a6ac9bac5a17d29c5a0bb396a9377d82b57b38295c9315525fa2a274acfdcce5048253c868
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
@@ -4,7 +4,7 @@ class Tracia
4
4
  class Frame
5
5
  include TreeGraph
6
6
 
7
- attr_reader :klass, :call_sym, :method_name, :children, :file
7
+ attr_reader :klass, :call_sym, :method_name, :children, :file, :lineno
8
8
 
9
9
  def initialize(klass, call_sym, method_name, file, lineno)
10
10
  @klass = klass
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Tracia
4
- VERSION = "0.2.1"
4
+ VERSION = "0.2.4"
5
5
  end
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 - 3
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.of_callers(binding.frame_count - trc.depth)
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.of_callers(binding.frame_count - #{depth})")
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.1
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-14 00:00:00.000000000 Z
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.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.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.1
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.1
54
+ version: 0.2.3
55
55
  description:
56
56
  email:
57
57
  - block24block@gmail.com