debugtrace 0.2.1 → 0.2.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/lib/debugtrace/version.rb +1 -1
- data/lib/debugtrace.rb +13 -24
- 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: 5937a3c3f6b9d19ab3bb040ef763ada32e262c5046532331a7082f3edc3128cb
|
4
|
+
data.tar.gz: 31b5c3027993f50d06409ec9c54d55adff5e68563a8f02b66ae6e618027ec550
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33e2b5d74dcfcabfc0868652118694478e47ad5c6066e70c75090b50db7dc61008cfdfe5d4a9b438d7d7a2df91be97110d3766bfbbbd43536dfbaeacf0414c22
|
7
|
+
data.tar.gz: bd78a8be204cd636d3104d06e3ff777ade2458f0492c5e50fd6f115f7108d290d4348cf02454721ca2680ef6a872455122b50e95fa836e8f9ed7efb1a17e7e6b
|
data/lib/debugtrace/version.rb
CHANGED
data/lib/debugtrace.rb
CHANGED
@@ -64,12 +64,10 @@ module DebugTrace
|
|
64
64
|
end
|
65
65
|
|
66
66
|
class PrintOptions
|
67
|
-
attr_reader :
|
68
|
-
:minimum_output_count, :minimum_output_length,
|
67
|
+
attr_reader :minimum_output_count, :minimum_output_length,
|
69
68
|
:collection_limit, :bytes_limit, :string_limit, :reflection_limit
|
70
69
|
|
71
70
|
def initialize(
|
72
|
-
reflection,
|
73
71
|
minimum_output_count,
|
74
72
|
minimum_output_length,
|
75
73
|
collection_limit,
|
@@ -77,7 +75,6 @@ module DebugTrace
|
|
77
75
|
string_limit,
|
78
76
|
reflection_limit
|
79
77
|
)
|
80
|
-
@reflection = reflection
|
81
78
|
@minimum_output_count = minimum_output_count == -1 ? DebugTrace.config.minimum_output_count : minimum_output_count
|
82
79
|
@minimum_output_length = minimum_output_length == -1 ? DebugTrace.config.minimum_output_length : minimum_output_length
|
83
80
|
@collection_limit = collection_limit == -1 ? DebugTrace.config.collection_limit : collection_limit
|
@@ -133,27 +130,20 @@ module DebugTrace
|
|
133
130
|
value_buff = to_string_enumerable(value, print_options)
|
134
131
|
buff.append_buffer(separator, value_buff)
|
135
132
|
else
|
133
|
+
# use reflection
|
136
134
|
value_buff = LogBuffer.new(@@config.maximum_data_output_width)
|
137
|
-
if
|
138
|
-
#
|
139
|
-
value_buff.
|
140
|
-
|
141
|
-
|
135
|
+
if @@reflected_objects.any? { |obj| value.equal?(obj) }
|
136
|
+
# cyclic reference
|
137
|
+
value_buff.no_break_append(@@config.cyclic_reference_string)
|
138
|
+
elsif @@reflected_objects.length > print_options.reflection_limit
|
139
|
+
# over reflection level limitation
|
140
|
+
value_buff.no_break_append(@@config.limit_string)
|
142
141
|
else
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
value_buff.no_break_append(@@config.cyclic_reference_string)
|
147
|
-
elsif @@reflected_objects.length > print_options.reflection_limit
|
148
|
-
# over reflection level limitation
|
149
|
-
value_buff.no_break_append(@@config.limit_string)
|
150
|
-
else
|
151
|
-
@@reflected_objects.push(value)
|
152
|
-
value_buff = to_string_reflection(value, print_options)
|
153
|
-
@@reflected_objects.pop
|
154
|
-
end
|
155
|
-
buff.append_buffer(separator, value_buff)
|
142
|
+
@@reflected_objects.push(value)
|
143
|
+
value_buff = to_string_reflection(value, print_options)
|
144
|
+
@@reflected_objects.pop
|
156
145
|
end
|
146
|
+
buff.append_buffer(separator, value_buff)
|
157
147
|
end
|
158
148
|
|
159
149
|
buff
|
@@ -462,7 +452,7 @@ module DebugTrace
|
|
462
452
|
|
463
453
|
@@DO_NOT_OUTPUT = 'Do not output'
|
464
454
|
|
465
|
-
def self.print(name, value = @@DO_NOT_OUTPUT,
|
455
|
+
def self.print(name, value = @@DO_NOT_OUTPUT,
|
466
456
|
minimum_output_count: -1, minimum_output_length: -1,
|
467
457
|
collection_limit: -1, bytes_limit: -1,
|
468
458
|
string_limit: -1, reflection_limit: -1)
|
@@ -482,7 +472,6 @@ module DebugTrace
|
|
482
472
|
else
|
483
473
|
# with value
|
484
474
|
print_options = PrintOptions.new(
|
485
|
-
reflection,
|
486
475
|
minimum_output_count, minimum_output_length,
|
487
476
|
collection_limit, bytes_limit,
|
488
477
|
string_limit, reflection_limit
|