enhanced_errors 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardoc/checksums +4 -0
- 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/README.md +52 -70
- data/doc/Binding.html +137 -0
- data/doc/Colors.html +384 -0
- data/doc/Debugging.html +181 -0
- data/doc/EnhancedErrors.html +2742 -0
- data/doc/ErrorEnhancements.html +252 -0
- data/doc/_index.html +151 -0
- data/doc/class_list.html +54 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +503 -0
- data/doc/file.README.html +432 -0
- data/doc/file_list.html +59 -0
- data/doc/frames.html +22 -0
- data/doc/images/enhanced-error.png +0 -0
- data/doc/images/enhanced-spec.png +0 -0
- data/doc/index.html +432 -0
- data/doc/js/app.js +344 -0
- data/doc/js/full_list.js +242 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +286 -0
- data/doc/top-level-namespace.html +112 -0
- data/enhanced_errors.gemspec +6 -3
- data/examples/example_spec.rb +2 -2
- data/lib/enhanced_errors.rb +43 -30
- metadata +58 -6
@@ -0,0 +1,2742 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Class: EnhancedErrors
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.37
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" />
|
16
|
+
|
17
|
+
<script type="text/javascript">
|
18
|
+
pathId = "EnhancedErrors";
|
19
|
+
relpath = '';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="_index.html">Index (E)</a> »
|
40
|
+
|
41
|
+
|
42
|
+
<span class="title">EnhancedErrors</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Class: EnhancedErrors
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">Object</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">EnhancedErrors</li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
81
|
+
|
82
|
+
</dd>
|
83
|
+
</dl>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<dl>
|
96
|
+
<dt>Defined in:</dt>
|
97
|
+
<dd>lib/enhanced_errors.rb</dd>
|
98
|
+
</dl>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
|
105
|
+
<p>The EnhancedErrors class provides mechanisms to enhance exception handling by capturing additional context such as binding information, variables, and method arguments when exceptions are raised. It offers customization options for formatting and filtering captured data.</p>
|
106
|
+
|
107
|
+
|
108
|
+
</div>
|
109
|
+
</div>
|
110
|
+
<div class="tags">
|
111
|
+
|
112
|
+
|
113
|
+
</div>
|
114
|
+
|
115
|
+
<h2>
|
116
|
+
Constant Summary
|
117
|
+
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
118
|
+
</h2>
|
119
|
+
|
120
|
+
<dl class="constants">
|
121
|
+
|
122
|
+
<dt id="GEMS_REGEX-constant" class="">GEMS_REGEX =
|
123
|
+
<div class="docstring">
|
124
|
+
<div class="discussion">
|
125
|
+
|
126
|
+
<p>Regular expression to identify gem paths.</p>
|
127
|
+
|
128
|
+
|
129
|
+
</div>
|
130
|
+
</div>
|
131
|
+
<div class="tags">
|
132
|
+
|
133
|
+
<p class="tag_title">Returns:</p>
|
134
|
+
<ul class="return">
|
135
|
+
|
136
|
+
<li>
|
137
|
+
|
138
|
+
|
139
|
+
<span class='type'>(<tt>Regexp</tt>)</span>
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
</li>
|
144
|
+
|
145
|
+
</ul>
|
146
|
+
|
147
|
+
</div>
|
148
|
+
</dt>
|
149
|
+
<dd><pre class="code"><span class='tstring'><span class='regexp_beg'>%r{</span><span class='tstring_content'>[\/\\]gems[\/\\]</span><span class='regexp_end'>}</span></span></pre></dd>
|
150
|
+
|
151
|
+
<dt id="DEFAULT_MAX_LENGTH-constant" class="">DEFAULT_MAX_LENGTH =
|
152
|
+
<div class="docstring">
|
153
|
+
<div class="discussion">
|
154
|
+
|
155
|
+
<p>The default maximum length for formatted exception messages.</p>
|
156
|
+
|
157
|
+
|
158
|
+
</div>
|
159
|
+
</div>
|
160
|
+
<div class="tags">
|
161
|
+
|
162
|
+
<p class="tag_title">Returns:</p>
|
163
|
+
<ul class="return">
|
164
|
+
|
165
|
+
<li>
|
166
|
+
|
167
|
+
|
168
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
</li>
|
173
|
+
|
174
|
+
</ul>
|
175
|
+
|
176
|
+
</div>
|
177
|
+
</dt>
|
178
|
+
<dd><pre class="code"><span class='int'>2500</span></pre></dd>
|
179
|
+
|
180
|
+
<dt id="RSPEC_SKIP_LIST-constant" class="">RSPEC_SKIP_LIST =
|
181
|
+
<div class="docstring">
|
182
|
+
<div class="discussion">
|
183
|
+
|
184
|
+
<p>A set of RSpec-specific instance variables to skip.</p>
|
185
|
+
|
186
|
+
|
187
|
+
</div>
|
188
|
+
</div>
|
189
|
+
<div class="tags">
|
190
|
+
|
191
|
+
<p class="tag_title">Returns:</p>
|
192
|
+
<ul class="return">
|
193
|
+
|
194
|
+
<li>
|
195
|
+
|
196
|
+
|
197
|
+
<span class='type'>(<tt>Set<Symbol></tt>)</span>
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
</li>
|
202
|
+
|
203
|
+
</ul>
|
204
|
+
|
205
|
+
</div>
|
206
|
+
</dt>
|
207
|
+
<dd><pre class="code"><span class='const'>Set</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='lbracket'>[</span>
|
208
|
+
<span class='symbol'>:@fixture_cache</span><span class='comma'>,</span>
|
209
|
+
<span class='symbol'>:@fixture_cache_key</span><span class='comma'>,</span>
|
210
|
+
<span class='symbol'>:@fixture_connection_pools</span><span class='comma'>,</span>
|
211
|
+
<span class='symbol'>:@connection_subscriber</span><span class='comma'>,</span>
|
212
|
+
<span class='symbol'>:@saved_pool_configs</span><span class='comma'>,</span>
|
213
|
+
<span class='symbol'>:@loaded_fixtures</span><span class='comma'>,</span>
|
214
|
+
<span class='symbol'>:@matcher_definitions</span><span class='comma'>,</span>
|
215
|
+
<span class='rbracket'>]</span><span class='rparen'>)</span></pre></dd>
|
216
|
+
|
217
|
+
<dt id="RAILS_SKIP_LIST-constant" class="">RAILS_SKIP_LIST =
|
218
|
+
<div class="docstring">
|
219
|
+
<div class="discussion">
|
220
|
+
|
221
|
+
<p>A set of Rails-specific instance variables to skip.</p>
|
222
|
+
|
223
|
+
|
224
|
+
</div>
|
225
|
+
</div>
|
226
|
+
<div class="tags">
|
227
|
+
|
228
|
+
<p class="tag_title">Returns:</p>
|
229
|
+
<ul class="return">
|
230
|
+
|
231
|
+
<li>
|
232
|
+
|
233
|
+
|
234
|
+
<span class='type'>(<tt>Set<Symbol></tt>)</span>
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
</li>
|
239
|
+
|
240
|
+
</ul>
|
241
|
+
|
242
|
+
</div>
|
243
|
+
</dt>
|
244
|
+
<dd><pre class="code"><span class='const'>Set</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='lbracket'>[</span>
|
245
|
+
<span class='symbol'>:@new_record</span><span class='comma'>,</span>
|
246
|
+
<span class='symbol'>:@attributes</span><span class='comma'>,</span>
|
247
|
+
<span class='symbol'>:@association_cache</span><span class='comma'>,</span>
|
248
|
+
<span class='symbol'>:@readonly</span><span class='comma'>,</span>
|
249
|
+
<span class='symbol'>:@previously_new_record</span><span class='comma'>,</span>
|
250
|
+
<span class='symbol'>:@destroyed</span><span class='comma'>,</span>
|
251
|
+
<span class='symbol'>:@marked_for_destruction</span><span class='comma'>,</span>
|
252
|
+
<span class='symbol'>:@destroyed_by_association</span><span class='comma'>,</span>
|
253
|
+
<span class='symbol'>:@primary_key</span><span class='comma'>,</span>
|
254
|
+
<span class='symbol'>:@strict_loading</span><span class='comma'>,</span>
|
255
|
+
<span class='symbol'>:@strict_loading_mode</span><span class='comma'>,</span>
|
256
|
+
<span class='symbol'>:@mutations_before_last_save</span><span class='comma'>,</span>
|
257
|
+
<span class='symbol'>:@mutations_from_database</span>
|
258
|
+
<span class='rbracket'>]</span><span class='rparen'>)</span></pre></dd>
|
259
|
+
|
260
|
+
</dl>
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
<h2>Class Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
267
|
+
<ul class="summary">
|
268
|
+
|
269
|
+
<li class="public ">
|
270
|
+
<span class="summary_signature">
|
271
|
+
|
272
|
+
<a href="#capture_let_variables-class_method" title="capture_let_variables (class method)">.<strong>capture_let_variables</strong>(value = nil) ⇒ Boolean </a>
|
273
|
+
|
274
|
+
|
275
|
+
|
276
|
+
</span>
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
<span class="summary_desc"><div class='inline'>
|
290
|
+
<p>Gets or sets whether to capture RSpec ‘let` variables.</p>
|
291
|
+
</div></span>
|
292
|
+
|
293
|
+
</li>
|
294
|
+
|
295
|
+
|
296
|
+
<li class="public ">
|
297
|
+
<span class="summary_signature">
|
298
|
+
|
299
|
+
<a href="#config_block-class_method" title="config_block (class method)">.<strong>config_block</strong> ⇒ Proc<sup>?</sup> </a>
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
</span>
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
<span class="summary_desc"><div class='inline'>
|
317
|
+
<p>The configuration block provided during enhancement.</p>
|
318
|
+
</div></span>
|
319
|
+
|
320
|
+
</li>
|
321
|
+
|
322
|
+
|
323
|
+
<li class="public ">
|
324
|
+
<span class="summary_signature">
|
325
|
+
|
326
|
+
<a href="#eligible_for_capture-class_method" title="eligible_for_capture (class method)">.<strong>eligible_for_capture</strong> {|exception| ... } ⇒ Proc </a>
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
</span>
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
<span class="summary_desc"><div class='inline'>
|
344
|
+
<p>Sets or retrieves the eligibility criteria for capturing exceptions.</p>
|
345
|
+
</div></span>
|
346
|
+
|
347
|
+
</li>
|
348
|
+
|
349
|
+
|
350
|
+
<li class="public ">
|
351
|
+
<span class="summary_signature">
|
352
|
+
|
353
|
+
<a href="#enabled-class_method" title="enabled (class method)">.<strong>enabled</strong> ⇒ Boolean </a>
|
354
|
+
|
355
|
+
|
356
|
+
|
357
|
+
</span>
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
|
370
|
+
<span class="summary_desc"><div class='inline'>
|
371
|
+
<p>Indicates whether EnhancedErrors is enabled.</p>
|
372
|
+
</div></span>
|
373
|
+
|
374
|
+
</li>
|
375
|
+
|
376
|
+
|
377
|
+
<li class="public ">
|
378
|
+
<span class="summary_signature">
|
379
|
+
|
380
|
+
<a href="#max_length-class_method" title="max_length (class method)">.<strong>max_length</strong>(value = nil) ⇒ Integer </a>
|
381
|
+
|
382
|
+
|
383
|
+
|
384
|
+
</span>
|
385
|
+
|
386
|
+
|
387
|
+
|
388
|
+
|
389
|
+
|
390
|
+
|
391
|
+
|
392
|
+
|
393
|
+
|
394
|
+
|
395
|
+
|
396
|
+
|
397
|
+
<span class="summary_desc"><div class='inline'>
|
398
|
+
<p>Gets or sets the maximum length for the formatted exception message.</p>
|
399
|
+
</div></span>
|
400
|
+
|
401
|
+
</li>
|
402
|
+
|
403
|
+
|
404
|
+
<li class="public ">
|
405
|
+
<span class="summary_signature">
|
406
|
+
|
407
|
+
<a href="#on_capture_hook-class_method" title="on_capture_hook (class method)">.<strong>on_capture_hook</strong> ⇒ Proc<sup>?</sup> </a>
|
408
|
+
|
409
|
+
|
410
|
+
|
411
|
+
</span>
|
412
|
+
|
413
|
+
|
414
|
+
|
415
|
+
|
416
|
+
|
417
|
+
|
418
|
+
|
419
|
+
|
420
|
+
|
421
|
+
|
422
|
+
|
423
|
+
|
424
|
+
<span class="summary_desc"><div class='inline'>
|
425
|
+
<p>Hook to modify binding information upon capture.</p>
|
426
|
+
</div></span>
|
427
|
+
|
428
|
+
</li>
|
429
|
+
|
430
|
+
|
431
|
+
<li class="public ">
|
432
|
+
<span class="summary_signature">
|
433
|
+
|
434
|
+
<a href="#skip_list-class_method" title="skip_list (class method)">.<strong>skip_list</strong> ⇒ Set<Symbol> </a>
|
435
|
+
|
436
|
+
|
437
|
+
|
438
|
+
</span>
|
439
|
+
|
440
|
+
|
441
|
+
|
442
|
+
|
443
|
+
|
444
|
+
|
445
|
+
|
446
|
+
|
447
|
+
|
448
|
+
|
449
|
+
|
450
|
+
|
451
|
+
<span class="summary_desc"><div class='inline'>
|
452
|
+
<p>Retrieves the current skip list, initializing it with default values if not already set.</p>
|
453
|
+
</div></span>
|
454
|
+
|
455
|
+
</li>
|
456
|
+
|
457
|
+
|
458
|
+
<li class="public ">
|
459
|
+
<span class="summary_signature">
|
460
|
+
|
461
|
+
<a href="#trace-class_method" title="trace (class method)">.<strong>trace</strong> ⇒ TracePoint<sup>?</sup> </a>
|
462
|
+
|
463
|
+
|
464
|
+
|
465
|
+
</span>
|
466
|
+
|
467
|
+
|
468
|
+
|
469
|
+
|
470
|
+
|
471
|
+
|
472
|
+
|
473
|
+
|
474
|
+
|
475
|
+
|
476
|
+
|
477
|
+
|
478
|
+
<span class="summary_desc"><div class='inline'>
|
479
|
+
<p>The TracePoint object used for tracing exceptions.</p>
|
480
|
+
</div></span>
|
481
|
+
|
482
|
+
</li>
|
483
|
+
|
484
|
+
|
485
|
+
</ul>
|
486
|
+
|
487
|
+
|
488
|
+
|
489
|
+
|
490
|
+
|
491
|
+
<h2>
|
492
|
+
Class Method Summary
|
493
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
494
|
+
</h2>
|
495
|
+
|
496
|
+
<ul class="summary">
|
497
|
+
|
498
|
+
<li class="public ">
|
499
|
+
<span class="summary_signature">
|
500
|
+
|
501
|
+
<a href="#add_to_skip_list-class_method" title="add_to_skip_list (class method)">.<strong>add_to_skip_list</strong>(*vars) ⇒ Set<Symbol> </a>
|
502
|
+
|
503
|
+
|
504
|
+
|
505
|
+
</span>
|
506
|
+
|
507
|
+
|
508
|
+
|
509
|
+
|
510
|
+
|
511
|
+
|
512
|
+
|
513
|
+
|
514
|
+
|
515
|
+
<span class="summary_desc"><div class='inline'>
|
516
|
+
<p>Adds variables to the skip list to exclude them from binding information.</p>
|
517
|
+
</div></span>
|
518
|
+
|
519
|
+
</li>
|
520
|
+
|
521
|
+
|
522
|
+
<li class="public ">
|
523
|
+
<span class="summary_signature">
|
524
|
+
|
525
|
+
<a href="#apply_skip_list-class_method" title="apply_skip_list (class method)">.<strong>apply_skip_list</strong>(binding_info) ⇒ Hash </a>
|
526
|
+
|
527
|
+
|
528
|
+
|
529
|
+
</span>
|
530
|
+
|
531
|
+
|
532
|
+
|
533
|
+
|
534
|
+
|
535
|
+
|
536
|
+
|
537
|
+
|
538
|
+
|
539
|
+
<span class="summary_desc"><div class='inline'>
|
540
|
+
<p>Applies the skip list to the captured binding information, excluding specified variables.</p>
|
541
|
+
</div></span>
|
542
|
+
|
543
|
+
</li>
|
544
|
+
|
545
|
+
|
546
|
+
<li class="public ">
|
547
|
+
<span class="summary_signature">
|
548
|
+
|
549
|
+
<a href="#binding_info_string-class_method" title="binding_info_string (class method)">.<strong>binding_info_string</strong>(binding_info) ⇒ String </a>
|
550
|
+
|
551
|
+
|
552
|
+
|
553
|
+
</span>
|
554
|
+
|
555
|
+
|
556
|
+
|
557
|
+
|
558
|
+
|
559
|
+
|
560
|
+
|
561
|
+
|
562
|
+
|
563
|
+
<span class="summary_desc"><div class='inline'>
|
564
|
+
<p>Formats a single binding information hash into a string with colorization.</p>
|
565
|
+
</div></span>
|
566
|
+
|
567
|
+
</li>
|
568
|
+
|
569
|
+
|
570
|
+
<li class="public ">
|
571
|
+
<span class="summary_signature">
|
572
|
+
|
573
|
+
<a href="#binding_infos_array_to_string-class_method" title="binding_infos_array_to_string (class method)">.<strong>binding_infos_array_to_string</strong>(captured_bindings, format = :terminal) ⇒ String </a>
|
574
|
+
|
575
|
+
|
576
|
+
|
577
|
+
</span>
|
578
|
+
|
579
|
+
|
580
|
+
|
581
|
+
|
582
|
+
|
583
|
+
|
584
|
+
|
585
|
+
|
586
|
+
|
587
|
+
<span class="summary_desc"><div class='inline'>
|
588
|
+
<p>Converts an array of binding information hashes into a formatted string.</p>
|
589
|
+
</div></span>
|
590
|
+
|
591
|
+
</li>
|
592
|
+
|
593
|
+
|
594
|
+
<li class="public ">
|
595
|
+
<span class="summary_signature">
|
596
|
+
|
597
|
+
<a href="#default_skip_list-class_method" title="default_skip_list (class method)">.<strong>default_skip_list</strong> ⇒ Set<Symbol> </a>
|
598
|
+
|
599
|
+
|
600
|
+
|
601
|
+
</span>
|
602
|
+
|
603
|
+
|
604
|
+
|
605
|
+
|
606
|
+
|
607
|
+
|
608
|
+
|
609
|
+
|
610
|
+
|
611
|
+
<span class="summary_desc"><div class='inline'>
|
612
|
+
<p>Initializes the default skip list by merging Rails and RSpec specific variables.</p>
|
613
|
+
</div></span>
|
614
|
+
|
615
|
+
</li>
|
616
|
+
|
617
|
+
|
618
|
+
<li class="public ">
|
619
|
+
<span class="summary_signature">
|
620
|
+
|
621
|
+
<a href="#enhance!-class_method" title="enhance! (class method)">.<strong>enhance!</strong>(enabled: true, debug: false, **options) {|void| ... } ⇒ void </a>
|
622
|
+
|
623
|
+
|
624
|
+
|
625
|
+
</span>
|
626
|
+
|
627
|
+
|
628
|
+
|
629
|
+
|
630
|
+
|
631
|
+
|
632
|
+
|
633
|
+
|
634
|
+
|
635
|
+
<span class="summary_desc"><div class='inline'>
|
636
|
+
<p>Enhances the exception handling by setting up tracing and configuration options.</p>
|
637
|
+
</div></span>
|
638
|
+
|
639
|
+
</li>
|
640
|
+
|
641
|
+
|
642
|
+
<li class="public ">
|
643
|
+
<span class="summary_signature">
|
644
|
+
|
645
|
+
<a href="#format-class_method" title="format (class method)">.<strong>format</strong>(captured_bindings = [], output_format = get_default_format_for_environment) ⇒ String </a>
|
646
|
+
|
647
|
+
|
648
|
+
|
649
|
+
</span>
|
650
|
+
|
651
|
+
|
652
|
+
|
653
|
+
|
654
|
+
|
655
|
+
|
656
|
+
|
657
|
+
|
658
|
+
|
659
|
+
<span class="summary_desc"><div class='inline'>
|
660
|
+
<p>Formats the captured binding information into a string based on the specified format.</p>
|
661
|
+
</div></span>
|
662
|
+
|
663
|
+
</li>
|
664
|
+
|
665
|
+
|
666
|
+
<li class="public ">
|
667
|
+
<span class="summary_signature">
|
668
|
+
|
669
|
+
<a href="#get_default_format_for_environment-class_method" title="get_default_format_for_environment (class method)">.<strong>get_default_format_for_environment</strong> ⇒ Symbol </a>
|
670
|
+
|
671
|
+
|
672
|
+
|
673
|
+
</span>
|
674
|
+
|
675
|
+
|
676
|
+
|
677
|
+
|
678
|
+
|
679
|
+
|
680
|
+
|
681
|
+
|
682
|
+
|
683
|
+
<span class="summary_desc"><div class='inline'>
|
684
|
+
<p>Determines the default output format based on the current environment.</p>
|
685
|
+
</div></span>
|
686
|
+
|
687
|
+
</li>
|
688
|
+
|
689
|
+
|
690
|
+
<li class="public ">
|
691
|
+
<span class="summary_signature">
|
692
|
+
|
693
|
+
<a href="#on_capture-class_method" title="on_capture (class method)">.<strong>on_capture</strong> {|binding_info| ... } ⇒ Proc </a>
|
694
|
+
|
695
|
+
|
696
|
+
|
697
|
+
</span>
|
698
|
+
|
699
|
+
|
700
|
+
|
701
|
+
|
702
|
+
|
703
|
+
|
704
|
+
|
705
|
+
|
706
|
+
|
707
|
+
<span class="summary_desc"><div class='inline'>
|
708
|
+
<p>Sets or retrieves the hook to modify binding information upon capture.</p>
|
709
|
+
</div></span>
|
710
|
+
|
711
|
+
</li>
|
712
|
+
|
713
|
+
|
714
|
+
<li class="public ">
|
715
|
+
<span class="summary_signature">
|
716
|
+
|
717
|
+
<a href="#on_capture=-class_method" title="on_capture= (class method)">.<strong>on_capture=</strong>(value) ⇒ Proc </a>
|
718
|
+
|
719
|
+
|
720
|
+
|
721
|
+
</span>
|
722
|
+
|
723
|
+
|
724
|
+
|
725
|
+
|
726
|
+
|
727
|
+
|
728
|
+
|
729
|
+
|
730
|
+
|
731
|
+
<span class="summary_desc"><div class='inline'>
|
732
|
+
<p>Sets the on_capture hook.</p>
|
733
|
+
</div></span>
|
734
|
+
|
735
|
+
</li>
|
736
|
+
|
737
|
+
|
738
|
+
<li class="public ">
|
739
|
+
<span class="summary_signature">
|
740
|
+
|
741
|
+
<a href="#on_format-class_method" title="on_format (class method)">.<strong>on_format</strong> {|formatted_string| ... } ⇒ Proc </a>
|
742
|
+
|
743
|
+
|
744
|
+
|
745
|
+
</span>
|
746
|
+
|
747
|
+
|
748
|
+
|
749
|
+
|
750
|
+
|
751
|
+
|
752
|
+
|
753
|
+
|
754
|
+
|
755
|
+
<span class="summary_desc"><div class='inline'>
|
756
|
+
<p>Sets or retrieves the hook to modify formatted exception messages.</p>
|
757
|
+
</div></span>
|
758
|
+
|
759
|
+
</li>
|
760
|
+
|
761
|
+
|
762
|
+
<li class="public ">
|
763
|
+
<span class="summary_signature">
|
764
|
+
|
765
|
+
<a href="#on_format=-class_method" title="on_format= (class method)">.<strong>on_format=</strong>(value) ⇒ Proc </a>
|
766
|
+
|
767
|
+
|
768
|
+
|
769
|
+
</span>
|
770
|
+
|
771
|
+
|
772
|
+
|
773
|
+
|
774
|
+
|
775
|
+
|
776
|
+
|
777
|
+
|
778
|
+
|
779
|
+
<span class="summary_desc"><div class='inline'>
|
780
|
+
<p>Sets the on_format hook.</p>
|
781
|
+
</div></span>
|
782
|
+
|
783
|
+
</li>
|
784
|
+
|
785
|
+
|
786
|
+
<li class="public ">
|
787
|
+
<span class="summary_signature">
|
788
|
+
|
789
|
+
<a href="#running_in_ci%3F-class_method" title="running_in_ci? (class method)">.<strong>running_in_ci?</strong> ⇒ Boolean </a>
|
790
|
+
|
791
|
+
|
792
|
+
|
793
|
+
</span>
|
794
|
+
|
795
|
+
|
796
|
+
|
797
|
+
|
798
|
+
|
799
|
+
|
800
|
+
|
801
|
+
|
802
|
+
|
803
|
+
<span class="summary_desc"><div class='inline'>
|
804
|
+
<p>Checks if the code is running in a Continuous Integration (CI) environment.</p>
|
805
|
+
</div></span>
|
806
|
+
|
807
|
+
</li>
|
808
|
+
|
809
|
+
|
810
|
+
<li class="public ">
|
811
|
+
<span class="summary_signature">
|
812
|
+
|
813
|
+
<a href="#validate_binding_format-class_method" title="validate_binding_format (class method)">.<strong>validate_binding_format</strong>(binding_info) ⇒ Hash<sup>?</sup> </a>
|
814
|
+
|
815
|
+
|
816
|
+
|
817
|
+
</span>
|
818
|
+
|
819
|
+
|
820
|
+
|
821
|
+
|
822
|
+
|
823
|
+
|
824
|
+
|
825
|
+
|
826
|
+
|
827
|
+
<span class="summary_desc"><div class='inline'>
|
828
|
+
<p>Validates the format of the captured binding information.</p>
|
829
|
+
</div></span>
|
830
|
+
|
831
|
+
</li>
|
832
|
+
|
833
|
+
|
834
|
+
</ul>
|
835
|
+
|
836
|
+
|
837
|
+
|
838
|
+
<div id="class_attr_details" class="attr_details">
|
839
|
+
<h2>Class Attribute Details</h2>
|
840
|
+
|
841
|
+
|
842
|
+
<span id="capture_let_variables=-class_method"></span>
|
843
|
+
<div class="method_details first">
|
844
|
+
<h3 class="signature first" id="capture_let_variables-class_method">
|
845
|
+
|
846
|
+
.<strong>capture_let_variables</strong>(value = nil) ⇒ <tt>Boolean</tt>
|
847
|
+
|
848
|
+
|
849
|
+
|
850
|
+
|
851
|
+
|
852
|
+
</h3><div class="docstring">
|
853
|
+
<div class="discussion">
|
854
|
+
|
855
|
+
<p>Gets or sets whether to capture RSpec ‘let` variables.</p>
|
856
|
+
|
857
|
+
|
858
|
+
</div>
|
859
|
+
</div>
|
860
|
+
<div class="tags">
|
861
|
+
<p class="tag_title">Parameters:</p>
|
862
|
+
<ul class="param">
|
863
|
+
|
864
|
+
<li>
|
865
|
+
|
866
|
+
<span class='name'>value</span>
|
867
|
+
|
868
|
+
|
869
|
+
<span class='type'>(<tt>Boolean</tt>, <tt>nil</tt>)</span>
|
870
|
+
|
871
|
+
|
872
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
873
|
+
|
874
|
+
|
875
|
+
—
|
876
|
+
<div class='inline'>
|
877
|
+
<p>The desired state. If ‘nil`, returns the current value.</p>
|
878
|
+
</div>
|
879
|
+
|
880
|
+
</li>
|
881
|
+
|
882
|
+
</ul>
|
883
|
+
|
884
|
+
<p class="tag_title">Returns:</p>
|
885
|
+
<ul class="return">
|
886
|
+
|
887
|
+
<li>
|
888
|
+
|
889
|
+
|
890
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
891
|
+
|
892
|
+
|
893
|
+
|
894
|
+
—
|
895
|
+
<div class='inline'>
|
896
|
+
<p>Whether RSpec ‘let` variables are being captured.</p>
|
897
|
+
</div>
|
898
|
+
|
899
|
+
</li>
|
900
|
+
|
901
|
+
</ul>
|
902
|
+
|
903
|
+
</div><table class="source_code">
|
904
|
+
<tr>
|
905
|
+
<td>
|
906
|
+
<pre class="lines">
|
907
|
+
|
908
|
+
|
909
|
+
41
|
910
|
+
42
|
911
|
+
43</pre>
|
912
|
+
</td>
|
913
|
+
<td>
|
914
|
+
<pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 41</span>
|
915
|
+
|
916
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_capture_let_variables'>capture_let_variables</span>
|
917
|
+
<span class='ivar'>@capture_let_variables</span>
|
918
|
+
<span class='kw'>end</span></pre>
|
919
|
+
</td>
|
920
|
+
</tr>
|
921
|
+
</table>
|
922
|
+
</div>
|
923
|
+
|
924
|
+
|
925
|
+
<span id="config_block=-class_method"></span>
|
926
|
+
<div class="method_details ">
|
927
|
+
<h3 class="signature " id="config_block-class_method">
|
928
|
+
|
929
|
+
.<strong>config_block</strong> ⇒ <tt>Proc</tt><sup>?</sup>
|
930
|
+
|
931
|
+
|
932
|
+
|
933
|
+
|
934
|
+
|
935
|
+
</h3><div class="docstring">
|
936
|
+
<div class="discussion">
|
937
|
+
|
938
|
+
<p>The configuration block provided during enhancement.</p>
|
939
|
+
|
940
|
+
|
941
|
+
</div>
|
942
|
+
</div>
|
943
|
+
<div class="tags">
|
944
|
+
|
945
|
+
<p class="tag_title">Returns:</p>
|
946
|
+
<ul class="return">
|
947
|
+
|
948
|
+
<li>
|
949
|
+
|
950
|
+
|
951
|
+
<span class='type'>(<tt>Proc</tt>, <tt>nil</tt>)</span>
|
952
|
+
|
953
|
+
|
954
|
+
|
955
|
+
</li>
|
956
|
+
|
957
|
+
</ul>
|
958
|
+
|
959
|
+
</div><table class="source_code">
|
960
|
+
<tr>
|
961
|
+
<td>
|
962
|
+
<pre class="lines">
|
963
|
+
|
964
|
+
|
965
|
+
26
|
966
|
+
27
|
967
|
+
28</pre>
|
968
|
+
</td>
|
969
|
+
<td>
|
970
|
+
<pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 26</span>
|
971
|
+
|
972
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_config_block'>config_block</span>
|
973
|
+
<span class='ivar'>@config_block</span>
|
974
|
+
<span class='kw'>end</span></pre>
|
975
|
+
</td>
|
976
|
+
</tr>
|
977
|
+
</table>
|
978
|
+
</div>
|
979
|
+
|
980
|
+
|
981
|
+
<span id="eligible_for_capture=-class_method"></span>
|
982
|
+
<div class="method_details ">
|
983
|
+
<h3 class="signature " id="eligible_for_capture-class_method">
|
984
|
+
|
985
|
+
.<strong>eligible_for_capture</strong> {|exception| ... } ⇒ <tt>Proc</tt>
|
986
|
+
|
987
|
+
|
988
|
+
|
989
|
+
|
990
|
+
|
991
|
+
</h3><div class="docstring">
|
992
|
+
<div class="discussion">
|
993
|
+
|
994
|
+
<p>Sets or retrieves the eligibility criteria for capturing exceptions.</p>
|
995
|
+
|
996
|
+
|
997
|
+
</div>
|
998
|
+
</div>
|
999
|
+
<div class="tags">
|
1000
|
+
|
1001
|
+
<p class="tag_title">Yield Parameters:</p>
|
1002
|
+
<ul class="yieldparam">
|
1003
|
+
|
1004
|
+
<li>
|
1005
|
+
|
1006
|
+
<span class='name'>exception</span>
|
1007
|
+
|
1008
|
+
|
1009
|
+
<span class='type'>(<tt>Exception</tt>)</span>
|
1010
|
+
|
1011
|
+
|
1012
|
+
|
1013
|
+
—
|
1014
|
+
<div class='inline'>
|
1015
|
+
<p>The exception to evaluate.</p>
|
1016
|
+
</div>
|
1017
|
+
|
1018
|
+
</li>
|
1019
|
+
|
1020
|
+
</ul>
|
1021
|
+
<p class="tag_title">Returns:</p>
|
1022
|
+
<ul class="return">
|
1023
|
+
|
1024
|
+
<li>
|
1025
|
+
|
1026
|
+
|
1027
|
+
<span class='type'>(<tt>Proc</tt>)</span>
|
1028
|
+
|
1029
|
+
|
1030
|
+
|
1031
|
+
—
|
1032
|
+
<div class='inline'>
|
1033
|
+
<p>The current eligibility proc.</p>
|
1034
|
+
</div>
|
1035
|
+
|
1036
|
+
</li>
|
1037
|
+
|
1038
|
+
</ul>
|
1039
|
+
|
1040
|
+
</div><table class="source_code">
|
1041
|
+
<tr>
|
1042
|
+
<td>
|
1043
|
+
<pre class="lines">
|
1044
|
+
|
1045
|
+
|
1046
|
+
46
|
1047
|
+
47
|
1048
|
+
48</pre>
|
1049
|
+
</td>
|
1050
|
+
<td>
|
1051
|
+
<pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 46</span>
|
1052
|
+
|
1053
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_eligible_for_capture'>eligible_for_capture</span>
|
1054
|
+
<span class='ivar'>@eligible_for_capture</span>
|
1055
|
+
<span class='kw'>end</span></pre>
|
1056
|
+
</td>
|
1057
|
+
</tr>
|
1058
|
+
</table>
|
1059
|
+
</div>
|
1060
|
+
|
1061
|
+
|
1062
|
+
<span id="enabled=-class_method"></span>
|
1063
|
+
<div class="method_details ">
|
1064
|
+
<h3 class="signature " id="enabled-class_method">
|
1065
|
+
|
1066
|
+
.<strong>enabled</strong> ⇒ <tt>Boolean</tt>
|
1067
|
+
|
1068
|
+
|
1069
|
+
|
1070
|
+
|
1071
|
+
|
1072
|
+
</h3><div class="docstring">
|
1073
|
+
<div class="discussion">
|
1074
|
+
|
1075
|
+
<p>Indicates whether EnhancedErrors is enabled.</p>
|
1076
|
+
|
1077
|
+
|
1078
|
+
</div>
|
1079
|
+
</div>
|
1080
|
+
<div class="tags">
|
1081
|
+
|
1082
|
+
<p class="tag_title">Returns:</p>
|
1083
|
+
<ul class="return">
|
1084
|
+
|
1085
|
+
<li>
|
1086
|
+
|
1087
|
+
|
1088
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
1089
|
+
|
1090
|
+
|
1091
|
+
|
1092
|
+
</li>
|
1093
|
+
|
1094
|
+
</ul>
|
1095
|
+
|
1096
|
+
</div><table class="source_code">
|
1097
|
+
<tr>
|
1098
|
+
<td>
|
1099
|
+
<pre class="lines">
|
1100
|
+
|
1101
|
+
|
1102
|
+
16
|
1103
|
+
17
|
1104
|
+
18</pre>
|
1105
|
+
</td>
|
1106
|
+
<td>
|
1107
|
+
<pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 16</span>
|
1108
|
+
|
1109
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_enabled'>enabled</span>
|
1110
|
+
<span class='ivar'>@enabled</span>
|
1111
|
+
<span class='kw'>end</span></pre>
|
1112
|
+
</td>
|
1113
|
+
</tr>
|
1114
|
+
</table>
|
1115
|
+
</div>
|
1116
|
+
|
1117
|
+
|
1118
|
+
<span id="max_length=-class_method"></span>
|
1119
|
+
<div class="method_details ">
|
1120
|
+
<h3 class="signature " id="max_length-class_method">
|
1121
|
+
|
1122
|
+
.<strong>max_length</strong>(value = nil) ⇒ <tt>Integer</tt>
|
1123
|
+
|
1124
|
+
|
1125
|
+
|
1126
|
+
|
1127
|
+
|
1128
|
+
</h3><div class="docstring">
|
1129
|
+
<div class="discussion">
|
1130
|
+
|
1131
|
+
<p>Gets or sets the maximum length for the formatted exception message.</p>
|
1132
|
+
|
1133
|
+
|
1134
|
+
</div>
|
1135
|
+
</div>
|
1136
|
+
<div class="tags">
|
1137
|
+
<p class="tag_title">Parameters:</p>
|
1138
|
+
<ul class="param">
|
1139
|
+
|
1140
|
+
<li>
|
1141
|
+
|
1142
|
+
<span class='name'>value</span>
|
1143
|
+
|
1144
|
+
|
1145
|
+
<span class='type'>(<tt>Integer</tt>, <tt>nil</tt>)</span>
|
1146
|
+
|
1147
|
+
|
1148
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
1149
|
+
|
1150
|
+
|
1151
|
+
—
|
1152
|
+
<div class='inline'>
|
1153
|
+
<p>The desired maximum length. If ‘nil`, returns the current value.</p>
|
1154
|
+
</div>
|
1155
|
+
|
1156
|
+
</li>
|
1157
|
+
|
1158
|
+
</ul>
|
1159
|
+
|
1160
|
+
<p class="tag_title">Returns:</p>
|
1161
|
+
<ul class="return">
|
1162
|
+
|
1163
|
+
<li>
|
1164
|
+
|
1165
|
+
|
1166
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
1167
|
+
|
1168
|
+
|
1169
|
+
|
1170
|
+
—
|
1171
|
+
<div class='inline'>
|
1172
|
+
<p>The maximum length for the formatted message.</p>
|
1173
|
+
</div>
|
1174
|
+
|
1175
|
+
</li>
|
1176
|
+
|
1177
|
+
</ul>
|
1178
|
+
|
1179
|
+
</div><table class="source_code">
|
1180
|
+
<tr>
|
1181
|
+
<td>
|
1182
|
+
<pre class="lines">
|
1183
|
+
|
1184
|
+
|
1185
|
+
31
|
1186
|
+
32
|
1187
|
+
33</pre>
|
1188
|
+
</td>
|
1189
|
+
<td>
|
1190
|
+
<pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 31</span>
|
1191
|
+
|
1192
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_max_length'>max_length</span>
|
1193
|
+
<span class='ivar'>@max_length</span>
|
1194
|
+
<span class='kw'>end</span></pre>
|
1195
|
+
</td>
|
1196
|
+
</tr>
|
1197
|
+
</table>
|
1198
|
+
</div>
|
1199
|
+
|
1200
|
+
|
1201
|
+
<span id="on_capture_hook=-class_method"></span>
|
1202
|
+
<div class="method_details ">
|
1203
|
+
<h3 class="signature " id="on_capture_hook-class_method">
|
1204
|
+
|
1205
|
+
.<strong>on_capture_hook</strong> ⇒ <tt>Proc</tt><sup>?</sup>
|
1206
|
+
|
1207
|
+
|
1208
|
+
|
1209
|
+
|
1210
|
+
|
1211
|
+
</h3><div class="docstring">
|
1212
|
+
<div class="discussion">
|
1213
|
+
|
1214
|
+
<p>Hook to modify binding information upon capture.</p>
|
1215
|
+
|
1216
|
+
|
1217
|
+
</div>
|
1218
|
+
</div>
|
1219
|
+
<div class="tags">
|
1220
|
+
|
1221
|
+
<p class="tag_title">Returns:</p>
|
1222
|
+
<ul class="return">
|
1223
|
+
|
1224
|
+
<li>
|
1225
|
+
|
1226
|
+
|
1227
|
+
<span class='type'>(<tt>Proc</tt>, <tt>nil</tt>)</span>
|
1228
|
+
|
1229
|
+
|
1230
|
+
|
1231
|
+
</li>
|
1232
|
+
|
1233
|
+
</ul>
|
1234
|
+
|
1235
|
+
</div><table class="source_code">
|
1236
|
+
<tr>
|
1237
|
+
<td>
|
1238
|
+
<pre class="lines">
|
1239
|
+
|
1240
|
+
|
1241
|
+
36
|
1242
|
+
37
|
1243
|
+
38</pre>
|
1244
|
+
</td>
|
1245
|
+
<td>
|
1246
|
+
<pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 36</span>
|
1247
|
+
|
1248
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_on_capture_hook'>on_capture_hook</span>
|
1249
|
+
<span class='ivar'>@on_capture_hook</span>
|
1250
|
+
<span class='kw'>end</span></pre>
|
1251
|
+
</td>
|
1252
|
+
</tr>
|
1253
|
+
</table>
|
1254
|
+
</div>
|
1255
|
+
|
1256
|
+
|
1257
|
+
<span id="skip_list=-class_method"></span>
|
1258
|
+
<div class="method_details ">
|
1259
|
+
<h3 class="signature " id="skip_list-class_method">
|
1260
|
+
|
1261
|
+
.<strong>skip_list</strong> ⇒ <tt>Set<Symbol></tt>
|
1262
|
+
|
1263
|
+
|
1264
|
+
|
1265
|
+
|
1266
|
+
|
1267
|
+
</h3><div class="docstring">
|
1268
|
+
<div class="discussion">
|
1269
|
+
|
1270
|
+
<p>Retrieves the current skip list, initializing it with default values if not already set.</p>
|
1271
|
+
|
1272
|
+
|
1273
|
+
</div>
|
1274
|
+
</div>
|
1275
|
+
<div class="tags">
|
1276
|
+
|
1277
|
+
<p class="tag_title">Returns:</p>
|
1278
|
+
<ul class="return">
|
1279
|
+
|
1280
|
+
<li>
|
1281
|
+
|
1282
|
+
|
1283
|
+
<span class='type'>(<tt>Set<Symbol></tt>)</span>
|
1284
|
+
|
1285
|
+
|
1286
|
+
|
1287
|
+
—
|
1288
|
+
<div class='inline'>
|
1289
|
+
<p>The current skip list.</p>
|
1290
|
+
</div>
|
1291
|
+
|
1292
|
+
</li>
|
1293
|
+
|
1294
|
+
</ul>
|
1295
|
+
|
1296
|
+
</div><table class="source_code">
|
1297
|
+
<tr>
|
1298
|
+
<td>
|
1299
|
+
<pre class="lines">
|
1300
|
+
|
1301
|
+
|
1302
|
+
51
|
1303
|
+
52
|
1304
|
+
53</pre>
|
1305
|
+
</td>
|
1306
|
+
<td>
|
1307
|
+
<pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 51</span>
|
1308
|
+
|
1309
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_skip_list'>skip_list</span>
|
1310
|
+
<span class='ivar'>@skip_list</span>
|
1311
|
+
<span class='kw'>end</span></pre>
|
1312
|
+
</td>
|
1313
|
+
</tr>
|
1314
|
+
</table>
|
1315
|
+
</div>
|
1316
|
+
|
1317
|
+
|
1318
|
+
<span id="trace=-class_method"></span>
|
1319
|
+
<div class="method_details ">
|
1320
|
+
<h3 class="signature " id="trace-class_method">
|
1321
|
+
|
1322
|
+
.<strong>trace</strong> ⇒ <tt>TracePoint</tt><sup>?</sup>
|
1323
|
+
|
1324
|
+
|
1325
|
+
|
1326
|
+
|
1327
|
+
|
1328
|
+
</h3><div class="docstring">
|
1329
|
+
<div class="discussion">
|
1330
|
+
|
1331
|
+
<p>The TracePoint object used for tracing exceptions.</p>
|
1332
|
+
|
1333
|
+
|
1334
|
+
</div>
|
1335
|
+
</div>
|
1336
|
+
<div class="tags">
|
1337
|
+
|
1338
|
+
<p class="tag_title">Returns:</p>
|
1339
|
+
<ul class="return">
|
1340
|
+
|
1341
|
+
<li>
|
1342
|
+
|
1343
|
+
|
1344
|
+
<span class='type'>(<tt>TracePoint</tt>, <tt>nil</tt>)</span>
|
1345
|
+
|
1346
|
+
|
1347
|
+
|
1348
|
+
</li>
|
1349
|
+
|
1350
|
+
</ul>
|
1351
|
+
|
1352
|
+
</div><table class="source_code">
|
1353
|
+
<tr>
|
1354
|
+
<td>
|
1355
|
+
<pre class="lines">
|
1356
|
+
|
1357
|
+
|
1358
|
+
21
|
1359
|
+
22
|
1360
|
+
23</pre>
|
1361
|
+
</td>
|
1362
|
+
<td>
|
1363
|
+
<pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 21</span>
|
1364
|
+
|
1365
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_trace'>trace</span>
|
1366
|
+
<span class='ivar'>@trace</span>
|
1367
|
+
<span class='kw'>end</span></pre>
|
1368
|
+
</td>
|
1369
|
+
</tr>
|
1370
|
+
</table>
|
1371
|
+
</div>
|
1372
|
+
|
1373
|
+
</div>
|
1374
|
+
|
1375
|
+
|
1376
|
+
<div id="class_method_details" class="method_details_list">
|
1377
|
+
<h2>Class Method Details</h2>
|
1378
|
+
|
1379
|
+
|
1380
|
+
<div class="method_details first">
|
1381
|
+
<h3 class="signature first" id="add_to_skip_list-class_method">
|
1382
|
+
|
1383
|
+
.<strong>add_to_skip_list</strong>(*vars) ⇒ <tt>Set<Symbol></tt>
|
1384
|
+
|
1385
|
+
|
1386
|
+
|
1387
|
+
|
1388
|
+
|
1389
|
+
</h3><div class="docstring">
|
1390
|
+
<div class="discussion">
|
1391
|
+
|
1392
|
+
<p>Adds variables to the skip list to exclude them from binding information.</p>
|
1393
|
+
|
1394
|
+
|
1395
|
+
</div>
|
1396
|
+
</div>
|
1397
|
+
<div class="tags">
|
1398
|
+
<p class="tag_title">Parameters:</p>
|
1399
|
+
<ul class="param">
|
1400
|
+
|
1401
|
+
<li>
|
1402
|
+
|
1403
|
+
<span class='name'>vars</span>
|
1404
|
+
|
1405
|
+
|
1406
|
+
<span class='type'>(<tt>Symbol</tt>)</span>
|
1407
|
+
|
1408
|
+
|
1409
|
+
|
1410
|
+
—
|
1411
|
+
<div class='inline'>
|
1412
|
+
<p>The variable names to add to the skip list.</p>
|
1413
|
+
</div>
|
1414
|
+
|
1415
|
+
</li>
|
1416
|
+
|
1417
|
+
</ul>
|
1418
|
+
|
1419
|
+
<p class="tag_title">Returns:</p>
|
1420
|
+
<ul class="return">
|
1421
|
+
|
1422
|
+
<li>
|
1423
|
+
|
1424
|
+
|
1425
|
+
<span class='type'>(<tt>Set<Symbol></tt>)</span>
|
1426
|
+
|
1427
|
+
|
1428
|
+
|
1429
|
+
—
|
1430
|
+
<div class='inline'>
|
1431
|
+
<p>The updated skip list.</p>
|
1432
|
+
</div>
|
1433
|
+
|
1434
|
+
</li>
|
1435
|
+
|
1436
|
+
</ul>
|
1437
|
+
|
1438
|
+
</div><table class="source_code">
|
1439
|
+
<tr>
|
1440
|
+
<td>
|
1441
|
+
<pre class="lines">
|
1442
|
+
|
1443
|
+
|
1444
|
+
139
|
1445
|
+
140
|
1446
|
+
141</pre>
|
1447
|
+
</td>
|
1448
|
+
<td>
|
1449
|
+
<pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 139</span>
|
1450
|
+
|
1451
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_add_to_skip_list'>add_to_skip_list</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_vars'>vars</span><span class='rparen'>)</span>
|
1452
|
+
<span class='id identifier rubyid_skip_list'>skip_list</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_vars'>vars</span><span class='rparen'>)</span>
|
1453
|
+
<span class='kw'>end</span></pre>
|
1454
|
+
</td>
|
1455
|
+
</tr>
|
1456
|
+
</table>
|
1457
|
+
</div>
|
1458
|
+
|
1459
|
+
<div class="method_details ">
|
1460
|
+
<h3 class="signature " id="apply_skip_list-class_method">
|
1461
|
+
|
1462
|
+
.<strong>apply_skip_list</strong>(binding_info) ⇒ <tt>Hash</tt>
|
1463
|
+
|
1464
|
+
|
1465
|
+
|
1466
|
+
|
1467
|
+
|
1468
|
+
</h3><div class="docstring">
|
1469
|
+
<div class="discussion">
|
1470
|
+
|
1471
|
+
<p>Applies the skip list to the captured binding information, excluding specified variables.</p>
|
1472
|
+
|
1473
|
+
|
1474
|
+
</div>
|
1475
|
+
</div>
|
1476
|
+
<div class="tags">
|
1477
|
+
<p class="tag_title">Parameters:</p>
|
1478
|
+
<ul class="param">
|
1479
|
+
|
1480
|
+
<li>
|
1481
|
+
|
1482
|
+
<span class='name'>binding_info</span>
|
1483
|
+
|
1484
|
+
|
1485
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
1486
|
+
|
1487
|
+
|
1488
|
+
|
1489
|
+
—
|
1490
|
+
<div class='inline'>
|
1491
|
+
<p>The binding information to filter.</p>
|
1492
|
+
</div>
|
1493
|
+
|
1494
|
+
</li>
|
1495
|
+
|
1496
|
+
</ul>
|
1497
|
+
|
1498
|
+
<p class="tag_title">Returns:</p>
|
1499
|
+
<ul class="return">
|
1500
|
+
|
1501
|
+
<li>
|
1502
|
+
|
1503
|
+
|
1504
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
1505
|
+
|
1506
|
+
|
1507
|
+
|
1508
|
+
—
|
1509
|
+
<div class='inline'>
|
1510
|
+
<p>The filtered binding information.</p>
|
1511
|
+
</div>
|
1512
|
+
|
1513
|
+
</li>
|
1514
|
+
|
1515
|
+
</ul>
|
1516
|
+
|
1517
|
+
</div><table class="source_code">
|
1518
|
+
<tr>
|
1519
|
+
<td>
|
1520
|
+
<pre class="lines">
|
1521
|
+
|
1522
|
+
|
1523
|
+
311
|
1524
|
+
312
|
1525
|
+
313
|
1526
|
+
314
|
1527
|
+
315
|
1528
|
+
316
|
1529
|
+
317
|
1530
|
+
318
|
1531
|
+
319</pre>
|
1532
|
+
</td>
|
1533
|
+
<td>
|
1534
|
+
<pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 311</span>
|
1535
|
+
|
1536
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_apply_skip_list'>apply_skip_list</span><span class='lparen'>(</span><span class='id identifier rubyid_binding_info'>binding_info</span><span class='rparen'>)</span>
|
1537
|
+
<span class='kw'>unless</span> <span class='ivar'>@debug</span>
|
1538
|
+
<span class='id identifier rubyid_variables'>variables</span> <span class='op'>=</span> <span class='id identifier rubyid_binding_info'>binding_info</span><span class='lbracket'>[</span><span class='symbol'>:variables</span><span class='rbracket'>]</span>
|
1539
|
+
<span class='id identifier rubyid_variables'>variables</span><span class='lbracket'>[</span><span class='symbol'>:instances</span><span class='rbracket'>]</span><span class='op'>&.</span><span class='id identifier rubyid_reject!'>reject!</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_var'>var</span><span class='comma'>,</span> <span class='id identifier rubyid__'>_</span><span class='op'>|</span> <span class='id identifier rubyid_skip_list'>skip_list</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_var'>var</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_var'>var</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_start_with?'>start_with?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>@__</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
1540
|
+
<span class='id identifier rubyid_variables'>variables</span><span class='lbracket'>[</span><span class='symbol'>:locals</span><span class='rbracket'>]</span><span class='op'>&.</span><span class='id identifier rubyid_reject!'>reject!</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_var'>var</span><span class='comma'>,</span> <span class='id identifier rubyid__'>_</span><span class='op'>|</span> <span class='id identifier rubyid_skip_list'>skip_list</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_var'>var</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
1541
|
+
<span class='id identifier rubyid_variables'>variables</span><span class='lbracket'>[</span><span class='symbol'>:globals</span><span class='rbracket'>]</span><span class='op'>&.</span><span class='id identifier rubyid_reject!'>reject!</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_var'>var</span><span class='comma'>,</span> <span class='id identifier rubyid__'>_</span><span class='op'>|</span> <span class='id identifier rubyid_skip_list'>skip_list</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_var'>var</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
1542
|
+
<span class='kw'>end</span>
|
1543
|
+
<span class='id identifier rubyid_binding_info'>binding_info</span>
|
1544
|
+
<span class='kw'>end</span></pre>
|
1545
|
+
</td>
|
1546
|
+
</tr>
|
1547
|
+
</table>
|
1548
|
+
</div>
|
1549
|
+
|
1550
|
+
<div class="method_details ">
|
1551
|
+
<h3 class="signature " id="binding_info_string-class_method">
|
1552
|
+
|
1553
|
+
.<strong>binding_info_string</strong>(binding_info) ⇒ <tt>String</tt>
|
1554
|
+
|
1555
|
+
|
1556
|
+
|
1557
|
+
|
1558
|
+
|
1559
|
+
</h3><div class="docstring">
|
1560
|
+
<div class="discussion">
|
1561
|
+
|
1562
|
+
<p>Formats a single binding information hash into a string with colorization.</p>
|
1563
|
+
|
1564
|
+
|
1565
|
+
</div>
|
1566
|
+
</div>
|
1567
|
+
<div class="tags">
|
1568
|
+
<p class="tag_title">Parameters:</p>
|
1569
|
+
<ul class="param">
|
1570
|
+
|
1571
|
+
<li>
|
1572
|
+
|
1573
|
+
<span class='name'>binding_info</span>
|
1574
|
+
|
1575
|
+
|
1576
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
1577
|
+
|
1578
|
+
|
1579
|
+
|
1580
|
+
—
|
1581
|
+
<div class='inline'>
|
1582
|
+
<p>The binding information to format.</p>
|
1583
|
+
</div>
|
1584
|
+
|
1585
|
+
</li>
|
1586
|
+
|
1587
|
+
</ul>
|
1588
|
+
|
1589
|
+
<p class="tag_title">Returns:</p>
|
1590
|
+
<ul class="return">
|
1591
|
+
|
1592
|
+
<li>
|
1593
|
+
|
1594
|
+
|
1595
|
+
<span class='type'>(<tt>String</tt>)</span>
|
1596
|
+
|
1597
|
+
|
1598
|
+
|
1599
|
+
—
|
1600
|
+
<div class='inline'>
|
1601
|
+
<p>The formatted string.</p>
|
1602
|
+
</div>
|
1603
|
+
|
1604
|
+
</li>
|
1605
|
+
|
1606
|
+
</ul>
|
1607
|
+
|
1608
|
+
</div><table class="source_code">
|
1609
|
+
<tr>
|
1610
|
+
<td>
|
1611
|
+
<pre class="lines">
|
1612
|
+
|
1613
|
+
|
1614
|
+
337
|
1615
|
+
338
|
1616
|
+
339
|
1617
|
+
340
|
1618
|
+
341
|
1619
|
+
342
|
1620
|
+
343
|
1621
|
+
344
|
1622
|
+
345
|
1623
|
+
346
|
1624
|
+
347
|
1625
|
+
348
|
1626
|
+
349
|
1627
|
+
350
|
1628
|
+
351
|
1629
|
+
352
|
1630
|
+
353
|
1631
|
+
354
|
1632
|
+
355
|
1633
|
+
356
|
1634
|
+
357
|
1635
|
+
358
|
1636
|
+
359
|
1637
|
+
360
|
1638
|
+
361
|
1639
|
+
362
|
1640
|
+
363
|
1641
|
+
364
|
1642
|
+
365
|
1643
|
+
366
|
1644
|
+
367</pre>
|
1645
|
+
</td>
|
1646
|
+
<td>
|
1647
|
+
<pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 337</span>
|
1648
|
+
|
1649
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_binding_info_string'>binding_info_string</span><span class='lparen'>(</span><span class='id identifier rubyid_binding_info'>binding_info</span><span class='rparen'>)</span>
|
1650
|
+
<span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="Colors.html" title="Colors (class)">Colors</a></span></span><span class='period'>.</span><span class='id identifier rubyid_green'>green</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_binding_info'>binding_info</span><span class='lbracket'>[</span><span class='symbol'>:capture_type</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_capitalize'>capitalize</span><span class='embexpr_end'>}</span><span class='tstring_content'>: </span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="Colors.html" title="Colors (class)">Colors</a></span></span><span class='period'>.</span><span class='id identifier rubyid_blue'>blue</span><span class='lparen'>(</span><span class='id identifier rubyid_binding_info'>binding_info</span><span class='lbracket'>[</span><span class='symbol'>:source</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
1651
|
+
|
1652
|
+
<span class='id identifier rubyid_result'>result</span> <span class='op'>+=</span> <span class='id identifier rubyid_method_and_args_desc'>method_and_args_desc</span><span class='lparen'>(</span><span class='id identifier rubyid_binding_info'>binding_info</span><span class='lbracket'>[</span><span class='symbol'>:method_and_args</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
1653
|
+
|
1654
|
+
<span class='id identifier rubyid_variables'>variables</span> <span class='op'>=</span> <span class='id identifier rubyid_binding_info'>binding_info</span><span class='lbracket'>[</span><span class='symbol'>:variables</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
1655
|
+
|
1656
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_variables'>variables</span><span class='lbracket'>[</span><span class='symbol'>:locals</span><span class='rbracket'>]</span> <span class='op'>&&</span> <span class='op'>!</span><span class='id identifier rubyid_variables'>variables</span><span class='lbracket'>[</span><span class='symbol'>:locals</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
1657
|
+
<span class='id identifier rubyid_result'>result</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="Colors.html" title="Colors (class)">Colors</a></span></span><span class='period'>.</span><span class='id identifier rubyid_green'>green</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Locals:</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>\n</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_variable_description'>variable_description</span><span class='lparen'>(</span><span class='id identifier rubyid_variables'>variables</span><span class='lbracket'>[</span><span class='symbol'>:locals</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
1658
|
+
<span class='kw'>end</span>
|
1659
|
+
|
1660
|
+
<span class='id identifier rubyid_instance_vars_to_display'>instance_vars_to_display</span> <span class='op'>=</span> <span class='id identifier rubyid_variables'>variables</span><span class='lbracket'>[</span><span class='symbol'>:instances</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
1661
|
+
|
1662
|
+
|
1663
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_instance_vars_to_display'>instance_vars_to_display</span> <span class='op'>&&</span> <span class='op'>!</span><span class='id identifier rubyid_instance_vars_to_display'>instance_vars_to_display</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
1664
|
+
<span class='id identifier rubyid_result'>result</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="Colors.html" title="Colors (class)">Colors</a></span></span><span class='period'>.</span><span class='id identifier rubyid_green'>green</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Instances:</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>\n</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_variable_description'>variable_description</span><span class='lparen'>(</span><span class='id identifier rubyid_instance_vars_to_display'>instance_vars_to_display</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
1665
|
+
<span class='kw'>end</span>
|
1666
|
+
|
1667
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_variables'>variables</span><span class='lbracket'>[</span><span class='symbol'>:lets</span><span class='rbracket'>]</span> <span class='op'>&&</span> <span class='op'>!</span><span class='id identifier rubyid_variables'>variables</span><span class='lbracket'>[</span><span class='symbol'>:lets</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
1668
|
+
<span class='id identifier rubyid_result'>result</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="Colors.html" title="Colors (class)">Colors</a></span></span><span class='period'>.</span><span class='id identifier rubyid_green'>green</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Let Variables:</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>\n</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_variable_description'>variable_description</span><span class='lparen'>(</span><span class='id identifier rubyid_variables'>variables</span><span class='lbracket'>[</span><span class='symbol'>:lets</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
1669
|
+
<span class='kw'>end</span>
|
1670
|
+
|
1671
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_variables'>variables</span><span class='lbracket'>[</span><span class='symbol'>:globals</span><span class='rbracket'>]</span> <span class='op'>&&</span> <span class='op'>!</span><span class='id identifier rubyid_variables'>variables</span><span class='lbracket'>[</span><span class='symbol'>:globals</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
1672
|
+
<span class='id identifier rubyid_result'>result</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="Colors.html" title="Colors (class)">Colors</a></span></span><span class='period'>.</span><span class='id identifier rubyid_green'>green</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Globals:</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>\n</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_variable_description'>variable_description</span><span class='lparen'>(</span><span class='id identifier rubyid_variables'>variables</span><span class='lbracket'>[</span><span class='symbol'>:globals</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
1673
|
+
<span class='kw'>end</span>
|
1674
|
+
|
1675
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_result'>result</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>></span> <span class='id identifier rubyid_max_length'>max_length</span>
|
1676
|
+
<span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='id identifier rubyid_result'>result</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>...</span><span class='id identifier rubyid_max_length'>max_length</span><span class='rbracket'>]</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>... (truncated)</span><span class='tstring_end'>"</span></span>
|
1677
|
+
<span class='kw'>end</span>
|
1678
|
+
<span class='id identifier rubyid_result'>result</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n\n</span><span class='tstring_end'>"</span></span>
|
1679
|
+
<span class='kw'>end</span></pre>
|
1680
|
+
</td>
|
1681
|
+
</tr>
|
1682
|
+
</table>
|
1683
|
+
</div>
|
1684
|
+
|
1685
|
+
<div class="method_details ">
|
1686
|
+
<h3 class="signature " id="binding_infos_array_to_string-class_method">
|
1687
|
+
|
1688
|
+
.<strong>binding_infos_array_to_string</strong>(captured_bindings, format = :terminal) ⇒ <tt>String</tt>
|
1689
|
+
|
1690
|
+
|
1691
|
+
|
1692
|
+
|
1693
|
+
|
1694
|
+
</h3><div class="docstring">
|
1695
|
+
<div class="discussion">
|
1696
|
+
|
1697
|
+
<p>Converts an array of binding information hashes into a formatted string.</p>
|
1698
|
+
|
1699
|
+
|
1700
|
+
</div>
|
1701
|
+
</div>
|
1702
|
+
<div class="tags">
|
1703
|
+
<p class="tag_title">Parameters:</p>
|
1704
|
+
<ul class="param">
|
1705
|
+
|
1706
|
+
<li>
|
1707
|
+
|
1708
|
+
<span class='name'>captured_bindings</span>
|
1709
|
+
|
1710
|
+
|
1711
|
+
<span class='type'>(<tt>Array<Hash></tt>)</span>
|
1712
|
+
|
1713
|
+
|
1714
|
+
|
1715
|
+
—
|
1716
|
+
<div class='inline'>
|
1717
|
+
<p>The array of binding information.</p>
|
1718
|
+
</div>
|
1719
|
+
|
1720
|
+
</li>
|
1721
|
+
|
1722
|
+
<li>
|
1723
|
+
|
1724
|
+
<span class='name'>format</span>
|
1725
|
+
|
1726
|
+
|
1727
|
+
<span class='type'>(<tt>Symbol</tt>)</span>
|
1728
|
+
|
1729
|
+
|
1730
|
+
<em class="default">(defaults to: <tt>:terminal</tt>)</em>
|
1731
|
+
|
1732
|
+
|
1733
|
+
—
|
1734
|
+
<div class='inline'>
|
1735
|
+
<p>The format to use (:json, :plaintext, :terminal).</p>
|
1736
|
+
</div>
|
1737
|
+
|
1738
|
+
</li>
|
1739
|
+
|
1740
|
+
</ul>
|
1741
|
+
|
1742
|
+
<p class="tag_title">Returns:</p>
|
1743
|
+
<ul class="return">
|
1744
|
+
|
1745
|
+
<li>
|
1746
|
+
|
1747
|
+
|
1748
|
+
<span class='type'>(<tt>String</tt>)</span>
|
1749
|
+
|
1750
|
+
|
1751
|
+
|
1752
|
+
—
|
1753
|
+
<div class='inline'>
|
1754
|
+
<p>The formatted string representation of the binding information.</p>
|
1755
|
+
</div>
|
1756
|
+
|
1757
|
+
</li>
|
1758
|
+
|
1759
|
+
</ul>
|
1760
|
+
|
1761
|
+
</div><table class="source_code">
|
1762
|
+
<tr>
|
1763
|
+
<td>
|
1764
|
+
<pre class="lines">
|
1765
|
+
|
1766
|
+
|
1767
|
+
253
|
1768
|
+
254
|
1769
|
+
255
|
1770
|
+
256
|
1771
|
+
257
|
1772
|
+
258
|
1773
|
+
259
|
1774
|
+
260
|
1775
|
+
261
|
1776
|
+
262
|
1777
|
+
263
|
1778
|
+
264
|
1779
|
+
265
|
1780
|
+
266
|
1781
|
+
267
|
1782
|
+
268</pre>
|
1783
|
+
</td>
|
1784
|
+
<td>
|
1785
|
+
<pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 253</span>
|
1786
|
+
|
1787
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_binding_infos_array_to_string'>binding_infos_array_to_string</span><span class='lparen'>(</span><span class='id identifier rubyid_captured_bindings'>captured_bindings</span><span class='comma'>,</span> <span class='id identifier rubyid_format'>format</span> <span class='op'>=</span> <span class='symbol'>:terminal</span><span class='rparen'>)</span>
|
1788
|
+
<span class='kw'>case</span> <span class='id identifier rubyid_format'>format</span>
|
1789
|
+
<span class='kw'>when</span> <span class='symbol'>:json</span>
|
1790
|
+
<span class='const'><span class='object_link'><a href="Colors.html" title="Colors (class)">Colors</a></span></span><span class='period'>.</span><span class='id identifier rubyid_enabled'>enabled</span> <span class='op'>=</span> <span class='kw'>false</span>
|
1791
|
+
<span class='const'>JSON</span><span class='period'>.</span><span class='id identifier rubyid_pretty_generate'>pretty_generate</span><span class='lparen'>(</span><span class='id identifier rubyid_captured_bindings'>captured_bindings</span><span class='rparen'>)</span>
|
1792
|
+
<span class='kw'>when</span> <span class='symbol'>:plaintext</span>
|
1793
|
+
<span class='const'><span class='object_link'><a href="Colors.html" title="Colors (class)">Colors</a></span></span><span class='period'>.</span><span class='id identifier rubyid_enabled'>enabled</span> <span class='op'>=</span> <span class='kw'>false</span>
|
1794
|
+
<span class='id identifier rubyid_captured_bindings'>captured_bindings</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_binding_info'>binding_info</span><span class='op'>|</span> <span class='id identifier rubyid_binding_info_string'>binding_info_string</span><span class='lparen'>(</span><span class='id identifier rubyid_binding_info'>binding_info</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
1795
|
+
<span class='kw'>when</span> <span class='symbol'>:terminal</span>
|
1796
|
+
<span class='const'><span class='object_link'><a href="Colors.html" title="Colors (class)">Colors</a></span></span><span class='period'>.</span><span class='id identifier rubyid_enabled'>enabled</span> <span class='op'>=</span> <span class='kw'>true</span>
|
1797
|
+
<span class='id identifier rubyid_captured_bindings'>captured_bindings</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_binding_info'>binding_info</span><span class='op'>|</span> <span class='id identifier rubyid_binding_info_string'>binding_info_string</span><span class='lparen'>(</span><span class='id identifier rubyid_binding_info'>binding_info</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
1798
|
+
<span class='kw'>else</span>
|
1799
|
+
<span class='const'><span class='object_link'><a href="Colors.html" title="Colors (class)">Colors</a></span></span><span class='period'>.</span><span class='id identifier rubyid_enabled'>enabled</span> <span class='op'>=</span> <span class='kw'>false</span>
|
1800
|
+
<span class='id identifier rubyid_captured_bindings'>captured_bindings</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_binding_info'>binding_info</span><span class='op'>|</span> <span class='id identifier rubyid_binding_info_string'>binding_info_string</span><span class='lparen'>(</span><span class='id identifier rubyid_binding_info'>binding_info</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
1801
|
+
<span class='kw'>end</span>
|
1802
|
+
<span class='kw'>end</span></pre>
|
1803
|
+
</td>
|
1804
|
+
</tr>
|
1805
|
+
</table>
|
1806
|
+
</div>
|
1807
|
+
|
1808
|
+
<div class="method_details ">
|
1809
|
+
<h3 class="signature " id="default_skip_list-class_method">
|
1810
|
+
|
1811
|
+
.<strong>default_skip_list</strong> ⇒ <tt>Set<Symbol></tt>
|
1812
|
+
|
1813
|
+
|
1814
|
+
|
1815
|
+
|
1816
|
+
|
1817
|
+
</h3><div class="docstring">
|
1818
|
+
<div class="discussion">
|
1819
|
+
|
1820
|
+
<p>Initializes the default skip list by merging Rails and RSpec specific variables.</p>
|
1821
|
+
|
1822
|
+
|
1823
|
+
</div>
|
1824
|
+
</div>
|
1825
|
+
<div class="tags">
|
1826
|
+
|
1827
|
+
<p class="tag_title">Returns:</p>
|
1828
|
+
<ul class="return">
|
1829
|
+
|
1830
|
+
<li>
|
1831
|
+
|
1832
|
+
|
1833
|
+
<span class='type'>(<tt>Set<Symbol></tt>)</span>
|
1834
|
+
|
1835
|
+
|
1836
|
+
|
1837
|
+
—
|
1838
|
+
<div class='inline'>
|
1839
|
+
<p>The default skip list.</p>
|
1840
|
+
</div>
|
1841
|
+
|
1842
|
+
</li>
|
1843
|
+
|
1844
|
+
</ul>
|
1845
|
+
|
1846
|
+
</div><table class="source_code">
|
1847
|
+
<tr>
|
1848
|
+
<td>
|
1849
|
+
<pre class="lines">
|
1850
|
+
|
1851
|
+
|
1852
|
+
131
|
1853
|
+
132
|
1854
|
+
133</pre>
|
1855
|
+
</td>
|
1856
|
+
<td>
|
1857
|
+
<pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 131</span>
|
1858
|
+
|
1859
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_default_skip_list'>default_skip_list</span>
|
1860
|
+
<span class='const'>Set</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="#RAILS_SKIP_LIST-constant" title="EnhancedErrors::RAILS_SKIP_LIST (constant)">RAILS_SKIP_LIST</a></span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="#RSPEC_SKIP_LIST-constant" title="EnhancedErrors::RSPEC_SKIP_LIST (constant)">RSPEC_SKIP_LIST</a></span></span><span class='rparen'>)</span>
|
1861
|
+
<span class='kw'>end</span></pre>
|
1862
|
+
</td>
|
1863
|
+
</tr>
|
1864
|
+
</table>
|
1865
|
+
</div>
|
1866
|
+
|
1867
|
+
<div class="method_details ">
|
1868
|
+
<h3 class="signature " id="enhance!-class_method">
|
1869
|
+
|
1870
|
+
.<strong>enhance!</strong>(enabled: true, debug: false, **options) {|void| ... } ⇒ <tt>void</tt>
|
1871
|
+
|
1872
|
+
|
1873
|
+
|
1874
|
+
|
1875
|
+
|
1876
|
+
</h3><div class="docstring">
|
1877
|
+
<div class="discussion">
|
1878
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
1879
|
+
<p>Enhances the exception handling by setting up tracing and configuration options.</p>
|
1880
|
+
|
1881
|
+
|
1882
|
+
</div>
|
1883
|
+
</div>
|
1884
|
+
<div class="tags">
|
1885
|
+
<p class="tag_title">Parameters:</p>
|
1886
|
+
<ul class="param">
|
1887
|
+
|
1888
|
+
<li>
|
1889
|
+
|
1890
|
+
<span class='name'>enabled</span>
|
1891
|
+
|
1892
|
+
|
1893
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
1894
|
+
|
1895
|
+
|
1896
|
+
<em class="default">(defaults to: <tt>true</tt>)</em>
|
1897
|
+
|
1898
|
+
|
1899
|
+
—
|
1900
|
+
<div class='inline'>
|
1901
|
+
<p>Whether to enable EnhancedErrors.</p>
|
1902
|
+
</div>
|
1903
|
+
|
1904
|
+
</li>
|
1905
|
+
|
1906
|
+
<li>
|
1907
|
+
|
1908
|
+
<span class='name'>debug</span>
|
1909
|
+
|
1910
|
+
|
1911
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
1912
|
+
|
1913
|
+
|
1914
|
+
<em class="default">(defaults to: <tt>false</tt>)</em>
|
1915
|
+
|
1916
|
+
|
1917
|
+
—
|
1918
|
+
<div class='inline'>
|
1919
|
+
<p>Whether to enable debug mode.</p>
|
1920
|
+
</div>
|
1921
|
+
|
1922
|
+
</li>
|
1923
|
+
|
1924
|
+
<li>
|
1925
|
+
|
1926
|
+
<span class='name'>options</span>
|
1927
|
+
|
1928
|
+
|
1929
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
1930
|
+
|
1931
|
+
|
1932
|
+
|
1933
|
+
—
|
1934
|
+
<div class='inline'>
|
1935
|
+
<p>Additional configuration options.</p>
|
1936
|
+
</div>
|
1937
|
+
|
1938
|
+
</li>
|
1939
|
+
|
1940
|
+
</ul>
|
1941
|
+
|
1942
|
+
<p class="tag_title">Yields:</p>
|
1943
|
+
<ul class="yield">
|
1944
|
+
|
1945
|
+
<li>
|
1946
|
+
|
1947
|
+
|
1948
|
+
<span class='type'>(<tt>void</tt>)</span>
|
1949
|
+
|
1950
|
+
|
1951
|
+
|
1952
|
+
—
|
1953
|
+
<div class='inline'>
|
1954
|
+
<p>A block for additional configuration.</p>
|
1955
|
+
</div>
|
1956
|
+
|
1957
|
+
</li>
|
1958
|
+
|
1959
|
+
</ul>
|
1960
|
+
|
1961
|
+
</div><table class="source_code">
|
1962
|
+
<tr>
|
1963
|
+
<td>
|
1964
|
+
<pre class="lines">
|
1965
|
+
|
1966
|
+
|
1967
|
+
150
|
1968
|
+
151
|
1969
|
+
152
|
1970
|
+
153
|
1971
|
+
154
|
1972
|
+
155
|
1973
|
+
156
|
1974
|
+
157
|
1975
|
+
158
|
1976
|
+
159
|
1977
|
+
160
|
1978
|
+
161
|
1979
|
+
162
|
1980
|
+
163
|
1981
|
+
164
|
1982
|
+
165
|
1983
|
+
166
|
1984
|
+
167
|
1985
|
+
168
|
1986
|
+
169
|
1987
|
+
170
|
1988
|
+
171
|
1989
|
+
172
|
1990
|
+
173
|
1991
|
+
174
|
1992
|
+
175
|
1993
|
+
176
|
1994
|
+
177
|
1995
|
+
178
|
1996
|
+
179</pre>
|
1997
|
+
</td>
|
1998
|
+
<td>
|
1999
|
+
<pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 150</span>
|
2000
|
+
|
2001
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_enhance!'>enhance!</span><span class='lparen'>(</span><span class='label'>enabled:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>debug:</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_options'>options</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
2002
|
+
<span class='ivar'>@output_format</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
2003
|
+
<span class='ivar'>@eligible_for_capture</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
2004
|
+
<span class='ivar'>@original_global_variables</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
2005
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_enabled'>enabled</span> <span class='op'>==</span> <span class='kw'>false</span>
|
2006
|
+
<span class='ivar'>@original_global_variables</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
2007
|
+
<span class='ivar'>@enabled</span> <span class='op'>=</span> <span class='kw'>false</span>
|
2008
|
+
<span class='ivar'>@trace</span><span class='period'>.</span><span class='id identifier rubyid_disable'>disable</span> <span class='kw'>if</span> <span class='ivar'>@trace</span>
|
2009
|
+
<span class='kw'>else</span>
|
2010
|
+
<span class='ivar'>@enabled</span> <span class='op'>=</span> <span class='kw'>true</span>
|
2011
|
+
<span class='ivar'>@debug</span> <span class='op'>=</span> <span class='id identifier rubyid_debug'>debug</span>
|
2012
|
+
<span class='ivar'>@original_global_variables</span> <span class='op'>=</span> <span class='id identifier rubyid_global_variables'>global_variables</span>
|
2013
|
+
|
2014
|
+
<span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
|
2015
|
+
<span class='id identifier rubyid_setter_method'>setter_method</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key'>key</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span>
|
2016
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='id identifier rubyid_setter_method'>setter_method</span><span class='rparen'>)</span>
|
2017
|
+
<span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_setter_method'>setter_method</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
2018
|
+
<span class='kw'>elsif</span> <span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
|
2019
|
+
<span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
2020
|
+
<span class='kw'>else</span>
|
2021
|
+
<span class='comment'># Ignore unknown options or handle as needed
|
2022
|
+
</span> <span class='kw'>end</span>
|
2023
|
+
<span class='kw'>end</span>
|
2024
|
+
|
2025
|
+
<span class='ivar'>@config_block</span> <span class='op'>=</span> <span class='id identifier rubyid_block_given?'>block_given?</span> <span class='op'>?</span> <span class='id identifier rubyid_block'>block</span> <span class='op'>:</span> <span class='kw'>nil</span>
|
2026
|
+
<span class='id identifier rubyid_instance_eval'>instance_eval</span><span class='lparen'>(</span><span class='op'>&</span><span class='ivar'>@config_block</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='ivar'>@config_block</span>
|
2027
|
+
|
2028
|
+
<span class='id identifier rubyid_start_tracing'>start_tracing</span>
|
2029
|
+
<span class='kw'>end</span>
|
2030
|
+
<span class='kw'>end</span></pre>
|
2031
|
+
</td>
|
2032
|
+
</tr>
|
2033
|
+
</table>
|
2034
|
+
</div>
|
2035
|
+
|
2036
|
+
<div class="method_details ">
|
2037
|
+
<h3 class="signature " id="format-class_method">
|
2038
|
+
|
2039
|
+
.<strong>format</strong>(captured_bindings = [], output_format = get_default_format_for_environment) ⇒ <tt>String</tt>
|
2040
|
+
|
2041
|
+
|
2042
|
+
|
2043
|
+
|
2044
|
+
|
2045
|
+
</h3><div class="docstring">
|
2046
|
+
<div class="discussion">
|
2047
|
+
|
2048
|
+
<p>Formats the captured binding information into a string based on the specified format.</p>
|
2049
|
+
|
2050
|
+
|
2051
|
+
</div>
|
2052
|
+
</div>
|
2053
|
+
<div class="tags">
|
2054
|
+
<p class="tag_title">Parameters:</p>
|
2055
|
+
<ul class="param">
|
2056
|
+
|
2057
|
+
<li>
|
2058
|
+
|
2059
|
+
<span class='name'>captured_bindings</span>
|
2060
|
+
|
2061
|
+
|
2062
|
+
<span class='type'>(<tt>Array<Hash></tt>)</span>
|
2063
|
+
|
2064
|
+
|
2065
|
+
<em class="default">(defaults to: <tt>[]</tt>)</em>
|
2066
|
+
|
2067
|
+
|
2068
|
+
—
|
2069
|
+
<div class='inline'>
|
2070
|
+
<p>The array of captured binding information.</p>
|
2071
|
+
</div>
|
2072
|
+
|
2073
|
+
</li>
|
2074
|
+
|
2075
|
+
<li>
|
2076
|
+
|
2077
|
+
<span class='name'>output_format</span>
|
2078
|
+
|
2079
|
+
|
2080
|
+
<span class='type'>(<tt>Symbol</tt>)</span>
|
2081
|
+
|
2082
|
+
|
2083
|
+
<em class="default">(defaults to: <tt>get_default_format_for_environment</tt>)</em>
|
2084
|
+
|
2085
|
+
|
2086
|
+
—
|
2087
|
+
<div class='inline'>
|
2088
|
+
<p>The format to use (:json, :plaintext, :terminal).</p>
|
2089
|
+
</div>
|
2090
|
+
|
2091
|
+
</li>
|
2092
|
+
|
2093
|
+
</ul>
|
2094
|
+
|
2095
|
+
<p class="tag_title">Returns:</p>
|
2096
|
+
<ul class="return">
|
2097
|
+
|
2098
|
+
<li>
|
2099
|
+
|
2100
|
+
|
2101
|
+
<span class='type'>(<tt>String</tt>)</span>
|
2102
|
+
|
2103
|
+
|
2104
|
+
|
2105
|
+
—
|
2106
|
+
<div class='inline'>
|
2107
|
+
<p>The formatted exception message.</p>
|
2108
|
+
</div>
|
2109
|
+
|
2110
|
+
</li>
|
2111
|
+
|
2112
|
+
</ul>
|
2113
|
+
|
2114
|
+
</div><table class="source_code">
|
2115
|
+
<tr>
|
2116
|
+
<td>
|
2117
|
+
<pre class="lines">
|
2118
|
+
|
2119
|
+
|
2120
|
+
238
|
2121
|
+
239
|
2122
|
+
240
|
2123
|
+
241
|
2124
|
+
242
|
2125
|
+
243
|
2126
|
+
244
|
2127
|
+
245
|
2128
|
+
246</pre>
|
2129
|
+
</td>
|
2130
|
+
<td>
|
2131
|
+
<pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 238</span>
|
2132
|
+
|
2133
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_format'>format</span><span class='lparen'>(</span><span class='id identifier rubyid_captured_bindings'>captured_bindings</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_output_format'>output_format</span> <span class='op'>=</span> <span class='id identifier rubyid_get_default_format_for_environment'>get_default_format_for_environment</span><span class='rparen'>)</span>
|
2134
|
+
<span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='id identifier rubyid_binding_infos_array_to_string'>binding_infos_array_to_string</span><span class='lparen'>(</span><span class='id identifier rubyid_captured_bindings'>captured_bindings</span><span class='comma'>,</span> <span class='id identifier rubyid_output_format'>output_format</span><span class='rparen'>)</span>
|
2135
|
+
<span class='kw'>if</span> <span class='ivar'>@on_format_hook</span>
|
2136
|
+
<span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='ivar'>@on_format_hook</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_result'>result</span><span class='rparen'>)</span>
|
2137
|
+
<span class='kw'>else</span>
|
2138
|
+
<span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='id identifier rubyid_default_on_format'>default_on_format</span><span class='lparen'>(</span><span class='id identifier rubyid_result'>result</span><span class='rparen'>)</span>
|
2139
|
+
<span class='kw'>end</span>
|
2140
|
+
<span class='id identifier rubyid_result'>result</span>
|
2141
|
+
<span class='kw'>end</span></pre>
|
2142
|
+
</td>
|
2143
|
+
</tr>
|
2144
|
+
</table>
|
2145
|
+
</div>
|
2146
|
+
|
2147
|
+
<div class="method_details ">
|
2148
|
+
<h3 class="signature " id="get_default_format_for_environment-class_method">
|
2149
|
+
|
2150
|
+
.<strong>get_default_format_for_environment</strong> ⇒ <tt>Symbol</tt>
|
2151
|
+
|
2152
|
+
|
2153
|
+
|
2154
|
+
|
2155
|
+
|
2156
|
+
</h3><div class="docstring">
|
2157
|
+
<div class="discussion">
|
2158
|
+
|
2159
|
+
<p>Determines the default output format based on the current environment.</p>
|
2160
|
+
|
2161
|
+
|
2162
|
+
</div>
|
2163
|
+
</div>
|
2164
|
+
<div class="tags">
|
2165
|
+
|
2166
|
+
<p class="tag_title">Returns:</p>
|
2167
|
+
<ul class="return">
|
2168
|
+
|
2169
|
+
<li>
|
2170
|
+
|
2171
|
+
|
2172
|
+
<span class='type'>(<tt>Symbol</tt>)</span>
|
2173
|
+
|
2174
|
+
|
2175
|
+
|
2176
|
+
—
|
2177
|
+
<div class='inline'>
|
2178
|
+
<p>The default format (:json, :plaintext, :terminal).</p>
|
2179
|
+
</div>
|
2180
|
+
|
2181
|
+
</li>
|
2182
|
+
|
2183
|
+
</ul>
|
2184
|
+
|
2185
|
+
</div><table class="source_code">
|
2186
|
+
<tr>
|
2187
|
+
<td>
|
2188
|
+
<pre class="lines">
|
2189
|
+
|
2190
|
+
|
2191
|
+
273
|
2192
|
+
274
|
2193
|
+
275
|
2194
|
+
276
|
2195
|
+
277
|
2196
|
+
278
|
2197
|
+
279
|
2198
|
+
280
|
2199
|
+
281
|
2200
|
+
282
|
2201
|
+
283
|
2202
|
+
284
|
2203
|
+
285
|
2204
|
+
286
|
2205
|
+
287
|
2206
|
+
288</pre>
|
2207
|
+
</td>
|
2208
|
+
<td>
|
2209
|
+
<pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 273</span>
|
2210
|
+
|
2211
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_get_default_format_for_environment'>get_default_format_for_environment</span>
|
2212
|
+
<span class='kw'>return</span> <span class='ivar'>@output_format</span> <span class='kw'>unless</span> <span class='ivar'>@output_format</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
2213
|
+
<span class='id identifier rubyid_env'>env</span> <span class='op'>=</span> <span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>RAILS_ENV</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>RACK_ENV</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>development</span><span class='tstring_end'>'</span></span>
|
2214
|
+
<span class='ivar'>@output_format</span> <span class='op'>=</span> <span class='kw'>case</span> <span class='id identifier rubyid_env'>env</span>
|
2215
|
+
<span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>development</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>test</span><span class='tstring_end'>'</span></span>
|
2216
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_running_in_ci?'>running_in_ci?</span>
|
2217
|
+
<span class='symbol'>:plaintext</span>
|
2218
|
+
<span class='kw'>else</span>
|
2219
|
+
<span class='symbol'>:terminal</span>
|
2220
|
+
<span class='kw'>end</span>
|
2221
|
+
<span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>production</span><span class='tstring_end'>'</span></span>
|
2222
|
+
<span class='symbol'>:json</span>
|
2223
|
+
<span class='kw'>else</span>
|
2224
|
+
<span class='symbol'>:terminal</span>
|
2225
|
+
<span class='kw'>end</span>
|
2226
|
+
<span class='kw'>end</span></pre>
|
2227
|
+
</td>
|
2228
|
+
</tr>
|
2229
|
+
</table>
|
2230
|
+
</div>
|
2231
|
+
|
2232
|
+
<div class="method_details ">
|
2233
|
+
<h3 class="signature " id="on_capture-class_method">
|
2234
|
+
|
2235
|
+
.<strong>on_capture</strong> {|binding_info| ... } ⇒ <tt>Proc</tt>
|
2236
|
+
|
2237
|
+
|
2238
|
+
|
2239
|
+
|
2240
|
+
|
2241
|
+
</h3><div class="docstring">
|
2242
|
+
<div class="discussion">
|
2243
|
+
|
2244
|
+
<p>Sets or retrieves the hook to modify binding information upon capture.</p>
|
2245
|
+
|
2246
|
+
|
2247
|
+
</div>
|
2248
|
+
</div>
|
2249
|
+
<div class="tags">
|
2250
|
+
|
2251
|
+
<p class="tag_title">Yield Parameters:</p>
|
2252
|
+
<ul class="yieldparam">
|
2253
|
+
|
2254
|
+
<li>
|
2255
|
+
|
2256
|
+
<span class='name'>binding_info</span>
|
2257
|
+
|
2258
|
+
|
2259
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
2260
|
+
|
2261
|
+
|
2262
|
+
|
2263
|
+
—
|
2264
|
+
<div class='inline'>
|
2265
|
+
<p>The binding information captured.</p>
|
2266
|
+
</div>
|
2267
|
+
|
2268
|
+
</li>
|
2269
|
+
|
2270
|
+
</ul>
|
2271
|
+
<p class="tag_title">Returns:</p>
|
2272
|
+
<ul class="return">
|
2273
|
+
|
2274
|
+
<li>
|
2275
|
+
|
2276
|
+
|
2277
|
+
<span class='type'>(<tt>Proc</tt>)</span>
|
2278
|
+
|
2279
|
+
|
2280
|
+
|
2281
|
+
—
|
2282
|
+
<div class='inline'>
|
2283
|
+
<p>The current on_capture hook.</p>
|
2284
|
+
</div>
|
2285
|
+
|
2286
|
+
</li>
|
2287
|
+
|
2288
|
+
</ul>
|
2289
|
+
|
2290
|
+
</div><table class="source_code">
|
2291
|
+
<tr>
|
2292
|
+
<td>
|
2293
|
+
<pre class="lines">
|
2294
|
+
|
2295
|
+
|
2296
|
+
197
|
2297
|
+
198
|
2298
|
+
199
|
2299
|
+
200
|
2300
|
+
201
|
2301
|
+
202
|
2302
|
+
203</pre>
|
2303
|
+
</td>
|
2304
|
+
<td>
|
2305
|
+
<pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 197</span>
|
2306
|
+
|
2307
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_on_capture'>on_capture</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
2308
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
|
2309
|
+
<span class='ivar'>@on_capture_hook</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
2310
|
+
<span class='kw'>else</span>
|
2311
|
+
<span class='ivar'>@on_capture_hook</span> <span class='op'>||=</span> <span class='id identifier rubyid_method'>method</span><span class='lparen'>(</span><span class='symbol'>:default_on_capture</span><span class='rparen'>)</span>
|
2312
|
+
<span class='kw'>end</span>
|
2313
|
+
<span class='kw'>end</span></pre>
|
2314
|
+
</td>
|
2315
|
+
</tr>
|
2316
|
+
</table>
|
2317
|
+
</div>
|
2318
|
+
|
2319
|
+
<div class="method_details ">
|
2320
|
+
<h3 class="signature " id="on_capture=-class_method">
|
2321
|
+
|
2322
|
+
.<strong>on_capture=</strong>(value) ⇒ <tt>Proc</tt>
|
2323
|
+
|
2324
|
+
|
2325
|
+
|
2326
|
+
|
2327
|
+
|
2328
|
+
</h3><div class="docstring">
|
2329
|
+
<div class="discussion">
|
2330
|
+
|
2331
|
+
<p>Sets the on_capture hook.</p>
|
2332
|
+
|
2333
|
+
|
2334
|
+
</div>
|
2335
|
+
</div>
|
2336
|
+
<div class="tags">
|
2337
|
+
<p class="tag_title">Parameters:</p>
|
2338
|
+
<ul class="param">
|
2339
|
+
|
2340
|
+
<li>
|
2341
|
+
|
2342
|
+
<span class='name'>value</span>
|
2343
|
+
|
2344
|
+
|
2345
|
+
<span class='type'>(<tt>Proc</tt>)</span>
|
2346
|
+
|
2347
|
+
|
2348
|
+
|
2349
|
+
—
|
2350
|
+
<div class='inline'>
|
2351
|
+
<p>The proc to set as the on_capture hook.</p>
|
2352
|
+
</div>
|
2353
|
+
|
2354
|
+
</li>
|
2355
|
+
|
2356
|
+
</ul>
|
2357
|
+
|
2358
|
+
<p class="tag_title">Returns:</p>
|
2359
|
+
<ul class="return">
|
2360
|
+
|
2361
|
+
<li>
|
2362
|
+
|
2363
|
+
|
2364
|
+
<span class='type'>(<tt>Proc</tt>)</span>
|
2365
|
+
|
2366
|
+
|
2367
|
+
|
2368
|
+
—
|
2369
|
+
<div class='inline'>
|
2370
|
+
<p>The newly set on_capture hook.</p>
|
2371
|
+
</div>
|
2372
|
+
|
2373
|
+
</li>
|
2374
|
+
|
2375
|
+
</ul>
|
2376
|
+
|
2377
|
+
</div><table class="source_code">
|
2378
|
+
<tr>
|
2379
|
+
<td>
|
2380
|
+
<pre class="lines">
|
2381
|
+
|
2382
|
+
|
2383
|
+
209
|
2384
|
+
210
|
2385
|
+
211</pre>
|
2386
|
+
</td>
|
2387
|
+
<td>
|
2388
|
+
<pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 209</span>
|
2389
|
+
|
2390
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_on_capture='>on_capture=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
2391
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_on_capture_hook'>on_capture_hook</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
|
2392
|
+
<span class='kw'>end</span></pre>
|
2393
|
+
</td>
|
2394
|
+
</tr>
|
2395
|
+
</table>
|
2396
|
+
</div>
|
2397
|
+
|
2398
|
+
<div class="method_details ">
|
2399
|
+
<h3 class="signature " id="on_format-class_method">
|
2400
|
+
|
2401
|
+
.<strong>on_format</strong> {|formatted_string| ... } ⇒ <tt>Proc</tt>
|
2402
|
+
|
2403
|
+
|
2404
|
+
|
2405
|
+
|
2406
|
+
|
2407
|
+
</h3><div class="docstring">
|
2408
|
+
<div class="discussion">
|
2409
|
+
|
2410
|
+
<p>Sets or retrieves the hook to modify formatted exception messages.</p>
|
2411
|
+
|
2412
|
+
|
2413
|
+
</div>
|
2414
|
+
</div>
|
2415
|
+
<div class="tags">
|
2416
|
+
|
2417
|
+
<p class="tag_title">Yield Parameters:</p>
|
2418
|
+
<ul class="yieldparam">
|
2419
|
+
|
2420
|
+
<li>
|
2421
|
+
|
2422
|
+
<span class='name'>formatted_string</span>
|
2423
|
+
|
2424
|
+
|
2425
|
+
<span class='type'>(<tt>String</tt>)</span>
|
2426
|
+
|
2427
|
+
|
2428
|
+
|
2429
|
+
—
|
2430
|
+
<div class='inline'>
|
2431
|
+
<p>The formatted exception message.</p>
|
2432
|
+
</div>
|
2433
|
+
|
2434
|
+
</li>
|
2435
|
+
|
2436
|
+
</ul>
|
2437
|
+
<p class="tag_title">Returns:</p>
|
2438
|
+
<ul class="return">
|
2439
|
+
|
2440
|
+
<li>
|
2441
|
+
|
2442
|
+
|
2443
|
+
<span class='type'>(<tt>Proc</tt>)</span>
|
2444
|
+
|
2445
|
+
|
2446
|
+
|
2447
|
+
—
|
2448
|
+
<div class='inline'>
|
2449
|
+
<p>The current on_format hook.</p>
|
2450
|
+
</div>
|
2451
|
+
|
2452
|
+
</li>
|
2453
|
+
|
2454
|
+
</ul>
|
2455
|
+
|
2456
|
+
</div><table class="source_code">
|
2457
|
+
<tr>
|
2458
|
+
<td>
|
2459
|
+
<pre class="lines">
|
2460
|
+
|
2461
|
+
|
2462
|
+
217
|
2463
|
+
218
|
2464
|
+
219
|
2465
|
+
220
|
2466
|
+
221
|
2467
|
+
222
|
2468
|
+
223</pre>
|
2469
|
+
</td>
|
2470
|
+
<td>
|
2471
|
+
<pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 217</span>
|
2472
|
+
|
2473
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_on_format'>on_format</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
2474
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
|
2475
|
+
<span class='ivar'>@on_format_hook</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
|
2476
|
+
<span class='kw'>else</span>
|
2477
|
+
<span class='ivar'>@on_format_hook</span> <span class='op'>||=</span> <span class='id identifier rubyid_method'>method</span><span class='lparen'>(</span><span class='symbol'>:default_on_format</span><span class='rparen'>)</span>
|
2478
|
+
<span class='kw'>end</span>
|
2479
|
+
<span class='kw'>end</span></pre>
|
2480
|
+
</td>
|
2481
|
+
</tr>
|
2482
|
+
</table>
|
2483
|
+
</div>
|
2484
|
+
|
2485
|
+
<div class="method_details ">
|
2486
|
+
<h3 class="signature " id="on_format=-class_method">
|
2487
|
+
|
2488
|
+
.<strong>on_format=</strong>(value) ⇒ <tt>Proc</tt>
|
2489
|
+
|
2490
|
+
|
2491
|
+
|
2492
|
+
|
2493
|
+
|
2494
|
+
</h3><div class="docstring">
|
2495
|
+
<div class="discussion">
|
2496
|
+
|
2497
|
+
<p>Sets the on_format hook.</p>
|
2498
|
+
|
2499
|
+
|
2500
|
+
</div>
|
2501
|
+
</div>
|
2502
|
+
<div class="tags">
|
2503
|
+
<p class="tag_title">Parameters:</p>
|
2504
|
+
<ul class="param">
|
2505
|
+
|
2506
|
+
<li>
|
2507
|
+
|
2508
|
+
<span class='name'>value</span>
|
2509
|
+
|
2510
|
+
|
2511
|
+
<span class='type'>(<tt>Proc</tt>)</span>
|
2512
|
+
|
2513
|
+
|
2514
|
+
|
2515
|
+
—
|
2516
|
+
<div class='inline'>
|
2517
|
+
<p>The proc to set as the on_format hook.</p>
|
2518
|
+
</div>
|
2519
|
+
|
2520
|
+
</li>
|
2521
|
+
|
2522
|
+
</ul>
|
2523
|
+
|
2524
|
+
<p class="tag_title">Returns:</p>
|
2525
|
+
<ul class="return">
|
2526
|
+
|
2527
|
+
<li>
|
2528
|
+
|
2529
|
+
|
2530
|
+
<span class='type'>(<tt>Proc</tt>)</span>
|
2531
|
+
|
2532
|
+
|
2533
|
+
|
2534
|
+
—
|
2535
|
+
<div class='inline'>
|
2536
|
+
<p>The newly set on_format hook.</p>
|
2537
|
+
</div>
|
2538
|
+
|
2539
|
+
</li>
|
2540
|
+
|
2541
|
+
</ul>
|
2542
|
+
|
2543
|
+
</div><table class="source_code">
|
2544
|
+
<tr>
|
2545
|
+
<td>
|
2546
|
+
<pre class="lines">
|
2547
|
+
|
2548
|
+
|
2549
|
+
229
|
2550
|
+
230
|
2551
|
+
231</pre>
|
2552
|
+
</td>
|
2553
|
+
<td>
|
2554
|
+
<pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 229</span>
|
2555
|
+
|
2556
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_on_format='>on_format=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
2557
|
+
<span class='ivar'>@on_format_hook</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
|
2558
|
+
<span class='kw'>end</span></pre>
|
2559
|
+
</td>
|
2560
|
+
</tr>
|
2561
|
+
</table>
|
2562
|
+
</div>
|
2563
|
+
|
2564
|
+
<div class="method_details ">
|
2565
|
+
<h3 class="signature " id="running_in_ci?-class_method">
|
2566
|
+
|
2567
|
+
.<strong>running_in_ci?</strong> ⇒ <tt>Boolean</tt>
|
2568
|
+
|
2569
|
+
|
2570
|
+
|
2571
|
+
|
2572
|
+
|
2573
|
+
</h3><div class="docstring">
|
2574
|
+
<div class="discussion">
|
2575
|
+
|
2576
|
+
<p>Checks if the code is running in a Continuous Integration (CI) environment.</p>
|
2577
|
+
|
2578
|
+
|
2579
|
+
</div>
|
2580
|
+
</div>
|
2581
|
+
<div class="tags">
|
2582
|
+
|
2583
|
+
<p class="tag_title">Returns:</p>
|
2584
|
+
<ul class="return">
|
2585
|
+
|
2586
|
+
<li>
|
2587
|
+
|
2588
|
+
|
2589
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
2590
|
+
|
2591
|
+
|
2592
|
+
|
2593
|
+
—
|
2594
|
+
<div class='inline'>
|
2595
|
+
<p>‘true` if running in CI, otherwise `false`.</p>
|
2596
|
+
</div>
|
2597
|
+
|
2598
|
+
</li>
|
2599
|
+
|
2600
|
+
</ul>
|
2601
|
+
|
2602
|
+
</div><table class="source_code">
|
2603
|
+
<tr>
|
2604
|
+
<td>
|
2605
|
+
<pre class="lines">
|
2606
|
+
|
2607
|
+
|
2608
|
+
293
|
2609
|
+
294
|
2610
|
+
295
|
2611
|
+
296
|
2612
|
+
297
|
2613
|
+
298
|
2614
|
+
299
|
2615
|
+
300
|
2616
|
+
301
|
2617
|
+
302
|
2618
|
+
303
|
2619
|
+
304
|
2620
|
+
305</pre>
|
2621
|
+
</td>
|
2622
|
+
<td>
|
2623
|
+
<pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 293</span>
|
2624
|
+
|
2625
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_running_in_ci?'>running_in_ci?</span>
|
2626
|
+
<span class='kw'>return</span> <span class='ivar'>@running_in_ci</span> <span class='kw'>if</span> <span class='kw'>defined?</span><span class='lparen'>(</span><span class='ivar'>@running_in_ci</span><span class='rparen'>)</span>
|
2627
|
+
<span class='id identifier rubyid_ci_env_vars'>ci_env_vars</span> <span class='op'>=</span> <span class='lbrace'>{</span>
|
2628
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>CI</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>CI</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
|
2629
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>JENKINS</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>JENKINS</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
|
2630
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>GITHUB_ACTIONS</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>GITHUB_ACTIONS</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
|
2631
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>CIRCLECI</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>CIRCLECI</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
|
2632
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>TRAVIS</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>TRAVIS</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
|
2633
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>APPVEYOR</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>APPVEYOR</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
|
2634
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>GITLAB_CI</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>GITLAB_CI</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
2635
|
+
<span class='rbrace'>}</span>
|
2636
|
+
<span class='ivar'>@running_in_ci</span> <span class='op'>=</span> <span class='id identifier rubyid_ci_env_vars'>ci_env_vars</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid__'>_</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>true</span><span class='tstring_end'>'</span></span> <span class='rbrace'>}</span>
|
2637
|
+
<span class='kw'>end</span></pre>
|
2638
|
+
</td>
|
2639
|
+
</tr>
|
2640
|
+
</table>
|
2641
|
+
</div>
|
2642
|
+
|
2643
|
+
<div class="method_details ">
|
2644
|
+
<h3 class="signature " id="validate_binding_format-class_method">
|
2645
|
+
|
2646
|
+
.<strong>validate_binding_format</strong>(binding_info) ⇒ <tt>Hash</tt><sup>?</sup>
|
2647
|
+
|
2648
|
+
|
2649
|
+
|
2650
|
+
|
2651
|
+
|
2652
|
+
</h3><div class="docstring">
|
2653
|
+
<div class="discussion">
|
2654
|
+
|
2655
|
+
<p>Validates the format of the captured binding information.</p>
|
2656
|
+
|
2657
|
+
|
2658
|
+
</div>
|
2659
|
+
</div>
|
2660
|
+
<div class="tags">
|
2661
|
+
<p class="tag_title">Parameters:</p>
|
2662
|
+
<ul class="param">
|
2663
|
+
|
2664
|
+
<li>
|
2665
|
+
|
2666
|
+
<span class='name'>binding_info</span>
|
2667
|
+
|
2668
|
+
|
2669
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
2670
|
+
|
2671
|
+
|
2672
|
+
|
2673
|
+
—
|
2674
|
+
<div class='inline'>
|
2675
|
+
<p>The binding information to validate.</p>
|
2676
|
+
</div>
|
2677
|
+
|
2678
|
+
</li>
|
2679
|
+
|
2680
|
+
</ul>
|
2681
|
+
|
2682
|
+
<p class="tag_title">Returns:</p>
|
2683
|
+
<ul class="return">
|
2684
|
+
|
2685
|
+
<li>
|
2686
|
+
|
2687
|
+
|
2688
|
+
<span class='type'>(<tt>Hash</tt>, <tt>nil</tt>)</span>
|
2689
|
+
|
2690
|
+
|
2691
|
+
|
2692
|
+
—
|
2693
|
+
<div class='inline'>
|
2694
|
+
<p>The validated binding information or ‘nil` if invalid.</p>
|
2695
|
+
</div>
|
2696
|
+
|
2697
|
+
</li>
|
2698
|
+
|
2699
|
+
</ul>
|
2700
|
+
|
2701
|
+
</div><table class="source_code">
|
2702
|
+
<tr>
|
2703
|
+
<td>
|
2704
|
+
<pre class="lines">
|
2705
|
+
|
2706
|
+
|
2707
|
+
325
|
2708
|
+
326
|
2709
|
+
327
|
2710
|
+
328
|
2711
|
+
329
|
2712
|
+
330
|
2713
|
+
331</pre>
|
2714
|
+
</td>
|
2715
|
+
<td>
|
2716
|
+
<pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 325</span>
|
2717
|
+
|
2718
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_validate_binding_format'>validate_binding_format</span><span class='lparen'>(</span><span class='id identifier rubyid_binding_info'>binding_info</span><span class='rparen'>)</span>
|
2719
|
+
<span class='kw'>unless</span> <span class='id identifier rubyid_binding_info'>binding_info</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='symbol'>:capture_type</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_binding_info'>binding_info</span><span class='lbracket'>[</span><span class='symbol'>:variables</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span>
|
2720
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Invalid binding_info format.</span><span class='tstring_end'>"</span></span>
|
2721
|
+
<span class='kw'>return</span> <span class='kw'>nil</span>
|
2722
|
+
<span class='kw'>end</span>
|
2723
|
+
<span class='id identifier rubyid_binding_info'>binding_info</span>
|
2724
|
+
<span class='kw'>end</span></pre>
|
2725
|
+
</td>
|
2726
|
+
</tr>
|
2727
|
+
</table>
|
2728
|
+
</div>
|
2729
|
+
|
2730
|
+
</div>
|
2731
|
+
|
2732
|
+
</div>
|
2733
|
+
|
2734
|
+
<div id="footer">
|
2735
|
+
Generated on Tue Oct 22 23:16:25 2024 by
|
2736
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
2737
|
+
0.9.37 (ruby-3.1.3).
|
2738
|
+
</div>
|
2739
|
+
|
2740
|
+
</div>
|
2741
|
+
</body>
|
2742
|
+
</html>
|