debugtrace 1.3.2 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f351de13b8fc8844e234a3725e9af20f9dcba4ecbcf73490a24ebbdeb698eb7f
4
- data.tar.gz: 305ee479e282fa2ade876ef77e6208b5f01d2e71746a8107847901d052c43a77
3
+ metadata.gz: 69b6084c88c916dc923471251613eb2a2c276a2d6df4e23793660f211243fc65
4
+ data.tar.gz: 41cb5d49ea2323c047a4daeb6fd1589821994b7c52d49e3da4b3c2ebe54df9a7
5
5
  SHA512:
6
- metadata.gz: 22936ed6dcd7efd2933b83ed5b3d4081a0aa934c314dae86878933bcb86230d1c5be77921a5cce1ebc941a9696845534552f570e148a4ad1e185b4f6461eb62e
7
- data.tar.gz: 69f25a8bf99c9e788192cb9c743ab55a2ac984ca1f67f6ab3da9164b8186eb48650ceda79bd939d9cb274082f4bd64911f323644648ec782f8765247361b94e0
6
+ metadata.gz: bbddfd2136028765cfc58b8fe35f34d16eb40cf492fb5c2eb725b6e16775d01986894f8f884b7581737acc5751885a179569b0b2b91bce18f495fb3aa44d3a10
7
+ data.tar.gz: 61c5ec7af3459db2afe1df4259938ad6700b1876415908a56fa8f094bda8dd6f2390d0d8eb577fbf72d4fec63743e660832dcf2d48097c1f5d1e345ee86927c5
data/CHANGELOG.md CHANGED
@@ -1,4 +1,9 @@
1
- ## 1.3.2 - September 19, 2025
1
+ ## 1.4.0 - August 16, 2026
2
+ * Added support for Ruby 4.
3
+ * Changed the value used for thread management from `Thread.current.object_id` to `Thread.current.native_thread_id`.
4
+ * If the argument passed to the `leave` method is a lambda, it is now executed, and its return value becomes the return value of the `leave` method.
5
+
6
+ ## 1.3.2 - September 23, 2025
2
7
  * When running from RubyMine, the source file path is now output as a relative path from the current directory, rather than as an absolute path.
3
8
 
4
9
  ## 1.3.1 - July 15, 2025
data/CHANGELOG_ja.md CHANGED
@@ -1,4 +1,9 @@
1
- ## 1.3.2 - 2025/9/19
1
+ ## 1.4.0 - 2026/8/16
2
+ * Ruby 4に対応したました。
3
+ * スレッドの管理に使用する値を`Thread.current.object_id`から`Thread.current.native_thread_id`に変更しました。
4
+ * `leave`メソッドの引数がラムダ式の場合は、実行してその戻り値を`leave`メソッドの戻り値とするようにしました。
5
+
6
+ ## 1.3.2 - 2025/9/23
2
7
  * RubyMineから実行した場合に、ソースファイルが絶対パスで出力されるのをカレントディレクトリからの相対パスに変更しました。
3
8
 
4
9
  ## 1.3.1 - 2025/7/15
data/README.md CHANGED
@@ -63,46 +63,46 @@ def func2
63
63
  Contact.new(1, 'Akane' , 'Apple', Date.new(1991, 2, 3)),
64
64
  Contact.new(2, 'Yukari', 'Apple', Date.new(1992, 3, 4))
65
65
  ]
66
- DebugTrace.leave(contacts)
66
+ DebugTrace.leave contacts
67
67
  end
68
68
 
69
69
  def func1
70
70
  DebugTrace.enter
71
- DebugTrace.print('Hello, World!')
72
- contacts = func2
73
- DebugTrace.leave(contacts)
71
+ DebugTrace.print'Hello, World!'
72
+ DebugTrace.leave {func2}
74
73
  end
75
74
 
76
- func1
75
+ contacts = func1
76
+ DebugTrace.print'contacts', contacts
77
77
  ```
78
78
 
79
79
  ```log
