debugtrace 1.1.2 → 1.2.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 +4 -4
- data/CHANGELOG.md +5 -0
- data/CHANGELOG_ja.md +5 -0
- data/README.md +26 -26
- data/README_ja.md +26 -26
- data/lib/debugtrace/location.rb +8 -6
- data/lib/debugtrace/version.rb +1 -1
- data/lib/debugtrace.rb +6 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04bce05e2d9f97e7a4c0e1aa1e4b097a49cd4669615ca56e69ab197d2f2a494b
|
4
|
+
data.tar.gz: 4a6ab354ae3515f2167dd6779027f89fc49e49710a17b9d842570d8ec92a13f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c46e1e92e14d5f42f22b208b39911ff6c4f651fa15f4f5be89ace408f6e0448e2a931f1e0983d82d1a831b03f5167cbe2ccd369bf8eed6014cecbb202acdf8c8
|
7
|
+
data.tar.gz: 930dd3f482134f6e39dfc96e64f73c23f8630ac32241aa725e0ebc772c02ccae29f3911f850da5c31e02dac2a87a61af2591a4f8f414d94e09eaf3f3e138f33d
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## 1.2.0 - July 5, 2025
|
2
|
+
|
3
|
+
* Changed source file name output to a relative path from the current directory.
|
4
|
+
* Added class name to method name output.
|
5
|
+
|
1
6
|
## 1.1.2 - July 2, 2025
|
2
7
|
|
3
8
|
Fixed a bug that caused exceptions to be thrown by the `print` methods depending on the conditions.
|
data/CHANGELOG_ja.md
CHANGED
data/README.md
CHANGED
@@ -77,32 +77,32 @@ func1
|
|
77
77
|
```
|
78
78
|
|
79
79
|
```log
|
80
|
-
2025-07-
|
81
|
-
2025-07-
|
82
|
-
2025-07-
|
83
|
-
2025-07-
|
84
|
-
2025-07-
|
85
|
-
2025-07-
|
86
|
-
2025-07-
|
87
|
-
2025-07-
|
88
|
-
2025-07-
|
89
|
-
2025-07-
|
90
|
-
2025-07-
|
91
|
-
2025-07-
|
92
|
-
2025-07-
|
93
|
-
2025-07-
|
94
|
-
2025-07-
|
95
|
-
2025-07-
|
96
|
-
2025-07-
|
97
|
-
2025-07-
|
98
|
-
2025-07-
|
99
|
-
2025-07-
|
100
|
-
2025-07-
|
101
|
-
2025-07-
|
102
|
-
2025-07-
|
103
|
-
2025-07-
|
104
|
-
2025-07-
|
105
|
-
2025-07-
|
80
|
+
2025-07-05 14:38:35.412+09:00 DebugTrace-rb 1.2.0 on Ruby 3.4.4
|
81
|
+
2025-07-05 14:38:35.412+09:00 config file: <No config file>
|
82
|
+
2025-07-05 14:38:35.412+09:00 logger: StdErrLogger
|
83
|
+
2025-07-05 14:38:35.412+09:00
|
84
|
+
2025-07-05 14:38:35.412+09:00 ______________________________ #72 ______________________________
|
85
|
+
2025-07-05 14:38:35.412+09:00
|
86
|
+
2025-07-05 14:38:35.412+09:00 Enter func1 (examples/readme-example.rb:29) <- <main> (examples/readme-example.rb:35)
|
87
|
+
2025-07-05 14:38:35.412+09:00 | Hello, World! (examples/readme-example.rb:30)
|
88
|
+
2025-07-05 14:38:35.412+09:00 | Enter func2 (examples/readme-example.rb:20) <- func1 (examples/readme-example.rb:31)
|
89
|
+
2025-07-05 14:38:35.412+09:00 | | Enter Contact#initialize (examples/readme-example.rb:10) <- Class#new (examples/readme-example.rb:22)
|
90
|
+
2025-07-05 14:38:35.412+09:00 | | Leave Contact#initialize (examples/readme-example.rb:15) duration: 0.012 ms
|
91
|
+
2025-07-05 14:38:35.412+09:00 | |
|
92
|
+
2025-07-05 14:38:35.412+09:00 | | Enter Contact#initialize (examples/readme-example.rb:10) <- Class#new (examples/readme-example.rb:23)
|
93
|
+
2025-07-05 14:38:35.412+09:00 | | Leave Contact#initialize (examples/readme-example.rb:15) duration: 0.007 ms
|
94
|
+
2025-07-05 14:38:35.413+09:00 | Leave func2 (examples/readme-example.rb:25) duration: 0.234 ms
|
95
|
+
2025-07-05 14:38:35.413+09:00 Leave func1 (examples/readme-example.rb:32) duration: 0.379 ms
|
96
|
+
2025-07-05 14:38:35.413+09:00
|
97
|
+
2025-07-05 14:38:35.413+09:00 contacts = [
|
98
|
+
2025-07-05 14:38:35.413+09:00 Contact{
|
99
|
+
2025-07-05 14:38:35.413+09:00 @id: 1, @firstName: 'Akane', @lastName: 'Apple', @birthday: 1991-02-03
|
100
|
+
2025-07-05 14:38:35.413+09:00 },
|
101
|
+
2025-07-05 14:38:35.413+09:00 Contact{
|
102
|
+
2025-07-05 14:38:35.413+09:00 @id: 2, @firstName: 'Yukari', @lastName: 'Apple',
|
103
|
+
2025-07-05 14:38:35.413+09:00 @birthday: 1992-03-04
|
104
|
+
2025-07-05 14:38:35.413+09:00 }
|
105
|
+
2025-07-05 14:38:35.413+09:00 ] (examples/readme-example.rb:36)
|
106
106
|
```
|
107
107
|
|
108
108
|
### 4. List of methods
|
data/README_ja.md
CHANGED
@@ -77,32 +77,32 @@ DebugTrace.print('contacts', contacts)
|
|
77
77
|
```
|
78
78
|
|
79
79
|
```log
|
80
|
-
2025-07-
|
81
|
-
2025-07-
|
82
|
-
2025-07-
|
83
|
-
2025-07-
|
84
|
-
2025-07-
|
85
|
-
2025-07-
|
86
|
-
2025-07-
|
87
|
-
2025-07-
|
88
|
-
2025-07-
|
89
|
-
2025-07-
|
90
|
-
2025-07-
|
91
|
-
2025-07-
|
92
|
-
2025-07-
|
93
|
-
2025-07-
|
94
|
-
2025-07-
|
95
|
-
2025-07-
|
96
|
-
2025-07-
|
97
|
-
2025-07-
|
98
|
-
2025-07-
|
99
|
-
2025-07-
|
100
|
-
2025-07-
|
101
|
-
2025-07-
|
102
|
-
2025-07-
|
103
|
-
2025-07-
|
104
|
-
2025-07-
|
105
|
-
2025-07-
|
80
|
+
2025-07-05 14:38:35.412+09:00 DebugTrace-rb 1.2.0 on Ruby 3.4.4
|
81
|
+
2025-07-05 14:38:35.412+09:00 config file: <No config file>
|
82
|
+
2025-07-05 14:38:35.412+09:00 logger: StdErrLogger
|
83
|
+
2025-07-05 14:38:35.412+09:00
|
84
|
+
2025-07-05 14:38:35.412+09:00 ______________________________ #72 ______________________________
|
85
|
+
2025-07-05 14:38:35.412+09:00
|
86
|
+
2025-07-05 14:38:35.412+09:00 Enter func1 (examples/readme-example.rb:29) <- <main> (examples/readme-example.rb:35)
|
87
|
+
2025-07-05 14:38:35.412+09:00 | Hello, World! (examples/readme-example.rb:30)
|
88
|
+
2025-07-05 14:38:35.412+09:00 | Enter func2 (examples/readme-example.rb:20) <- func1 (examples/readme-example.rb:31)
|
89
|
+
2025-07-05 14:38:35.412+09:00 | | Enter Contact#initialize (examples/readme-example.rb:10) <- Class#new (examples/readme-example.rb:22)
|
90
|
+
2025-07-05 14:38:35.412+09:00 | | Leave Contact#initialize (examples/readme-example.rb:15) duration: 0.012 ms
|
91
|
+
2025-07-05 14:38:35.412+09:00 | |
|
92
|
+
2025-07-05 14:38:35.412+09:00 | | Enter Contact#initialize (examples/readme-example.rb:10) <- Class#new (examples/readme-example.rb:23)
|
93
|
+
2025-07-05 14:38:35.412+09:00 | | Leave Contact#initialize (examples/readme-example.rb:15) duration: 0.007 ms
|
94
|
+
2025-07-05 14:38:35.413+09:00 | Leave func2 (examples/readme-example.rb:25) duration: 0.234 ms
|
95
|
+
2025-07-05 14:38:35.413+09:00 Leave func1 (examples/readme-example.rb:32) duration: 0.379 ms
|
96
|
+
2025-07-05 14:38:35.413+09:00
|
97
|
+
2025-07-05 14:38:35.413+09:00 contacts = [
|
98
|
+
2025-07-05 14:38:35.413+09:00 Contact{
|
99
|
+
2025-07-05 14:38:35.413+09:00 @id: 1, @firstName: 'Akane', @lastName: 'Apple', @birthday: 1991-02-03
|
100
|
+
2025-07-05 14:38:35.413+09:00 },
|
101
|
+
2025-07-05 14:38:35.413+09:00 Contact{
|
102
|
+
2025-07-05 14:38:35.413+09:00 @id: 2, @firstName: 'Yukari', @lastName: 'Apple',
|
103
|
+
2025-07-05 14:38:35.413+09:00 @birthday: 1992-03-04
|
104
|
+
2025-07-05 14:38:35.413+09:00 }
|
105
|
+
2025-07-05 14:38:35.413+09:00 ] (examples/readme-example.rb:36)
|
106
106
|
```
|
107
107
|
|
108
108
|
### 4. メソッド一覧
|
data/lib/debugtrace/location.rb
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
# Contains source location information.
|
6
6
|
class Location
|
7
7
|
attr_reader :name
|
8
|
-
attr_reader :
|
8
|
+
attr_reader :path
|
9
9
|
attr_reader :lineno
|
10
10
|
|
11
11
|
# Initializes this object.
|
@@ -14,12 +14,14 @@ class Location
|
|
14
14
|
def initialize(caller_location)
|
15
15
|
if caller_location == nil
|
16
16
|
@name = 'unknown'
|
17
|
-
@
|
17
|
+
@path = 'unknown'
|
18
18
|
@lineno = 0
|
19
19
|
else
|
20
|
-
@name = caller_location.
|
21
|
-
|
22
|
-
|
20
|
+
@name = caller_location.label
|
21
|
+
if @name.start_with?('Object#')
|
22
|
+
@name = caller_location.base_label
|
23
|
+
end
|
24
|
+
@path = caller_location.path || 'unknown'
|
23
25
|
@lineno = caller_location.lineno
|
24
26
|
end
|
25
27
|
end
|
@@ -28,6 +30,6 @@ class Location
|
|
28
30
|
#
|
29
31
|
# @return [String] A string representation of this object
|
30
32
|
def to_s()
|
31
|
-
return "(Location){name: #{@name},
|
33
|
+
return "(Location){name: #{@name}, path: #{@path}, lineno: #{@lineno}"
|
32
34
|
end
|
33
35
|
end
|
data/lib/debugtrace/version.rb
CHANGED
data/lib/debugtrace.rb
CHANGED
@@ -574,7 +574,7 @@ module DebugTrace
|
|
574
574
|
location = Location.new(caller_locations(3, 3)[0])
|
575
575
|
|
576
576
|
@@last_log_buff.no_break_append(
|
577
|
-
format(@@config.print_suffix_format, location.name, location.
|
577
|
+
format(@@config.print_suffix_format, location.name, location.path, location.lineno)
|
578
578
|
)
|
579
579
|
|
580
580
|
@@last_log_buff.line_feed
|
@@ -609,14 +609,15 @@ module DebugTrace
|
|
609
609
|
@@last_log_buff = LogBuffer.new(@@config.data_output_width)
|
610
610
|
@@last_log_buff.no_break_append(
|
611
611
|
format(@@config.enter_format,
|
612
|
-
location.name, location.
|
613
|
-
parent_location.name, parent_location.
|
612
|
+
location.name, location.path, location.lineno,
|
613
|
+
parent_location.name, parent_location.path, parent_location.lineno)
|
614
614
|
)
|
615
615
|
@@last_log_buff.line_feed
|
616
616
|
@@logger.print(indent_string + @@last_log_buff.lines[0].log)
|
617
617
|
|
618
618
|
state.up_nest
|
619
619
|
end
|
620
|
+
return nil
|
620
621
|
end
|
621
622
|
|
622
623
|
# Prints the end of the method.
|
@@ -639,12 +640,12 @@ module DebugTrace
|
|
639
640
|
|
640
641
|
@@last_log_buff = LogBuffer.new(@@config.data_output_width)
|
641
642
|
@@last_log_buff.no_break_append(
|
642
|
-
format(@@config.leave_format, location.name, location.
|
643
|
+
format(@@config.leave_format, location.name, location.path, location.lineno, time)
|
643
644
|
)
|
644
645
|
@@last_log_buff.line_feed
|
645
646
|
@@logger.print(get_indent_string(state.nest_level, 0) + @@last_log_buff.lines[0].log)
|
646
|
-
return return_value
|
647
647
|
end
|
648
|
+
return return_value
|
648
649
|
end
|
649
650
|
|
650
651
|
# Returns the last print string.
|