debugtrace 1.3.1 → 1.3.2
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 +3 -0
- data/CHANGELOG_ja.md +3 -0
- data/README.md +26 -26
- data/README_ja.md +26 -26
- data/examples/enumerable-example.rb +27 -0
- data/lib/debugtrace/location.rb +4 -0
- data/lib/debugtrace/version.rb +1 -1
- data/lib/debugtrace.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f351de13b8fc8844e234a3725e9af20f9dcba4ecbcf73490a24ebbdeb698eb7f
|
4
|
+
data.tar.gz: 305ee479e282fa2ade876ef77e6208b5f01d2e71746a8107847901d052c43a77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22936ed6dcd7efd2933b83ed5b3d4081a0aa934c314dae86878933bcb86230d1c5be77921a5cce1ebc941a9696845534552f570e148a4ad1e185b4f6461eb62e
|
7
|
+
data.tar.gz: 69f25a8bf99c9e788192cb9c743ab55a2ac984ca1f67f6ab3da9164b8186eb48650ceda79bd939d9cb274082f4bd64911f323644648ec782f8765247361b94e0
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## 1.3.2 - September 19, 2025
|
2
|
+
* 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
|
+
|
1
4
|
## 1.3.1 - July 15, 2025
|
2
5
|
* Even if `string_as_bytes: true` is specified in the `print` method, if the string encoding is not `ASCII_8BIT`, it will be output as a normal string.
|
3
6
|
* If an exception is thrown when trying to output as a normal string, it will be output in hexadecimal.
|
data/CHANGELOG_ja.md
CHANGED
data/README.md
CHANGED
@@ -77,32 +77,32 @@ func1
|
|
77
77
|
```
|
78
78
|
|
79
79
|
```log
|
80
|
-
2025-
|
81
|
-
2025-
|
82
|
-
2025-
|
83
|
-
2025-
|
84
|
-
2025-
|
85
|
-
2025-
|
86
|
-
2025-
|
87
|
-
2025-
|
88
|
-
2025-
|
89
|
-
2025-
|
90
|
-
2025-
|
91
|
-
2025-
|
92
|
-
2025-
|
93
|
-
2025-
|
94
|
-
2025-
|
95
|
-
2025-
|
96
|
-
2025-
|
97
|
-
2025-
|
98
|
-
2025-
|
99
|
-
2025-
|
100
|
-
2025-
|
101
|
-
2025-
|
102
|
-
2025-
|
103
|
-
2025-
|
104
|
-
2025-
|
105
|
-
2025-
|
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)
|
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-
|
81
|
-
2025-
|
82
|
-
2025-
|
83
|
-
2025-
|
84
|
-
2025-
|
85
|
-
2025-
|
86
|
-
2025-
|
87
|
-
2025-
|
88
|
-
2025-
|
89
|
-
2025-
|
90
|
-
2025-
|
91
|
-
2025-
|
92
|
-
2025-
|
93
|
-
2025-
|
94
|
-
2025-
|
95
|
-
2025-
|
96
|
-
2025-
|
97
|
-
2025-
|
98
|
-
2025-
|
99
|
-
2025-
|
100
|
-
2025-
|
101
|
-
2025-
|
102
|
-
2025-
|
103
|
-
2025-
|
104
|
-
2025-
|
105
|
-
2025-
|
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)
|
106
106
|
```
|
107
107
|
|
108
108
|
### 4. メソッド一覧
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# enumerable-example.rb
|
3
|
+
#require 'debugtrace'
|
4
|
+
require_relative '../lib/debugtrace'
|
5
|
+
|
6
|
+
# Array
|
7
|
+
array1 = [1, 2, 3, 4]
|
8
|
+
DebugTrace.print('array1', array1)
|
9
|
+
DebugTrace.print('array1.to_s', array1.to_s)
|
10
|
+
|
11
|
+
array2 = [:a, 'B', "C\n", 4]
|
12
|
+
DebugTrace.print('array2', array2)
|
13
|
+
DebugTrace.print('array2.to_s', array2.to_s)
|
14
|
+
|
15
|
+
# Hash
|
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)
|
19
|
+
|
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)
|
23
|
+
|
24
|
+
# Set
|
25
|
+
set1 = Set.new([1, 2, 3, 4])
|
26
|
+
DebugTrace.print('set1', set1)
|
27
|
+
DebugTrace.print('set1.to_s', set1.to_s)
|
data/lib/debugtrace/location.rb
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
|
5
5
|
# Contains source location information.
|
6
6
|
class Location
|
7
|
+
@@current_dir = Dir.pwd + '/'
|
7
8
|
attr_reader :name
|
8
9
|
attr_reader :path
|
9
10
|
attr_reader :lineno
|
@@ -22,6 +23,9 @@ class Location
|
|
22
23
|
@name = caller_location.base_label
|
23
24
|
end
|
24
25
|
@path = caller_location.path || 'unknown'
|
26
|
+
if @path.start_with?(@@current_dir)
|
27
|
+
@path = @path[@@current_dir.length..-1]
|
28
|
+
end
|
25
29
|
@lineno = caller_location.lineno
|
26
30
|
end
|
27
31
|
end
|
data/lib/debugtrace/version.rb
CHANGED
data/lib/debugtrace.rb
CHANGED
@@ -78,7 +78,7 @@ module DebugTrace
|
|
78
78
|
|
79
79
|
return unless @@config.enabled?
|
80
80
|
|
81
|
-
@@logger.print("DebugTrace-rb #{DebugTrace::VERSION} on Ruby #{RUBY_VERSION}")
|
81
|
+
@@logger.print("DebugTrace-rb #{DebugTrace::VERSION} on Ruby #{RUBY_VERSION} / #{RUBY_PLATFORM}")
|
82
82
|
@@logger.print(" config file: #{config_path}")
|
83
83
|
@@logger.print(" logger: #{@@logger}")
|
84
84
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: debugtrace
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masato Kokubo
|
@@ -26,6 +26,7 @@ files:
|
|
26
26
|
- README_ja.md
|
27
27
|
- Rakefile
|
28
28
|
- examples/debugtrace.yml
|
29
|
+
- examples/enumerable-example.rb
|
29
30
|
- examples/readme-example.rb
|
30
31
|
- lib/debugtrace.rb
|
31
32
|
- lib/debugtrace/common.rb
|
@@ -57,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
57
58
|
- !ruby/object:Gem::Version
|
58
59
|
version: '0'
|
59
60
|
requirements: []
|
60
|
-
rubygems_version: 3.
|
61
|
+
rubygems_version: 3.7.2
|
61
62
|
specification_version: 4
|
62
63
|
summary: DebugTrace-rb is a library that helps debug ruby programs.
|
63
64
|
test_files: []
|