80
- 2025-09-23 09:40:54.733+09:00 DebugTrace-rb 1.3.2 on Ruby 3.4.6 / x86_64-linux
81
- 2025-09-23 09:40:54.733+09:00 config file: ./debugtrace.yml
82
- 2025-09-23 09:40:54.733+09:00 logger: StdErrLogger
83
- 2025-09-23 09:40:54.733+09:00
84
- 2025-09-23 09:40:54.733+09:00 ______________________________ #72 ______________________________
85
- 2025-09-23 09:40:54.733+09:00
86
- 2025-09-23 09:40:54.733+09:00 Enter func1 (examples/readme-example.rb:29) <- <main> (examples/readme-example.rb:35)
87
- 2025-09-23 09:40:54.733+09:00 | Hello, World! (examples/readme-example.rb:30)
88
- 2025-09-23 09:40:54.733+09:00 | Enter func2 (examples/readme-example.rb:20) <- func1 (examples/readme-example.rb:31)
89
- 2025-09-23 09:40:54.734+09:00 | | Enter Contact#initialize (examples/readme-example.rb:10) <- Class#new (examples/readme-example.rb:22)
90
- 2025-09-23 09:40:54.734+09:00 | | Leave Contact#initialize (examples/readme-example.rb:15) duration: 0.014 ms
91
- 2025-09-23 09:40:54.734+09:00 | |
92
- 2025-09-23 09:40:54.734+09:00 | | Enter Contact#initialize (examples/readme-example.rb:10) <- Class#new (examples/readme-example.rb:23)
93
- 2025-09-23 09:40:54.734+09:00 | | Leave Contact#initialize (examples/readme-example.rb:15) duration: 0.007 ms
94
- 2025-09-23 09:40:54.734+09:00 | Leave func2 (examples/readme-example.rb:25) duration: 0.206 ms
95
- 2025-09-23 09:40:54.734+09:00 Leave func1 (examples/readme-example.rb:32) duration: 0.332 ms
96
- 2025-09-23 09:40:54.734+09:00
97
- 2025-09-23 09:40:54.734+09:00 contacts = [
98
- 2025-09-23 09:40:54.734+09:00 Contact{
99
- 2025-09-23 09:40:54.734+09:00 @id: 1, @firstName: 'Akane', @lastName: 'Apple', @birthday: 1991-02-03
100
- 2025-09-23 09:40:54.734+09:00 },
101
- 2025-09-23 09:40:54.734+09:00 Contact{
102
- 2025-09-23 09:40:54.734+09:00 @id: 2, @firstName: 'Yukari', @lastName: 'Apple',
103
- 2025-09-23 09:40:54.734+09:00 @birthday: 1992-03-04
104
- 2025-09-23 09:40:54.734+09:00 }
105
- 2025-09-23 09:40:54.734+09:00 ] (examples/readme-example.rb:36)
80
+ 2026-08-16 15:08:55.020+09:00 DebugTrace-rb 1.4.0 on Ruby 4.0.6 / x86_64-linux
81
+ 2026-08-16 15:08:55.020+09:00 config file: ./debugtrace.yml
82
+ 2026-08-16 15:08:55.021+09:00 logger: StdErrLogger
83
+ 2026-08-16 15:08:55.021+09:00
84
+ 2026-08-16 15:08:55.021+09:00 ______________________________ #202907 ______________________________
85
+ 2026-08-16 15:08:55.021+09:00
86
+ 2026-08-16 15:08:55.021+09:00 Enter func1 (examples/readme-example.rb:29) <- <main> (examples/readme-example.rb:34)
87
+ 2026-08-16 15:08:55.021+09:00 | Hello, World! (examples/readme-example.rb:30)
88
+ 2026-08-16 15:08:55.021+09:00 | Enter func2 (examples/readme-example.rb:20) <- block in Object#func1 (examples/readme-example.rb:31)
89
+ 2026-08-16 15:08:55.021+09:00 | | Enter Contact#initialize (examples/readme-example.rb:10) <- func2 (examples/readme-example.rb:22)
90
+ 2026-08-16 15:08:55.021+09:00 | | Leave Contact#initialize (examples/readme-example.rb:15) duration: 0.018 ms
91
+ 2026-08-16 15:08:55.021+09:00 | |
92
+ 2026-08-16 15:08:55.021+09:00 | | Enter Contact#initialize (examples/readme-example.rb:10) <- func2 (examples/readme-example.rb:23)
93
+ 2026-08-16 15:08:55.021+09:00 | | Leave Contact#initialize (examples/readme-example.rb:15) duration: 0.007 ms
94
+ 2026-08-16 15:08:55.021+09:00 | Leave func2 (examples/readme-example.rb:25) duration: 0.397 ms
95
+ 2026-08-16 15:08:55.021+09:00 Leave func1 (examples/readme-example.rb:31) duration: 0.535 ms
96
+ 2026-08-16 15:08:55.022+09:00
97
+ 2026-08-16 15:08:55.022+09:00 contacts = [
98
+ 2026-08-16 15:08:55.022+09:00 Contact{
99
+ 2026-08-16 15:08:55.022+09:00 @id: 1, @firstName: 'Akane', @lastName: 'Apple', @birthday: 1991-02-03
100
+ 2026-08-16 15:08:55.022+09:00 },
101
+ 2026-08-16 15:08:55.022+09:00 Contact{
102
+ 2026-08-16 15:08:55.022+09:00 @id: 2, @firstName: 'Yukari', @lastName: 'Apple',
103
+ 2026-08-16 15:08:55.022+09:00 @birthday: 1992-03-04
104
+ 2026-08-16 15:08:55.022+09:00 }
105
+ 2026-08-16 15:08:55.022+09:00 ] (examples/readme-example.rb:35)
106
106
  ```
107
107
 
108
108
  ### 4. List of methods
@@ -125,8 +125,8 @@ DebugTrace module has the following methods.
125
125
  </tr>
126
126
  <tr>
127
127
  <td><code>leave</code></td>
128
- <td><code>return_value</code>: return value of this method <small>(Optional)</small></td>
129
- <td><code>return_value</code> (<code>nil</code> if <code>return_value</code> is omitted)</td>
128
+ <td><code>return_value</code>: return value of this method or a lambda expression <small>(Optional)</small></td>
129
+ <td><code>return_value</code> or the evaluated value of the lambda expression (<code>nil</code> if <code>return_value</code> is omitted)</td>
130
130
  <td>Output the end of the method to the log.</td>
131
131
  </tr>
132
132
  <tr>
data/README_ja.md CHANGED
@@ -40,8 +40,7 @@ $ gem install debugtrace
40
40
  ```ruby
