debugtrace 1.1.1 → 1.1.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 +6 -3
- data/CHANGELOG_ja.md +7 -6
- data/lib/debugtrace/version.rb +1 -1
- data/lib/debugtrace.rb +21 -17
- 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: d0fd5212be7e014267a9795f6de78a3cc53f3c04d9f7214cddc798c36be0e746
|
4
|
+
data.tar.gz: d21287e1f2d00d7fb65b3b486aa7a7c4a115c9f795b5efad4f3b74a6b69fa1fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b737dacef0b6a82c8acd25cd6117432313e931d2181f8c1be1557534e9e97e311dec5ecbd10eedd85da914dacb27805abf660f0e790ba7dad1c7dfa7c58260a
|
7
|
+
data.tar.gz: 64e246128f381dd3e8058d524b3878e0017f9db4d99b42deed5fb8c9aeb06d3a4216a51bc7360e5e51be3fdc9bfb58317e86e8ae639359562f45d6de63a9e30f
|
data/CHANGELOG.md
CHANGED
@@ -1,11 +1,14 @@
|
|
1
|
+
## 1.1.2 - July 2, 2025
|
2
|
+
|
3
|
+
Fixed a bug that caused exceptions to be thrown by the `print` methods depending on the conditions.
|
4
|
+
|
1
5
|
## 1.1.1 - July 1, 2025
|
2
6
|
|
3
|
-
|
4
|
-
* Fixed a bug that caused exceptions to be thrown by the `enter`, `leave` and `print` methods depending on the conditions.
|
7
|
+
Fixed a bug that caused exceptions to be thrown by the `enter`, `leave` and `print` methods depending on the conditions.
|
5
8
|
|
6
9
|
## 1.1.0 - May 25, 2025
|
7
10
|
|
8
|
-
### Bug
|
11
|
+
### Bug fix
|
9
12
|
|
10
13
|
* Fixed a bug where line breaks were not inserted between elements when outputting `Array`, `Hash`, and `Set` using the print method.
|
11
14
|
|
data/CHANGELOG_ja.md
CHANGED
@@ -1,13 +1,14 @@
|
|
1
|
+
## 1.1.2 - 2025/7/2
|
2
|
+
|
3
|
+
条件によって`print`メソッドで例外がスローされるバグを修正。
|
4
|
+
|
1
5
|
## 1.1.1 - 2025/7/1
|
2
6
|
|
3
|
-
|
4
|
-
* 条件によって`enter`, `leave`, `print`メソッドで例外がスローされるバグを修正。
|
7
|
+
条件によって`enter`, `leave`, `print`メソッドで例外がスローされるバグを修正。
|
5
8
|
|
6
9
|
## 1.1.0 - 2025/5/25
|
7
10
|
|
8
|
-
|
9
|
-
|
10
|
-
* `print`メソッドで`Array`, `Hash`および`Set`を出力する場合に要素間での改行が行われないバグの修正。
|
11
|
+
`print`メソッドで`Array`, `Hash`および`Set`を出力する場合に要素間での改行が行われないバグの修正。
|
11
12
|
|
12
13
|
#### 仕様変更
|
13
14
|
|
@@ -17,7 +18,7 @@
|
|
17
18
|
|
18
19
|
## 1.0.1 - 2025/5/19
|
19
20
|
|
20
|
-
環境変数 `DEBUGTRACE_CONFIG`
|
21
|
+
環境変数 `DEBUGTRACE_CONFIG` が設定されていない場合にエラーが発生するバグを修正。
|
21
22
|
|
22
23
|
## 1.0.0 - 2025/5/18
|
23
24
|
|
data/lib/debugtrace/version.rb
CHANGED
data/lib/debugtrace.rb
CHANGED
@@ -181,25 +181,29 @@ module DebugTrace
|
|
181
181
|
buff.append_buffer(value_buff)
|
182
182
|
else
|
183
183
|
reflection = print_options.reflection || value.class.superclass == Struct
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
184
|
+
|
185
|
+
begin
|
186
|
+
to_s_string = reflection ? '' : value.to_s
|
187
|
+
if reflection || to_s_string.start_with?('#<')
|
188
|
+
# use reflection
|
189
|
+
value_buff = LogBuffer.new(@@config.data_output_width)
|
190
|
+
if @@reflected_objects.any? { |obj| value.equal?(obj) }
|
191
|
+
# cyclic reference
|
192
|
+
value_buff.no_break_append(@@config.circular_reference_string)
|
193
|
+
elsif @@reflected_objects.length > print_options.reflection_limit
|
194
|
+
# over reflection level limitation
|
195
|
+
value_buff.no_break_append(@@config.limit_string)
|
196
|
+
else
|
197
|
+
@@reflected_objects.push(value)
|
198
|
+
value_buff = to_string_reflection(value, print_options)
|
199
|
+
@@reflected_objects.pop
|
200
|
+
end
|
201
|
+
buff.append_buffer(value_buff)
|
195
202
|
else
|
196
|
-
|
197
|
-
value_buff = to_string_reflection(value, print_options)
|
198
|
-
@@reflected_objects.pop
|
203
|
+
buff.append(to_s_string)
|
199
204
|
end
|
200
|
-
|
201
|
-
|
202
|
-
buff.append(to_s_string)
|
205
|
+
rescue => e
|
206
|
+
buff.append("Raised #{e.class.to_s}: '#{e.message}'")
|
203
207
|
end
|
204
208
|
end
|
205
209
|
end
|