enhanced_errors 3.0.3 → 3.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +43 -35
- data/benchmark/benchmark.rb +31 -29
- data/benchmark/memory_bench.rb +1 -1
- data/benchmark/result.txt +11 -0
- data/doc/Enhanced/Colors.html +2 -2
- data/doc/Enhanced/Context.html +283 -0
- data/doc/Enhanced/ExceptionBindingInfos.html +249 -0
- data/doc/Enhanced/ExceptionContext.html +397 -0
- data/doc/Enhanced.html +8 -4
- data/doc/EnhancedErrors.html +395 -275
- data/doc/EnhancedExceptionContext.html +15 -15
- data/doc/Exception.html +5 -5
- data/doc/ExceptionBindingInfos.html +2 -2
- data/doc/Minitest.html +3 -3
- data/doc/_index.html +12 -6
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +39 -44
- data/doc/index.html +39 -44
- data/doc/method_list.html +34 -18
- data/doc/top-level-namespace.html +18 -8
- data/enhanced_errors.gemspec +1 -1
- data/lib/enhanced/context.rb +7 -5
- data/lib/enhanced/exception.rb +35 -36
- data/lib/enhanced/exception_context.rb +49 -0
- data/lib/enhanced/minitest_patch.rb +1 -1
- data/lib/enhanced_errors.rb +147 -98
- metadata +8 -13
- data/.yardoc/checksums +0 -6
- data/.yardoc/complete +0 -0
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/lib/enhanced/enhanced_exception_context.rb +0 -47
@@ -4,7 +4,7 @@
|
|
4
4
|
<meta charset="utf-8">
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
6
|
<title>
|
7
|
-
Module:
|
7
|
+
Module: Enhanced::ExceptionContext
|
8
8
|
|
9
9
|
— Documentation by YARD 0.9.37
|
10
10
|
|
@@ -15,7 +15,7 @@
|
|
15
15
|
<link rel="stylesheet" href="css/common.css" type="text/css" />
|
16
16
|
|
17
17
|
<script type="text/javascript">
|
18
|
-
pathId = "
|
18
|
+
pathId = "Enhanced::ExceptionContext";
|
19
19
|
relpath = '';
|
20
20
|
</script>
|
21
21
|
|
@@ -39,7 +39,7 @@
|
|
39
39
|
<a href="_index.html">Index (E)</a> »
|
40
40
|
|
41
41
|
|
42
|
-
<span class="title">
|
42
|
+
<span class="title">Enhanced::ExceptionContext</span>
|
43
43
|
|
44
44
|
</div>
|
45
45
|
|
@@ -59,7 +59,7 @@
|
|
59
59
|
<div class="clear"></div>
|
60
60
|
</div>
|
61
61
|
|
62
|
-
<div id="content"><h1>Module:
|
62
|
+
<div id="content"><h1>Module: Enhanced::ExceptionContext
|
63
63
|
|
64
64
|
|
65
65
|
|
@@ -71,7 +71,7 @@
|
|
71
71
|
|
72
72
|
<dl>
|
73
73
|
<dt>Extended by:</dt>
|
74
|
-
<dd><span class='object_link'><a href="" title="
|
74
|
+
<dd><span class='object_link'><a href="" title="Enhanced::ExceptionContext (module)">Enhanced::ExceptionContext</a></span></dd>
|
75
75
|
</dl>
|
76
76
|
|
77
77
|
|
@@ -81,7 +81,7 @@
|
|
81
81
|
|
82
82
|
<dl>
|
83
83
|
<dt>Included in:</dt>
|
84
|
-
<dd><span class='object_link'><a href="" title="
|
84
|
+
<dd><span class='object_link'><a href="" title="Enhanced::ExceptionContext (module)">Enhanced::ExceptionContext</a></span></dd>
|
85
85
|
</dl>
|
86
86
|
|
87
87
|
|
@@ -251,8 +251,8 @@
|
|
251
251
|
<pre class="code"><span class="info file"># File 'lib/enhanced/enhanced_exception_context.rb', line 42</span>
|
252
252
|
|
253
253
|
<span class='kw'>def</span> <span class='id identifier rubyid_clear_all'>clear_all</span>
|
254
|
-
<span class='const'><span class='object_link'><a href="#MUTEX-constant" title="
|
255
|
-
<span class='const'><span class='object_link'><a href="#REGISTRY-constant" title="
|
254
|
+
<span class='const'><span class='object_link'><a href="#MUTEX-constant" title="Enhanced::ExceptionContext::MUTEX (constant)">MUTEX</a></span></span><span class='period'>.</span><span class='id identifier rubyid_synchronize'>synchronize</span> <span class='kw'>do</span>
|
255
|
+
<span class='const'><span class='object_link'><a href="#REGISTRY-constant" title="Enhanced::ExceptionContext::REGISTRY (constant)">REGISTRY</a></span></span><span class='period'>.</span><span class='id identifier rubyid_clear'>clear</span>
|
256
256
|
<span class='kw'>end</span>
|
257
257
|
<span class='kw'>end</span></pre>
|
258
258
|
</td>
|
@@ -285,8 +285,8 @@
|
|
285
285
|
<pre class="code"><span class="info file"># File 'lib/enhanced/enhanced_exception_context.rb', line 36</span>
|
286
286
|
|
287
287
|
<span class='kw'>def</span> <span class='id identifier rubyid_clear_context'>clear_context</span><span class='lparen'>(</span><span class='id identifier rubyid_exception'>exception</span><span class='rparen'>)</span>
|
288
|
-
<span class='const'><span class='object_link'><a href="#MUTEX-constant" title="
|
289
|
-
<span class='const'><span class='object_link'><a href="#REGISTRY-constant" title="
|
288
|
+
<span class='const'><span class='object_link'><a href="#MUTEX-constant" title="Enhanced::ExceptionContext::MUTEX (constant)">MUTEX</a></span></span><span class='period'>.</span><span class='id identifier rubyid_synchronize'>synchronize</span> <span class='kw'>do</span>
|
289
|
+
<span class='const'><span class='object_link'><a href="#REGISTRY-constant" title="Enhanced::ExceptionContext::REGISTRY (constant)">REGISTRY</a></span></span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_exception'>exception</span><span class='period'>.</span><span class='id identifier rubyid_object_id'>object_id</span><span class='rparen'>)</span>
|
290
290
|
<span class='kw'>end</span>
|
291
291
|
<span class='kw'>end</span></pre>
|
292
292
|
</td>
|
@@ -329,8 +329,8 @@
|
|
329
329
|
<pre class="code"><span class="info file"># File 'lib/enhanced/enhanced_exception_context.rb', line 20</span>
|
330
330
|
|
331
331
|
<span class='kw'>def</span> <span class='id identifier rubyid_context_for'>context_for</span><span class='lparen'>(</span><span class='id identifier rubyid_exception'>exception</span><span class='rparen'>)</span>
|
332
|
-
<span class='const'><span class='object_link'><a href="#MUTEX-constant" title="
|
333
|
-
<span class='id identifier rubyid_entry'>entry</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="#REGISTRY-constant" title="
|
332
|
+
<span class='const'><span class='object_link'><a href="#MUTEX-constant" title="Enhanced::ExceptionContext::MUTEX (constant)">MUTEX</a></span></span><span class='period'>.</span><span class='id identifier rubyid_synchronize'>synchronize</span> <span class='kw'>do</span>
|
333
|
+
<span class='id identifier rubyid_entry'>entry</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="#REGISTRY-constant" title="Enhanced::ExceptionContext::REGISTRY (constant)">REGISTRY</a></span></span><span class='lbracket'>[</span><span class='id identifier rubyid_exception'>exception</span><span class='period'>.</span><span class='id identifier rubyid_object_id'>object_id</span><span class='rbracket'>]</span>
|
334
334
|
<span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>unless</span> <span class='id identifier rubyid_entry'>entry</span>
|
335
335
|
|
336
336
|
<span class='kw'>begin</span>
|
@@ -338,7 +338,7 @@
|
|
338
338
|
</span> <span class='id identifier rubyid_entry'>entry</span><span class='lbracket'>[</span><span class='symbol'>:context</span><span class='rbracket'>]</span>
|
339
339
|
<span class='kw'>rescue</span> <span class='const'>RefError</span>
|
340
340
|
<span class='comment'># Exception no longer alive, clean up
|
341
|
-
</span> <span class='const'><span class='object_link'><a href="#REGISTRY-constant" title="
|
341
|
+
</span> <span class='const'><span class='object_link'><a href="#REGISTRY-constant" title="Enhanced::ExceptionContext::REGISTRY (constant)">REGISTRY</a></span></span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_exception'>exception</span><span class='period'>.</span><span class='id identifier rubyid_object_id'>object_id</span><span class='rparen'>)</span>
|
342
342
|
<span class='kw'>nil</span>
|
343
343
|
<span class='kw'>end</span>
|
344
344
|
<span class='kw'>end</span>
|
@@ -373,8 +373,8 @@
|
|
373
373
|
<pre class="code"><span class="info file"># File 'lib/enhanced/enhanced_exception_context.rb', line 14</span>
|
374
374
|
|
375
375
|
<span class='kw'>def</span> <span class='id identifier rubyid_store_context'>store_context</span><span class='lparen'>(</span><span class='id identifier rubyid_exception'>exception</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
376
|
-
<span class='const'><span class='object_link'><a href="#MUTEX-constant" title="
|
377
|
-
<span class='const'><span class='object_link'><a href="#REGISTRY-constant" title="
|
376
|
+
<span class='const'><span class='object_link'><a href="#MUTEX-constant" title="Enhanced::ExceptionContext::MUTEX (constant)">MUTEX</a></span></span><span class='period'>.</span><span class='id identifier rubyid_synchronize'>synchronize</span> <span class='kw'>do</span>
|
377
|
+
<span class='const'><span class='object_link'><a href="#REGISTRY-constant" title="Enhanced::ExceptionContext::REGISTRY (constant)">REGISTRY</a></span></span><span class='lbracket'>[</span><span class='id identifier rubyid_exception'>exception</span><span class='period'>.</span><span class='id identifier rubyid_object_id'>object_id</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>weak_exc:</span> <span class='const'>WeakRef</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_exception'>exception</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='label'>context:</span> <span class='id identifier rubyid_context'>context</span> <span class='rbrace'>}</span>
|
378
378
|
<span class='kw'>end</span>
|
379
379
|
<span class='kw'>end</span></pre>
|
380
380
|
</td>
|
data/doc/Exception.html
CHANGED
@@ -73,7 +73,7 @@
|
|
73
73
|
|
74
74
|
<dl>
|
75
75
|
<dt>Includes:</dt>
|
76
|
-
<dd><span class='object_link'><a href="ExceptionBindingInfos.html" title="ExceptionBindingInfos (module)">ExceptionBindingInfos</a></span></dd>
|
76
|
+
<dd><span class='object_link'><a href="Enhanced/ExceptionBindingInfos.html" title="Enhanced::ExceptionBindingInfos (module)">Enhanced::ExceptionBindingInfos</a></span></dd>
|
77
77
|
</dl>
|
78
78
|
|
79
79
|
|
@@ -104,16 +104,16 @@
|
|
104
104
|
|
105
105
|
<h2>Method Summary</h2>
|
106
106
|
|
107
|
-
<h3 class="inherited">Methods included from <span class='object_link'><a href="ExceptionBindingInfos.html" title="ExceptionBindingInfos (module)">ExceptionBindingInfos</a></span></h3>
|
108
|
-
<p class="inherited"><span class='object_link'><a href="ExceptionBindingInfos.html#binding_infos-instance_method" title="ExceptionBindingInfos#binding_infos (method)">#binding_infos</a></span>, <span class='object_link'><a href="ExceptionBindingInfos.html#captured_variables-instance_method" title="ExceptionBindingInfos#captured_variables (method)">#captured_variables</a></span></p>
|
107
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="Enhanced/ExceptionBindingInfos.html" title="Enhanced::ExceptionBindingInfos (module)">Enhanced::ExceptionBindingInfos</a></span></h3>
|
108
|
+
<p class="inherited"><span class='object_link'><a href="Enhanced/ExceptionBindingInfos.html#binding_infos-instance_method" title="Enhanced::ExceptionBindingInfos#binding_infos (method)">#binding_infos</a></span>, <span class='object_link'><a href="Enhanced/ExceptionBindingInfos.html#captured_variables-instance_method" title="Enhanced::ExceptionBindingInfos#captured_variables (method)">#captured_variables</a></span></p>
|
109
109
|
|
110
110
|
|
111
111
|
</div>
|
112
112
|
|
113
113
|
<div id="footer">
|
114
|
-
Generated on
|
114
|
+
Generated on Wed Dec 25 13:01:48 2024 by
|
115
115
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
116
|
-
0.9.37 (ruby-3.
|
116
|
+
0.9.37 (ruby-3.4.1).
|
117
117
|
</div>
|
118
118
|
|
119
119
|
</div>
|
@@ -184,10 +184,10 @@
|
|
184
184
|
<pre class="code"><span class="info file"># File 'lib/enhanced/exception.rb', line 5</span>
|
185
185
|
|
186
186
|
<span class='kw'>def</span> <span class='id identifier rubyid_binding_infos'>binding_infos</span>
|
187
|
-
<span class='id identifier rubyid_ctx'>ctx</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="
|
187
|
+
<span class='id identifier rubyid_ctx'>ctx</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Enhanced::ExceptionContext.html" title="Enhanced::ExceptionContext (module)">Enhanced::ExceptionContext</a></span></span><span class='period'>.</span><span class='id identifier rubyid_context_for'><span class='object_link'><a href="Enhanced::ExceptionContext.html#context_for-instance_method" title="Enhanced::ExceptionContext#context_for (method)">context_for</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
|
188
188
|
<span class='kw'>unless</span> <span class='id identifier rubyid_ctx'>ctx</span>
|
189
189
|
<span class='id identifier rubyid_ctx'>ctx</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Context.html" title="Context (class)">Context</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Context.html#initialize-instance_method" title="Context#initialize (method)">new</a></span></span>
|
190
|
-
<span class='const'><span class='object_link'><a href="
|
190
|
+
<span class='const'><span class='object_link'><a href="Enhanced::ExceptionContext.html" title="Enhanced::ExceptionContext (module)">Enhanced::ExceptionContext</a></span></span><span class='period'>.</span><span class='id identifier rubyid_store_context'><span class='object_link'><a href="Enhanced::ExceptionContext.html#store_context-instance_method" title="Enhanced::ExceptionContext#store_context (method)">store_context</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_ctx'>ctx</span><span class='rparen'>)</span>
|
191
191
|
<span class='kw'>end</span>
|
192
192
|
<span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_binding_infos'>binding_infos</span>
|
193
193
|
<span class='kw'>end</span></pre>
|
data/doc/Minitest.html
CHANGED
@@ -215,7 +215,7 @@
|
|
215
215
|
<span class='kw'>begin</span>
|
216
216
|
<span class='id identifier rubyid_binding_infos'>binding_infos</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="EnhancedErrors.html" title="EnhancedErrors (class)">EnhancedErrors</a></span></span><span class='period'>.</span><span class='id identifier rubyid_stop_minitest_binding_capture'><span class='object_link'><a href="EnhancedErrors.html#stop_minitest_binding_capture-class_method" title="EnhancedErrors.stop_minitest_binding_capture (method)">stop_minitest_binding_capture</a></span></span>
|
217
217
|
<span class='const'><span class='object_link'><a href="EnhancedErrors.html" title="EnhancedErrors (class)">EnhancedErrors</a></span></span><span class='period'>.</span><span class='id identifier rubyid_override_exception_message'><span class='object_link'><a href="EnhancedErrors.html#override_exception_message-class_method" title="EnhancedErrors.override_exception_message (method)">override_exception_message</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_result'>result</span><span class='period'>.</span><span class='id identifier rubyid_failures'>failures</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='comma'>,</span> <span class='id identifier rubyid_binding_infos'>binding_infos</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_result'>result</span><span class='period'>.</span><span class='id identifier rubyid_failures'>failures</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span>
|
218
|
-
<span class='const'><span class='object_link'><a href="
|
218
|
+
<span class='const'><span class='object_link'><a href="Enhanced.html" title="Enhanced (module)">Enhanced</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Enhanced/ExceptionContext.html" title="Enhanced::ExceptionContext (module)">ExceptionContext</a></span></span><span class='period'>.</span><span class='id identifier rubyid_clear_all'><span class='object_link'><a href="Enhanced/ExceptionContext.html#clear_all-instance_method" title="Enhanced::ExceptionContext#clear_all (method)">clear_all</a></span></span>
|
219
219
|
<span class='kw'>rescue</span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
|
220
220
|
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Ignored error during error enhancement: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_e'>e</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
221
221
|
<span class='kw'>end</span>
|
@@ -230,9 +230,9 @@
|
|
230
230
|
</div>
|
231
231
|
|
232
232
|
<div id="footer">
|
233
|
-
Generated on
|
233
|
+
Generated on Wed Dec 25 13:01:48 2024 by
|
234
234
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
235
|
-
0.9.37 (ruby-3.
|
235
|
+
0.9.37 (ruby-3.4.1).
|
236
236
|
</div>
|
237
237
|
|
238
238
|
</div>
|
data/doc/_index.html
CHANGED
@@ -88,7 +88,9 @@
|
|
88
88
|
</li>
|
89
89
|
|
90
90
|
<li>
|
91
|
-
<span class='object_link'><a href="Context.html" title="Context (class)">Context</a></span>
|
91
|
+
<span class='object_link'><a href="Enhanced/Context.html" title="Enhanced::Context (class)">Context</a></span>
|
92
|
+
|
93
|
+
<small>(Enhanced)</small>
|
92
94
|
|
93
95
|
</li>
|
94
96
|
|
@@ -111,17 +113,21 @@
|
|
111
113
|
</li>
|
112
114
|
|
113
115
|
<li>
|
114
|
-
<span class='object_link'><a href="
|
116
|
+
<span class='object_link'><a href="Exception.html" title="Exception (class)">Exception</a></span>
|
115
117
|
|
116
118
|
</li>
|
117
119
|
|
118
120
|
<li>
|
119
|
-
<span class='object_link'><a href="
|
121
|
+
<span class='object_link'><a href="Enhanced/ExceptionBindingInfos.html" title="Enhanced::ExceptionBindingInfos (module)">ExceptionBindingInfos</a></span>
|
122
|
+
|
123
|
+
<small>(Enhanced)</small>
|
120
124
|
|
121
125
|
</li>
|
122
126
|
|
123
127
|
<li>
|
124
|
-
<span class='object_link'><a href="
|
128
|
+
<span class='object_link'><a href="Enhanced/ExceptionContext.html" title="Enhanced::ExceptionContext (module)">ExceptionContext</a></span>
|
129
|
+
|
130
|
+
<small>(Enhanced)</small>
|
125
131
|
|
126
132
|
</li>
|
127
133
|
|
@@ -150,9 +156,9 @@
|
|
150
156
|
</div>
|
151
157
|
|
152
158
|
<div id="footer">
|
153
|
-
Generated on
|
159
|
+
Generated on Wed Dec 25 13:01:48 2024 by
|
154
160
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
155
|
-
0.9.37 (ruby-3.
|
161
|
+
0.9.37 (ruby-3.4.1).
|
156
162
|
</div>
|
157
163
|
|
158
164
|
</div>
|
data/doc/class_list.html
CHANGED
@@ -46,7 +46,7 @@
|
|
46
46
|
|
47
47
|
<ul id="full_list" class="class">
|
48
48
|
<li id="object_" class="odd"><div class="item" style="padding-left:30px"><span class='object_link'><a href="top-level-namespace.html" title="Top Level Namespace (root)">Top Level Namespace</a></span></div></li>
|
49
|
-
<li id='
|
49
|
+
<li id='object_Enhanced' class='even'><div class='item' style='padding-left:30px'><a tabindex='0' class='toggle' role='button' aria-label='Enhanced child nodes' aria-expanded='false' aria-controls='object_Enhanced'></a> <span class='object_link'><a href="Enhanced.html" title="Enhanced (module)">Enhanced</a></span><small class='search_info'>Top Level Namespace</small></div><div aria-labelledby='object_Enhanced'><ul><li id='object_Enhanced::Colors' class='collapsed odd'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Enhanced/Colors.html" title="Enhanced::Colors (class)">Colors</a></span> < Object<small class='search_info'>Enhanced</small></div></li><li id='object_Enhanced::Context' class='collapsed even'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Enhanced/Context.html" title="Enhanced::Context (class)">Context</a></span> < Object<small class='search_info'>Enhanced</small></div></li><li id='object_Enhanced::ExceptionBindingInfos' class='collapsed odd'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Enhanced/ExceptionBindingInfos.html" title="Enhanced::ExceptionBindingInfos (module)">ExceptionBindingInfos</a></span><small class='search_info'>Enhanced</small></div></li><li id='object_Enhanced::ExceptionContext' class='collapsed even'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Enhanced/ExceptionContext.html" title="Enhanced::ExceptionContext (module)">ExceptionContext</a></span><small class='search_info'>Enhanced</small></div></li></ul></div></li><li id='object_EnhancedErrors' class='odd'><div class='item' style='padding-left:30px'><span class='object_link'><a href="EnhancedErrors.html" title="EnhancedErrors (class)">EnhancedErrors</a></span> < Object<small class='search_info'>Top Level Namespace</small></div></li><li id='object_Exception' class='even'><div class='item' style='padding-left:30px'><span class='object_link'><a href="Exception.html" title="Exception (class)">Exception</a></span><small class='search_info'>Top Level Namespace</small></div></li><li id='object_Minitest' class='odd'><div class='item' style='padding-left:30px'><span class='object_link'><a href="Minitest.html" title="Minitest (module)">Minitest</a></span><small class='search_info'>Top Level Namespace</small></div></li>
|
50
50
|
|
51
51
|
</ul>
|
52
52
|
</div>
|
data/doc/file.README.html
CHANGED
@@ -97,29 +97,41 @@
|
|
97
97
|
|
98
98
|
<p>Use EnhancedErrors with RSpec for test-specific exception capturing, ideal for CI and local testing without impacting production.</p>
|
99
99
|
|
100
|
-
<pre class="code ruby"><code class="ruby"
|
100
|
+
<pre class="code ruby"><code class="ruby"><span class='comment'># usually in spec_helper.rb or rails_helper.rb
|
101
|
+
</span>
|
102
|
+
<span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>enhanced_errors</span><span class='tstring_end'>'</span></span>
|
103
|
+
<span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>awesome_print</span><span class='tstring_end'>'</span></span> <span class='comment'># Optional, for better output
|
104
|
+
</span>
|
101
105
|
<span class='const'>RSpec</span><span class='period'>.</span><span class='id identifier rubyid_configure'>configure</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_config'>config</span><span class='op'>|</span>
|
102
|
-
|
103
|
-
|
104
|
-
<span class='
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
106
|
+
|
107
|
+
<span class='comment'># Along with the requires, add this to your RSpec config to enhance your RSpec output
|
108
|
+
</span> <span class='comment'># Consider driving the config with an environment variable like this to make it configurable per-user or run
|
109
|
+
</span> <span class='comment'># if ENV['enhanced_errors'] == 'true'
|
110
|
+
</span> <span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_before'>before</span><span class='lparen'>(</span><span class='symbol'>:example</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid__example'>_example</span><span class='op'>|</span>
|
111
|
+
<span class='const'><span class='object_link'><a href="EnhancedErrors.html" title="EnhancedErrors (class)">EnhancedErrors</a></span></span><span class='period'>.</span><span class='id identifier rubyid_start_rspec_binding_capture'><span class='object_link'><a href="EnhancedErrors.html#start_rspec_binding_capture-class_method" title="EnhancedErrors.start_rspec_binding_capture (method)">start_rspec_binding_capture</a></span></span>
|
112
|
+
<span class='kw'>end</span>
|
113
|
+
|
114
|
+
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_before'>before</span><span class='lparen'>(</span><span class='symbol'>:example</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid__example'>_example</span><span class='op'>|</span>
|
115
|
+
<span class='const'><span class='object_link'><a href="EnhancedErrors.html" title="EnhancedErrors (class)">EnhancedErrors</a></span></span><span class='period'>.</span><span class='id identifier rubyid_start_rspec_binding_capture'><span class='object_link'><a href="EnhancedErrors.html#start_rspec_binding_capture-class_method" title="EnhancedErrors.start_rspec_binding_capture (method)">start_rspec_binding_capture</a></span></span>
|
116
|
+
<span class='kw'>end</span>
|
117
|
+
|
118
|
+
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_after'>after</span><span class='lparen'>(</span><span class='symbol'>:example</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_example'>example</span><span class='op'>|</span>
|
119
|
+
<span class='const'><span class='object_link'><a href="EnhancedErrors.html" title="EnhancedErrors (class)">EnhancedErrors</a></span></span><span class='period'>.</span><span class='id identifier rubyid_override_rspec_message'><span class='object_link'><a href="EnhancedErrors.html#override_rspec_message-class_method" title="EnhancedErrors.override_rspec_message (method)">override_rspec_message</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_example'>example</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="EnhancedErrors.html" title="EnhancedErrors (class)">EnhancedErrors</a></span></span><span class='period'>.</span><span class='id identifier rubyid_stop_rspec_binding_capture'><span class='object_link'><a href="EnhancedErrors.html#stop_rspec_binding_capture-class_method" title="EnhancedErrors.stop_rspec_binding_capture (method)">stop_rspec_binding_capture</a></span></span><span class='rparen'>)</span>
|
120
|
+
<span class='kw'>end</span>
|
121
|
+
<span class='comment'># end
|
122
|
+
</span>
|
113
123
|
<span class='kw'>end</span>
|
114
124
|
</code></pre>
|
115
125
|
|
116
126
|
<p><br></p>
|
117
127
|
|
128
|
+
<p>”””</p>
|
129
|
+
|
118
130
|
<h2 id="label-MiniTest+Setup">MiniTest Setup</h2>
|
119
131
|
|
120
132
|
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>enhanced_errors</span><span class='tstring_end'>'</span></span>
|
121
|
-
<span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>
|
122
|
-
|
133
|
+
<span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>awesome_print</span><span class='tstring_end'>'</span></span> <span class='comment'># Optional, for better output
|
134
|
+
</span><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>enhanced/minitest_patch</span><span class='tstring_end'>'</span></span>
|
123
135
|
<span class='comment'># Once the patch is loaded, it should just work!
|
124
136
|
</span></code></pre>
|
125
137
|
|
@@ -169,10 +181,14 @@
|
|
169
181
|
|
170
182
|
<p><img src=“./doc/images/enhanced-error.png” style=“height: 215px; width: 429px;”></img> <br></p>
|
171
183
|
|
184
|
+
<p>EnhancedErrors use-cases: * Handle test and CI failures faster by skipping that pesky “reproduction” step. * LLM-candy - Feed debug output with variable values into your LLM, making state examine-able * Debug deep-stack errors and reduce mean time to resolution (MTTR). * Address elusive “Heisenbugs” by capturing full error context preemptively. * Debug cron jobs and daemons with rich, failure-specific logs. * Catch data-driven bugs in long jobs without re-runs or extensive logging.</p>
|
185
|
+
|
172
186
|
<h2 id="label-Features">Features</h2>
|
173
187
|
<ul><li>
|
174
188
|
<p><strong>Pure Ruby</strong>: No external dependencies, C extensions, or C API calls.</p>
|
175
189
|
</li><li>
|
190
|
+
<p>**Improved RSpec and Minitest errors for straight-to-fix–look-ma-no-debugging, look-ma-no-reproducing</p>
|
191
|
+
</li><li>
|
176
192
|
<p><strong>Customizable Output</strong>: Supports multiple output formats (<code>:json</code>, <code>:plaintext</code>, <code>:terminal</code>).</p>
|
177
193
|
</li><li>
|
178
194
|
<p><strong>Flexible Hooks</strong>: Redact or modifying captured data via the <code>on_capture</code> hook. Update the final string with on_format.</p>
|
@@ -190,19 +206,6 @@
|
|
190
206
|
<p><strong>Lightweight</strong>: Minimal performance impact, as tracing is only active during exception raising.</p>
|
191
207
|
</li></ul>
|
192
208
|
|
193
|
-
<p>EnhancedErrors use-cases:</p>
|
194
|
-
<ul><li>
|
195
|
-
<p>Catch data-driven bugs without needing re-runs or extensive logging.</p>
|
196
|
-
</li><li>
|
197
|
-
<p>Debug deep-stack errors and reduce mean time to resolution (MTTR).</p>
|
198
|
-
</li><li>
|
199
|
-
<p>Handle CI failures faster by skipping reproduction steps.</p>
|
200
|
-
</li><li>
|
201
|
-
<p>Address elusive “Heisenbugs” by capturing error context preemptively.</p>
|
202
|
-
</li><li>
|
203
|
-
<p>Debug cron jobs and daemons with rich, failure-specific logs.</p>
|
204
|
-
</li></ul>
|
205
|
-
|
206
209
|
<h2 id="label-Installation">Installation</h2>
|
207
210
|
|
208
211
|
<p>Add this line to your <code>Gemfile</code>:</p>
|
@@ -267,13 +270,6 @@
|
|
267
270
|
<p>Terminal Color output: Enabled</p>
|
268
271
|
</li></ul>
|
269
272
|
</li><li>
|
270
|
-
<p><strong>Production</strong>:</p>
|
271
|
-
<ul><li>
|
272
|
-
<p>Output format: <code>:json</code></p>
|
273
|
-
</li><li>
|
274
|
-
<p>Terminal Color output: Disabled</p>
|
275
|
-
</li></ul>
|
276
|
-
</li><li>
|
277
273
|
<p><strong>CI Environment</strong>:</p>
|
278
274
|
<ul><li>
|
279
275
|
<p>Output format: <code>:plaintext</code></p>
|
@@ -368,10 +364,6 @@
|
|
368
364
|
<p>These exceptions are always ignored:</p>
|
369
365
|
|
370
366
|
<pre class="code ruby"><code class="ruby"><span class='const'>SystemExit</span> <span class='const'>NoMemoryError</span> <span class='const'>SignalException</span> <span class='const'>Interrupt</span>
|
371
|
-
<span class='const'>ScriptError</span> <span class='const'>LoadError</span> <span class='const'>NotImplementedError</span> <span class='const'>SyntaxError</span>
|
372
|
-
<span class='const'>RSpec</span><span class='op'>::</span><span class='const'>Expectations</span><span class='op'>::</span><span class='const'>ExpectationNotMetError</span>
|
373
|
-
<span class='const'>RSpec</span><span class='op'>::</span><span class='const'>Matchers</span><span class='op'>::</span><span class='const'>BuiltIn</span><span class='op'>::</span><span class='const'>RaiseError</span>
|
374
|
-
<span class='const'>SystemStackError</span> <span class='const'>Psych</span><span class='op'>::</span><span class='const'>BadAlias</span>
|
375
367
|
</code></pre>
|
376
368
|
|
377
369
|
<p>While this is close to “Things that don’t descend from StandardError”, it’s not exactly that.</p>
|
@@ -458,7 +450,7 @@
|
|
458
450
|
<ul><li>
|
459
451
|
<p>EnhancedErrors won’t interrupt CI, but it lets me know what happened <em>without</em> reproduction steps</p>
|
460
452
|
</li><li>
|
461
|
-
<p>EnhancedErrors could, theoretically,
|
453
|
+
<p>EnhancedErrors could, theoretically, be fine in production (if data security, redaction, PII, access, and encryption concerns were addressed). Big list, but another option is to selectively enable targeted capture. The hooks provide a place to handle things of this sort.</p>
|
462
454
|
</li><li>
|
463
455
|
<p>Has decent performance characteristics</p>
|
464
456
|
</li><li>
|
@@ -471,14 +463,17 @@
|
|
471
463
|
<ul><li>
|
472
464
|
<p><strong>Small Overhead</strong>: Since TracePoint is only activated during exception raising and rescuing, the performance impact is negligible during normal operation. (Benchmark included)</p>
|
473
465
|
</li><li>
|
474
|
-
<p><strong>TBD</strong>: Memory considerations. This does capture data when an exception happens. EnhancedErrors hides under the bed when it sees
|
466
|
+
<p><strong>TBD</strong>: Memory considerations. This does capture data when an exception happens. EnhancedErrors hides under the bed when it sees the scariest exceptions.</p>
|
475
467
|
</li><li>
|
476
|
-
<p><strong>Goal: Production Safety</strong>: The gem is designed to, eventually, be
|
468
|
+
<p><strong>Goal: Production Safety</strong>: The gem is designed to, eventually, be suitable for production use. I might not enable it in production <em>yet</em> as it is pretty new. It would require a thoughtful approach (perhaps behind a feature flag, or only capturing targeted exceptions via the eligible for capture feature).</p>
|
477
469
|
</li></ul>
|
478
470
|
|
479
471
|
<h2 id="label-Contributing">Contributing</h2>
|
480
472
|
|
481
|
-
<p>Bug reports and pull requests are welcome on GitHub
|
473
|
+
<p>Bug reports and pull requests are welcome on GitHub.</p>
|
474
|
+
<ul><li>
|
475
|
+
<p>Please include tests to demonstrate your contribution working.</p>
|
476
|
+
</li></ul>
|
482
477
|
|
483
478
|
<h2 id="label-License">License</h2>
|
484
479
|
|
@@ -486,9 +481,9 @@
|
|
486
481
|
</div></div>
|
487
482
|
|
488
483
|
<div id="footer">
|
489
|
-
Generated on
|
484
|
+
Generated on Wed Dec 25 13:01:48 2024 by
|
490
485
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
491
|
-
0.9.37 (ruby-3.
|
486
|
+
0.9.37 (ruby-3.4.1).
|
492
487
|
</div>
|
493
488
|
|
494
489
|
</div>
|