41
41
  # frozen_string_literal: true
42
42
  # readme-example.rb
43
- #require 'debugtrace'
44
- require_relative '../lib/debugtrace'
43
+ require 'debugtrace'
45
44
 
46
45
  class Contact
47
46
  attr_reader :id, :firstName, :lastName, :birthday
@@ -62,47 +61,46 @@ def func2
62
61
  Contact.new(1, 'Akane' , 'Apple', Date.new(1991, 2, 3)),
63
62
  Contact.new(2, 'Yukari', 'Apple', Date.new(1992, 3, 4))
64
63
  ]
65
- DebugTrace.leave(contacts)
64
+ DebugTrace.leave contacts
66
65
  end
67
66
 
68
67
  def func1
69
68
  DebugTrace.enter
70
- DebugTrace.print('Hello, World!')
71
- contacts = func2
72
- DebugTrace.leave(contacts)
69
+ DebugTrace.print'Hello, World!'
70
+ DebugTrace.leave {func2}
73
71
  end
74
72
 
75
73
  contacts = func1
76
- DebugTrace.print('contacts', contacts)
74
+ DebugTrace.print'contacts', contacts
77
75
  ```
78
76
 
79
77
  ```log
80
- 2025-09-23 09:40:54.733+09:00 DebugTrace-rb 1.3.2 on Ruby 3.4.6 / x86_64-linux
81
- 2025-09-23 09:40:54.733+09:00 config file: ./debugtrace.yml
82
- 2025-09-23 09:40:54.733+09:00 logger: StdErrLogger
83
- 2025-09-23 09:40:54.733+09:00
84
- 2025-09-23 09:40:54.733+09:00 ______________________________ #72 ______________________________
85
- 2025-09-23 09:40:54.733+09:00
86
- 2025-09-23 09:40:54.733+09:00 Enter func1 (examples/readme-example.rb:29) <- <main> (examples/readme-example.rb:35)
87
- 2025-09-23 09:40:54.733+09:00 | Hello, World! (examples/readme-example.rb:30)
88
- 2025-09-23 09:40:54.733+09:00 | Enter func2 (examples/readme-example.rb:20) <- func1 (examples/readme-example.rb:31)
89
- 2025-09-23 09:40:54.734+09:00 | | Enter Contact#initialize (examples/readme-example.rb:10) <- Class#new (examples/readme-example.rb:22)
90
- 2025-09-23 09:40:54.734+09:00 | | Leave Contact#initialize (examples/readme-example.rb:15) duration: 0.014 ms
91
- 2025-09-23 09:40:54.734+09:00 | |
92
- 2025-09-23 09:40:54.734+09:00 | | Enter Contact#initialize (examples/readme-example.rb:10) <- Class#new (examples/readme-example.rb:23)
93
- 2025-09-23 09:40:54.734+09:00 | | Leave Contact#initialize (examples/readme-example.rb:15) duration: 0.007 ms
94
- 2025-09-23 09:40:54.734+09:00 | Leave func2 (examples/readme-example.rb:25) duration: 0.206 ms
95
- 2025-09-23 09:40:54.734+09:00 Leave func1 (examples/readme-example.rb:32) duration: 0.332 ms
96
- 2025-09-23 09:40:54.734+09:00
97
- 2025-09-23 09:40:54.734+09:00 contacts = [
98
- 2025-09-23 09:40:54.734+09:00 Contact{
99
- 2025-09-23 09:40:54.734+09:00 @id: 1, @firstName: 'Akane', @lastName: 'Apple', @birthday: 1991-02-03
100
- 2025-09-23 09:40:54.734+09:00 },
101
- 2025-09-23 09:40:54.734+09:00 Contact{
102
- 2025-09-23 09:40:54.734+09:00 @id: 2, @firstName: 'Yukari', @lastName: 'Apple',
103
- 2025-09-23 09:40:54.734+09:00 @birthday: 1992-03-04
104
- 2025-09-23 09:40:54.734+09:00 }
105
- 2025-09-23 09:40:54.734+09:00 ] (examples/readme-example.rb:36)
78
+ 2026-08-16 15:08:55.020+09:00 DebugTrace-rb 1.4.0 on Ruby 4.0.6 / x86_64-linux
79
+ 2026-08-16 15:08:55.020+09:00 config file: ./debugtrace.yml
80
+ 2026-08-16 15:08:55.021+09:00 logger: StdErrLogger
81
+ 2026-08-16 15:08:55.021+09:00
82
+ 2026-08-16 15:08:55.021+09:00 ______________________________ #202907 ______________________________
83
+ 2026-08-16 15:08:55.021+09:00
84
+ 2026-08-16 15:08:55.021+09:00 Enter func1 (examples/readme-example.rb:29) <- <main> (examples/readme-example.rb:34)
85
+ 2026-08-16 15:08:55.021+09:00 | Hello, World! (examples/readme-example.rb:30)
86
+ 2026-08-16 15:08:55.021+09:00 | Enter func2 (examples/readme-example.rb:20) <- block in Object#func1 (examples/readme-example.rb:31)
87
+ 2026-08-16 15:08:55.021+09:00 | | Enter Contact#initialize (examples/readme-example.rb:10) <- func2 (examples/readme-example.rb:22)
88
+ 2026-08-16 15:08:55.021+09:00 | | Leave Contact#initialize (examples/readme-example.rb:15) duration: 0.018 ms
89
+ 2026-08-16 15:08:55.021+09:00 | |
90
+ 2026-08-16 15:08:55.021+09:00 | | Enter Contact#initialize (examples/readme-example.rb:10) <- func2 (examples/readme-example.rb:23)
91
+ 2026-08-16 15:08:55.021+09:00 | | Leave Contact#initialize (examples/readme-example.rb:15) duration: 0.007 ms
92
+ 2026-08-16 15:08:55.021+09:00 | Leave func2 (examples/readme-example.rb:25) duration: 0.397 ms
93
+ 2026-08-16 15:08:55.021+09:00 Leave func1 (examples/readme-example.rb:31) duration: 0.535 ms
94
+ 2026-08-16 15:08:55.022+09:00
95
+ 2026-08-16 15:08:55.022+09:00 contacts = [
96
+ 2026-08-16 15:08:55.022+09:00 Contact{
97
+ 2026-08-16 15:08:55.022+09:00 @id: 1, @firstName: 'Akane', @lastName: 'Apple', @birthday: 1991-02-03
98
+ 2026-08-16 15:08:55.022+09:00 },
99
+ 2026-08-16 15:08:55.022+09:00 Contact{
100
+ 2026-08-16 15:08:55.022+09:00 @id: 2, @firstName: 'Yukari', @lastName: 'Apple',
101
+ 2026-08-16 15:08:55.022+09:00 @birthday: 1992-03-04
102
+ 2026-08-16 15:08:55.022+09:00 }
103
+ 2026-08-16 15:08:55.022+09:00 ] (examples/readme-example.rb:35)
106
104
  ```
107
105
 
108
106
  ### 4. メソッド一覧
@@ -125,8 +123,8 @@ DebugTraceモジュールには以下のメソッドがあります。
125
123
  </tr>
126
124
  <tr>
127
125
  <td><code>leave</code></td>
128
- <td><code>return_value</code>: このメソッドの戻り値 <small>(省略可)</small></td>
129
- <td><code>return_value</code> <small>(引数が省略された場合は<code>nil</code>)</small></td>
126
+ <td><code>return_value</code>: このメソッドの戻り値またはラムダ式 <small>(省略可)</small></td>
127
+ <td><code>return_value</code>またはラムダ式の評価値 <small>(引数が省略された場合は<code>nil</code>)</small></td>
130
128
  <td>メソッドの終了のログを出力する</td>
131
129
  </tr>
132
130
  <tr>
@@ -570,9 +568,9 @@ debugtrace.ymlには以下のプロパティを指定できます。
570
568
  </tr>
571
569
  </table>
572
570
 
573
- ### 6. 修正履歴
571
+ ### 6. 変更履歴
574
572
 
575
- [修正履歴](CHANGELOG_ja.md)
573
+ [変更履歴](CHANGELOG_ja.md)
576
574
 
577
575
  ### 7. ライセンス
578
576
 
@@ -5,21 +5,21 @@ require_relative '../lib/debugtrace'
5
5
 
6
6
  # Array
7
7
  array1 = [1, 2, 3, 4]
8
- DebugTrace.print('array1', array1)
9
- DebugTrace.print('array1.to_s', array1.to_s)
8
+ DebugTrace.print 'array1', array1
9
+ DebugTrace.print 'array1.to_s', array1.to_s
10
10
 
11
11
  array2 = [:a, 'B', "C\n", 4]
12
- DebugTrace.print('array2', array2)
13
- DebugTrace.print('array2.to_s', array2.to_s)
12
+ DebugTrace.print 'array2', array2
13
+ DebugTrace.print 'array2.to_s', array2.to_s
14
14
 
15
15
  # Hash
16
16
  hash1 = {'a' => 'A', 'b' => 'B', 'c' => 'C', 'd' => "D\n"}
17
- DebugTrace.print('hash1', hash1)
18
- DebugTrace.print('hash1.to_s', hash1.to_s)
17
+ DebugTrace.print 'hash1', hash1
18
+ DebugTrace.print 'hash1.to_s', hash1.to_s
19
19
 
20
20
  hash2 = {a: 'A', b: 'B', c: 'C', d: "D\n"}
21
- DebugTrace.print('hash2', hash2)
22
- DebugTrace.print('hash2.to_s', hash2.to_s)
21
+ DebugTrace.print 'hash2', hash2
22
+ DebugTrace.print 'hash2.to_s', hash2.to_s
23
23
 
24
24
  # Set
25
25
  set1 = Set.new([1, 2, 3, 4])
@@ -22,15 +22,14 @@ def func2
22
22
  Contact.new(1, 'Akane' , 'Apple', Date.new(1991, 2, 3)),
23
23
  Contact.new(2, 'Yukari', 'Apple', Date.new(1992, 3, 4))
24
24
  ]
25
- DebugTrace.leave(contacts)
25
+ DebugTrace.leave contacts
26
26
  end
27
27
 
28
28
  def func1
29
29
  DebugTrace.enter
30
- DebugTrace.print('Hello, World!')
31
- contacts = func2
32
- DebugTrace.leave(contacts)
30
+ DebugTrace.print'Hello, World!'
31
+ DebugTrace.leave {func2}
33
32
  end
34
33
 
35
34
  contacts = func1
36
- DebugTrace.print('contacts', contacts)
35
+ DebugTrace.print'contacts', contacts
@@ -11,7 +11,7 @@ class State
11
11
 
12
12
  # Initializes this object.
13
13
  #
14
- # @param thread_id [Integer] the object id of the thread
14
+ # @param thread_id [Integer] the native thread id
15
15
  def initialize(thread_id)
16
16
  @thread_id = Common.check_type('thread_id', thread_id, Integer)
17
17
  reset()
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DebugTrace
4
- VERSION = '1.3.2'
4
+ VERSION = '1.4.0'
5
5
  end
data/lib/debugtrace.rb CHANGED
@@ -116,11 +116,11 @@ module DebugTrace
116
116
  end
117
117
  end
118
118
 
119
- # Returns the current state.
119
+ # Returns the current state (internal use, must be called with mutex held).
120
120
  #
121
121
  # @return [State] the current state
122
122
  def self.current_state
123
- thread_id = Thread.current.object_id
123
+ thread_id = Thread.current.native_thread_id
124
124
 
125
125
  if @@state_hash.key?(thread_id)
126
126
  state = @@state_hash[thread_id]
@@ -131,6 +131,7 @@ module DebugTrace
131
131
 
132
132
  return state
133
133
  end
134
+ private_class_method :current_state
134
135
 
135
136
  # Returns the current indent string.
136
137
  #
@@ -527,7 +528,7 @@ module DebugTrace
527
528
  return type_name
528
529
  end
529
530
 
530
- # Called at the start of the print method.
531
+ # Called at the start of the print method (internal, must be called with mutex held).
531
532
  def self.print_start
532
533
  if @@config == nil
533
534
  initialize
@@ -535,7 +536,7 @@ module DebugTrace
535
536
  return unless @@config.enabled?
536
537
 
537
538
  thread = Thread.current
538
- thread_id = thread.object_id
539
+ thread_id = thread.native_thread_id
539
540
  return unless thread_id != @@before_thread_id
540
541
 
541
542
  # Thread changing
@@ -544,6 +545,7 @@ module DebugTrace
544
545
  @@logger.print('')
545
546
  @@before_thread_id = thread_id
546
547
  end
548
+ private_class_method :print_start
547
549
 
548
550
  # Prints the message or the value.
549
551
  #
@@ -633,12 +635,21 @@ module DebugTrace
633
635
 
634
636
  # Prints the end of the method.
635
637
  #
636
- # @option [Object] the return value
637
- # @return [Object] return_value if specified, otherwise nil
638
- def self.leave(return_value = nil)
638
+ # @param return_value [Object, Proc] the return value, or a lambda/proc to execute
639
+ # @param block [Proc] a block passed as an implicit argument
640
+ # @return [Object] the return value (or result of the lambda/proc or block if provided)
641
+ def self.leave(return_value = nil, &block)
642
+ result = if block_given?
643
+ block.call
644
+ elsif return_value.is_a?(Proc)
645
+ return_value.call
646
+ else
647
+ return_value
648
+ end
649
+
639
650
  @@thread_mutex.synchronize do
640
651
  print_start
641
- return return_value unless @@config.enabled?
652
+ return result unless @@config.enabled?
642
653
 
643
654
  state = current_state
644
655
  location = Location.new(caller_locations(3, 3)[0])
@@ -656,19 +667,19 @@ module DebugTrace
656
667
  @@last_log_buff.line_feed
657
668
  @@logger.print(get_indent_string(state.nest_level, 0) + @@last_log_buff.lines[0].log)
658
669
  end
659
- return return_value
670
+
671
+ return result
660
672
  end
661
673
 
662
674
  # Returns the last print string.
663
675
  def self.last_print_string
664
- lines = @@last_log_buff.lines
665
- buff_string = lines.map { |line| @@config.data_indent_string * line.nest_level + line.log }.join("\n")
666
-
667
- state = nil
668
676
  @@thread_mutex.synchronize do
677
+ lines = @@last_log_buff.lines
678
+ buff_string = lines.map { |line| @@config.data_indent_string * line.nest_level + line.log }.join("\n")
679
+
669
680
  state = current_state
670
- end
671
681
 
672
- return "#{get_indent_string(state.nest_level, 0)}#{buff_string}"
682
+ return "#{get_indent_string(state.nest_level, 0)}#{buff_string}"
683
+ end
673
684
  end
674
685
  end
metadata CHANGED
@@ -1,14 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: debugtrace
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masato Kokubo
8
8
  bindir: exe
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
- dependencies: []
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: logger
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '0'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '0'
12
26
  description: Insert DebugTrace.enter and Debug.leave at the beginning and end of the
13
27
  function you want to debug, and Debug.print('foo', foo) if there are any variables
14
28
  you want to display.
@@ -58,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
58
72
  - !ruby/object:Gem::Version
59
73
  version: '0'
60
74
  requirements: []
61
- rubygems_version: 3.7.2
75
+ rubygems_version: 4.0.16
62
76
  specification_version: 4
63
77
  summary: DebugTrace-rb is a library that helps debug ruby programs.
64
78
  test_files: []