tracia 0.2.1 → 0.2.2

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: 3cb9b65fa0d3c36e530bdf201281a35c6f58d38273e2287b12d80688b2cc0a8a
4
+ data.tar.gz: b61d048ac0eb2f09cc432e2ca4aaa0035e4a1ab2d7e6d18b848cdce1d97b67a4
5
5
  SHA512:
6
- metadata.gz: 539b4c266dfba8dd44f219f4cf3c9b52487ce20c7dac9c8d9609d162e74ead02e043b2966a537d3a220c5822dc8b92f1dc1c9ccdfe93de48c687807707827385
7
- data.tar.gz: 9a1dcc702267fd56461b7448aa4aae5ef5df83193ba82e36b36c57a6ac9bac5a17d29c5a0bb396a9377d82b57b38295c9315525fa2a274acfdcce5048253c868
6
+ metadata.gz: 5432ae3e05b76ca7fe8c90ef02843669e627e6aae92e42c257285f37cdcaa03215badbf9b2ad86cac9dc0462cef6a8e60190434de79612028fade99edb6c894b
7
+ data.tar.gz: c41e5de84fc6aba18dcecbadd856c4715f2ffd8ffdcfbc1cc93ffcd35956003f0d4948e313eb93621101395f50e54b26c7ebf41c394bf632a47ba63d77922491
@@ -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.2"
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.2
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-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -44,14 +44,14 @@ dependencies:
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