enhanced_errors 2.1.2 → 2.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7ecd6dd97f913399350952ac7a3b91d59856f464091239ab1b8a7e991abc5f1
4
- data.tar.gz: bd0e14cf212418d14df9207a8046d72dfcbd1ec59e458cd1e0054115a42f300c
3
+ metadata.gz: 513b8ed3fa638473a49b9ada309fc2282212cb1009855a5af81c3c3e3f7fc5d2
4
+ data.tar.gz: 74831a00033cfc88ea7fedc4363c07702f05e51d708636c723833aad420c1e0b
5
5
  SHA512:
6
- metadata.gz: 344415b6681c035dbdd6b4daf8f7986fc655020d1963e7268356837bd5c3f4741ca99f5648e80fb48f247e76678e1df26c2732005a42de76cdb2c740d5d2e3cb
7
- data.tar.gz: 4d1732e9646da507b67878a9ba5d9f62b1430580241b01e8982fe3fad3ba0c8f08567b0b8dd14f4ec3227ad8f1fab339f4aa9b854e9501e7b609c6e179a1a118
6
+ metadata.gz: 8f5273f036ab1d936e392e889f58cbbe5080e5b17a5c15283dee19a67f6ff4a32ee1c7ae9d7565ceebb915e5d8b58fca7f1b7b519f79339b1b9abee2a54035f2
7
+ data.tar.gz: a2b2ab7ca50dff2f1446a94dba0e952da52acf0f00596839a212007ab63eb40f4fa1b08d815cc2b6f3a244f778deecf9c3270d46ff58b6d7a819ba49ac178fbf
data/.yardoc/checksums CHANGED
@@ -1,4 +1,4 @@
1
1
  lib/enhanced/colors.rb ed3b11d00ff9ceed089d4a65f0be5b3fca64bbe6
2
- lib/enhanced_errors.rb 0661df04294c05cd30d06b2ea101f99f255d46ef
2
+ lib/enhanced_errors.rb efa6c18fdbde38083877a48d6c5e10d390c34ab0
3
3
  lib/enhanced/exception.rb 72c62e85ce9cea875bc3e835240059bbf1b00f0b
4
4
  lib/enhanced/minitest_patch.rb c8c934389dfa3789de66eeeacc8402a48a34d5b4
data/.yardoc/object_types CHANGED
Binary file
Binary file
@@ -381,7 +381,7 @@
381
381
  </div>
382
382
 
383
383
  <div id="footer">
384
- Generated on Mon Dec 16 10:41:42 2024 by
384
+ Generated on Mon Dec 16 11:33:57 2024 by
385
385
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
386
386
  0.9.37 (ruby-3.3.6).
387
387
  </div>
data/doc/Enhanced.html CHANGED
@@ -110,7 +110,7 @@
110
110
  </div>
111
111
 
112
112
  <div id="footer">
113
- Generated on Mon Dec 16 10:41:42 2024 by
113
+ Generated on Mon Dec 16 11:33:57 2024 by
114
114
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
115
115
  0.9.37 (ruby-3.3.6).
116
116
  </div>
@@ -653,7 +653,7 @@
653
653
  <li class="public ">
654
654
  <span class="summary_signature">
655
655
 
656
- <a href="#enforce_capture_limit!-class_method" title="enforce_capture_limit! (class method)">.<strong>enforce_capture_limit!</strong> &#x21d2; Object </a>
656
+ <a href="#enforce_capture_limit-class_method" title="enforce_capture_limit (class method)">.<strong>enforce_capture_limit</strong> &#x21d2; Object </a>
657
657
 
658
658
 
659
659
 
@@ -1027,7 +1027,7 @@
1027
1027
  <li class="public ">
1028
1028
  <span class="summary_signature">
1029
1029
 
1030
- <a href="#reset_capture_events_count-class_method" title="reset_capture_events_count (class method)">.<strong>reset_capture_events_count</strong> &#x21d2; Object </a>
1030
+ <a href="#reset!-class_method" title="reset! (class method)">.<strong>reset!</strong> &#x21d2; Object </a>
1031
1031
 
1032
1032
 
1033
1033
 
@@ -1515,14 +1515,14 @@
1515
1515
  <pre class="lines">
1516
1516
 
1517
1517
 
1518
+ 231
1518
1519
  232
1519
1520
  233
1520
1521
  234
1521
- 235
1522
- 236</pre>
1522
+ 235</pre>
1523
1523
  </td>
1524
1524
  <td>
1525
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 232</span>
1525
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 231</span>
1526
1526
 
1527
1527
  <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>
1528
1528
  <span class='id identifier rubyid_mutex'>mutex</span><span class='period'>.</span><span class='id identifier rubyid_synchronize'>synchronize</span> <span class='kw'>do</span>
@@ -1549,20 +1549,20 @@
1549
1549
  <pre class="lines">
1550
1550
 
1551
1551
 
1552
+ 538
1553
+ 539
1554
+ 540
1555
+ 541
1552
1556
  542
1553
1557
  543
1554
1558
  544
1555
1559
  545
1556
1560
  546
1557
1561
  547
1558
- 548
1559
- 549
1560
- 550
1561
- 551
1562
- 552</pre>
1562
+ 548</pre>
1563
1563
  </td>
1564
1564
  <td>
1565
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 542</span>
1565
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 538</span>
1566
1566
 
1567
1567
  <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>
1568
1568
  <span class='id identifier rubyid_mutex'>mutex</span><span class='period'>.</span><span class='id identifier rubyid_synchronize'>synchronize</span> <span class='kw'>do</span>
@@ -1595,6 +1595,10 @@
1595
1595
  <pre class="lines">
1596
1596
 
1597
1597
 
1598
+ 557
1599
+ 558
1600
+ 559
1601
+ 560
1598
1602
  561
1599
1603
  562
1600
1604
  563
@@ -1634,14 +1638,10 @@
1634
1638
  597
1635
1639
  598
1636
1640
  599
1637
- 600
1638
- 601
1639
- 602
1640
- 603
1641
- 604</pre>
1641
+ 600</pre>
1642
1642
  </td>
1643
1643
  <td>
1644
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 561</span>
1644
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 557</span>
1645
1645
 
1646
1646
  <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>
1647
1647
  <span class='id identifier rubyid_exception'>exception</span> <span class='op'>=</span> <span class='id identifier rubyid_safe_to_s'>safe_to_s</span><span class='lparen'>(</span><span class='id identifier rubyid_binding_info'>binding_info</span><span class='lbracket'>[</span><span class='symbol'>:exception</span><span class='rbracket'>]</span><span class='rparen'>)</span>
@@ -1707,16 +1707,16 @@
1707
1707
  <pre class="lines">
1708
1708
 
1709
1709
 
1710
+ 495
1711
+ 496
1712
+ 497
1713
+ 498
1710
1714
  499
1711
1715
  500
1712
- 501
1713
- 502
1714
- 503
1715
- 504
1716
- 505</pre>
1716
+ 501</pre>
1717
1717
  </td>
1718
1718
  <td>
1719
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 499</span>
1719
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 495</span>
1720
1720
 
1721
1721
  <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>
1722
1722
  <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_captured_bindings'>captured_bindings</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_captured_bindings'>captured_bindings</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
@@ -1827,14 +1827,14 @@
1827
1827
  <pre class="lines">
1828
1828
 
1829
1829
 
1830
- 154
1831
- 155
1832
- 156
1833
- 157
1834
- 158</pre>
1830
+ 146
1831
+ 147
1832
+ 148
1833
+ 149
1834
+ 150</pre>
1835
1835
  </td>
1836
1836
  <td>
1837
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 154</span>
1837
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 146</span>
1838
1838
 
1839
1839
  <span class='kw'>def</span> <span class='id identifier rubyid_capture_limit_exceeded?'>capture_limit_exceeded?</span>
1840
1840
  <span class='id identifier rubyid_mutex'>mutex</span><span class='period'>.</span><span class='id identifier rubyid_synchronize'>synchronize</span> <span class='kw'>do</span>
@@ -1921,17 +1921,17 @@
1921
1921
  <pre class="lines">
1922
1922
 
1923
1923
 
1924
+ 328
1925
+ 329
1926
+ 330
1927
+ 331
1928
+ 332
1924
1929
  333
1925
1930
  334
1926
- 335
1927
- 336
1928
- 337
1929
- 338
1930
- 339
1931
- 340</pre>
1931
+ 335</pre>
1932
1932
  </td>
1933
1933
  <td>
1934
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 333</span>
1934
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 328</span>
1935
1935
 
1936
1936
  <span class='kw'>def</span> <span class='id identifier rubyid_class_to_string'>class_to_string</span><span class='lparen'>(</span><span class='id identifier rubyid_klass'>klass</span><span class='rparen'>)</span>
1937
1937
  <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
@@ -1961,6 +1961,10 @@
1961
1961
  <pre class="lines">
1962
1962
 
1963
1963
 
1964
+ 392
1965
+ 393
1966
+ 394
1967
+ 395
1964
1968
  396
1965
1969
  397
1966
1970
  398
@@ -1996,14 +2000,10 @@
1996
2000
  428
1997
2001
  429
1998
2002
  430
1999
- 431
2000
- 432
2001
- 433
2002
- 434
2003
- 435</pre>
2003
+ 431</pre>
2004
2004
  </td>
2005
2005
  <td>
2006
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 396</span>
2006
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 392</span>
2007
2007
 
2008
2008
  <span class='kw'>def</span> <span class='id identifier rubyid_convert_binding_to_binding_info'>convert_binding_to_binding_info</span><span class='lparen'>(</span><span class='id identifier rubyid_b'>b</span><span class='comma'>,</span> <span class='label'>capture_let_variables:</span> <span class='kw'>true</span><span class='rparen'>)</span>
2009
2009
  <span class='id identifier rubyid_file'>file</span> <span class='op'>=</span> <span class='id identifier rubyid_b'>b</span><span class='period'>.</span><span class='id identifier rubyid_eval'>eval</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>__FILE__</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>rescue</span> <span class='kw'>nil</span>
@@ -2065,17 +2065,17 @@
2065
2065
  <pre class="lines">
2066
2066
 
2067
2067
 
2068
- 160
2069
- 161
2070
- 162
2071
- 163
2072
- 164
2073
- 165
2074
- 166
2075
- 167</pre>
2068
+ 152
2069
+ 153
2070
+ 154
2071
+ 155
2072
+ 156
2073
+ 157
2074
+ 158
2075
+ 159</pre>
2076
2076
  </td>
2077
2077
  <td>
2078
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 160</span>
2078
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 152</span>
2079
2079
 
2080
2080
  <span class='kw'>def</span> <span class='id identifier rubyid_disable_capturing!'>disable_capturing!</span>
2081
2081
  <span class='id identifier rubyid_mutex'>mutex</span><span class='period'>.</span><span class='id identifier rubyid_synchronize'>synchronize</span> <span class='kw'>do</span>
@@ -2091,9 +2091,9 @@
2091
2091
  </div>
2092
2092
 
2093
2093
  <div class="method_details ">
2094
- <h3 class="signature " id="enforce_capture_limit!-class_method">
2094
+ <h3 class="signature " id="enforce_capture_limit-class_method">
2095
2095
 
2096
- .<strong>enforce_capture_limit!</strong> &#x21d2; <tt>Object</tt>
2096
+ .<strong>enforce_capture_limit</strong> &#x21d2; <tt>Object</tt>
2097
2097
 
2098
2098
 
2099
2099
 
@@ -2105,15 +2105,19 @@
2105
2105
  <pre class="lines">
2106
2106
 
2107
2107
 
2108
- 150
2109
- 151
2110
- 152</pre>
2108
+ 140
2109
+ 141
2110
+ 142
2111
+ 143
2112
+ 144</pre>
2111
2113
  </td>
2112
2114
  <td>
2113
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 150</span>
2115
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 140</span>
2114
2116
 
2115
- <span class='kw'>def</span> <span class='id identifier rubyid_enforce_capture_limit!'>enforce_capture_limit!</span>
2117
+ <span class='kw'>def</span> <span class='id identifier rubyid_enforce_capture_limit'>enforce_capture_limit</span>
2118
+ <span class='id identifier rubyid_exceeded'>exceeded</span> <span class='op'>=</span> <span class='id identifier rubyid_capture_limit_exceeded?'>capture_limit_exceeded?</span>
2116
2119
  <span class='id identifier rubyid_disable_capturing!'>disable_capturing!</span> <span class='kw'>if</span> <span class='id identifier rubyid_capture_limit_exceeded?'>capture_limit_exceeded?</span>
2120
+ <span class='id identifier rubyid_exceeded'>exceeded</span>
2117
2121
  <span class='kw'>end</span></pre>
2118
2122
  </td>
2119
2123
  </tr>
@@ -2135,6 +2139,7 @@
2135
2139
  <pre class="lines">
2136
2140
 
2137
2141
 
2142
+ 237
2138
2143
  238
2139
2144
  239
2140
2145
  240
@@ -2186,17 +2191,10 @@
2186
2191
  286
2187
2192
  287
2188
2193
  288
2189
- 289
2190
- 290
2191
- 291
2192
- 292
2193
- 293
2194
- 294
2195
- 295
2196
- 296</pre>
2194
+ 289</pre>
2197
2195
  </td>
2198
2196
  <td>
2199
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 238</span>
2197
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 237</span>
2200
2198
 
2201
2199
  <span class='kw'>def</span> <span class='id identifier rubyid_enhance_exceptions!'>enhance_exceptions!</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='label'>capture_events:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>override_messages:</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'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
2202
2200
  <span class='id identifier rubyid_mutex'>mutex</span><span class='period'>.</span><span class='id identifier rubyid_synchronize'>synchronize</span> <span class='kw'>do</span>
@@ -2212,17 +2210,11 @@
2212
2210
  </span> <span class='kw'>if</span> <span class='ivar'>@max_capture_events</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
2213
2211
  <span class='ivar'>@max_capture_events</span> <span class='op'>=</span> <span class='op'>-</span><span class='int'>1</span>
2214
2212
  <span class='kw'>end</span>
2215
- <span class='ivar'>@capture_events_count</span> <span class='op'>=</span> <span class='int'>0</span>
2213
+ <span class='ivar'>@capture_events_count</span> <span class='op'>||=</span> <span class='int'>0</span>
2216
2214
 
2217
2215
  <span class='ivar'>@rspec_failure_message_loaded</span> <span class='op'>=</span> <span class='kw'>true</span>
2218
2216
 
2219
- <span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_enabled'>enabled</span>
2220
- <span class='ivar'>@original_global_variables</span> <span class='op'>=</span> <span class='kw'>nil</span>
2221
- <span class='ivar'>@enabled</span> <span class='op'>=</span> <span class='kw'>false</span>
2222
- <span class='kw'>return</span>
2223
- <span class='kw'>end</span>
2224
-
2225
- <span class='ivar'>@enabled</span> <span class='op'>=</span> <span class='kw'>true</span>
2217
+ <span class='ivar'>@enabled</span> <span class='op'>=</span> <span class='id identifier rubyid_enabled'>enabled</span>
2226
2218
  <span class='ivar'>@debug</span> <span class='op'>=</span> <span class='id identifier rubyid_debug'>debug</span>
2227
2219
  <span class='ivar'>@original_global_variables</span> <span class='op'>=</span> <span class='id identifier rubyid_global_variables'>global_variables</span> <span class='kw'>if</span> <span class='ivar'>@debug</span>
2228
2220
 
@@ -2277,6 +2269,10 @@
2277
2269
  <pre class="lines">
2278
2270
 
2279
2271
 
2272
+ 475
2273
+ 476
2274
+ 477
2275
+ 478
2280
2276
  479
2281
2277
  480
2282
2278
  481
@@ -2291,14 +2287,10 @@
2291
2287
  490
2292
2288
  491
2293
2289
  492
2294
- 493
2295
- 494
2296
- 495
2297
- 496
2298
- 497</pre>
2290
+ 493</pre>
2299
2291
  </td>
2300
2292
  <td>
2301
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 479</span>
2293
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 475</span>
2302
2294
 
2303
2295
  <span class='kw'>def</span> <span class='id identifier rubyid_format'>format</span><span class='lparen'>(</span><span class='id identifier rubyid_captured_binding_infos'>captured_binding_infos</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>
2304
2296
  <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_captured_binding_infos'>captured_binding_infos</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_captured_binding_infos'>captured_binding_infos</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
@@ -2339,6 +2331,10 @@
2339
2331
  <pre class="lines">
2340
2332
 
2341
2333
 
2334
+ 503
2335
+ 504
2336
+ 505
2337
+ 506
2342
2338
  507
2343
2339
  508
2344
2340
  509
@@ -2352,14 +2348,10 @@
2352
2348
  517
2353
2349
  518
2354
2350
  519
2355
- 520
2356
- 521
2357
- 522
2358
- 523
2359
- 524</pre>
2351
+ 520</pre>
2360
2352
  </td>
2361
2353
  <td>
2362
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 507</span>
2354
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 503</span>
2363
2355
 
2364
2356
  <span class='kw'>def</span> <span class='id identifier rubyid_get_default_format_for_environment'>get_default_format_for_environment</span>
2365
2357
  <span class='id identifier rubyid_mutex'>mutex</span><span class='period'>.</span><span class='id identifier rubyid_synchronize'>synchronize</span> <span class='kw'>do</span>
@@ -2399,16 +2391,16 @@
2399
2391
  <pre class="lines">
2400
2392
 
2401
2393
 
2402
- 169
2403
- 170
2404
- 171
2405
- 172
2406
- 173
2407
- 174
2408
- 175</pre>
2394
+ 161
2395
+ 162
2396
+ 163
2397
+ 164
2398
+ 165
2399
+ 166
2400
+ 167</pre>
2409
2401
  </td>
2410
2402
  <td>
2411
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 169</span>
2403
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 161</span>
2412
2404
 
2413
2405
  <span class='kw'>def</span> <span class='id identifier rubyid_increment_capture_events_count'>increment_capture_events_count</span>
2414
2406
  <span class='id identifier rubyid_mutex'>mutex</span><span class='period'>.</span><span class='id identifier rubyid_synchronize'>synchronize</span> <span class='kw'>do</span>
@@ -2459,12 +2451,12 @@
2459
2451
  <pre class="lines">
2460
2452
 
2461
2453
 
2462
- 309
2463
- 310
2464
- 311</pre>
2454
+ 302
2455
+ 303
2456
+ 304</pre>
2465
2457
  </td>
2466
2458
  <td>
2467
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 309</span>
2459
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 302</span>
2468
2460
 
2469
2461
  <span class='kw'>def</span> <span class='id identifier rubyid_is_a_minitest?'>is_a_minitest?</span><span class='lparen'>(</span><span class='id identifier rubyid_klass'>klass</span><span class='rparen'>)</span>
2470
2462
  <span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid_ancestors'>ancestors</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Minitest.html" title="Minitest (module)">Minitest</a></span></span><span class='op'>::</span><span class='const'>Test</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span> <span class='op'>!=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Minitest::Test</span><span class='tstring_end'>&#39;</span></span>
@@ -2511,12 +2503,12 @@
2511
2503
  <pre class="lines">
2512
2504
 
2513
2505
 
2514
- 342
2515
- 343
2516
- 344</pre>
2506
+ 337
2507
+ 338
2508
+ 339</pre>
2517
2509
  </td>
2518
2510
  <td>
2519
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 342</span>
2511
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 337</span>
2520
2512
 
2521
2513
  <span class='kw'>def</span> <span class='id identifier rubyid_is_rspec_example?'>is_rspec_example?</span><span class='lparen'>(</span><span class='id identifier rubyid_tracepoint'>tracepoint</span><span class='rparen'>)</span>
2522
2514
  <span class='id identifier rubyid_tracepoint'>tracepoint</span><span class='period'>.</span><span class='id identifier rubyid_method_id'>method_id</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='lparen'>(</span><span class='id identifier rubyid_tracepoint'>tracepoint</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>rspec</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_tracepoint'>tracepoint</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span><span class='period'>.</span><span class='id identifier rubyid_end_with?'>end_with?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>_spec.rb</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
@@ -2575,17 +2567,7 @@
2575
2567
  135
2576
2568
  136
2577
2569
  137
2578
- 138
2579
- 139
2580
- 140
2581
- 141
2582
- 142
2583
- 143
2584
- 144
2585
- 145
2586
- 146
2587
- 147
2588
- 148</pre>
2570
+ 138</pre>
2589
2571
  </td>
2590
2572
  <td>
2591
2573
  <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 134</span>
@@ -2593,16 +2575,6 @@
2593
2575
  <span class='kw'>def</span> <span class='id identifier rubyid_max_capture_events='>max_capture_events=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
2594
2576
  <span class='id identifier rubyid_mutex'>mutex</span><span class='period'>.</span><span class='id identifier rubyid_synchronize'>synchronize</span> <span class='kw'>do</span>
2595
2577
  <span class='ivar'>@max_capture_events</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
2596
- <span class='kw'>if</span> <span class='ivar'>@max_capture_events</span> <span class='op'>==</span> <span class='int'>0</span>
2597
- <span class='comment'># Disable capturing
2598
- </span> <span class='kw'>if</span> <span class='ivar'>@enabled</span>
2599
- <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>EnhancedErrors: max_capture_events set to 0, disabling capturing.</span><span class='tstring_end'>&quot;</span></span>
2600
- <span class='ivar'>@enabled</span> <span class='op'>=</span> <span class='kw'>false</span>
2601
- <span class='ivar'>@exception_trace</span><span class='op'>&amp;.</span><span class='id identifier rubyid_disable'>disable</span>
2602
- <span class='ivar'>@rspec_tracepoint</span><span class='op'>&amp;.</span><span class='id identifier rubyid_disable'>disable</span>
2603
- <span class='ivar'>@minitest_trace</span><span class='op'>&amp;.</span><span class='id identifier rubyid_disable'>disable</span>
2604
- <span class='kw'>end</span>
2605
- <span class='kw'>end</span>
2606
2578
  <span class='kw'>end</span>
2607
2579
  <span class='kw'>end</span></pre>
2608
2580
  </td>
@@ -2625,6 +2597,7 @@
2625
2597
  <pre class="lines">
2626
2598
 
2627
2599
 
2600
+ 182
2628
2601
  183
2629
2602
  184
2630
2603
  185
@@ -2633,11 +2606,10 @@
2633
2606
  188
2634
2607
  189
2635
2608
  190
2636
- 191
2637
- 192</pre>
2609
+ 191</pre>
2638
2610
  </td>
2639
2611
  <td>
2640
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 183</span>
2612
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 182</span>
2641
2613
 
2642
2614
  <span class='kw'>def</span> <span class='id identifier rubyid_max_length'>max_length</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
2643
2615
  <span class='id identifier rubyid_mutex'>mutex</span><span class='period'>.</span><span class='id identifier rubyid_synchronize'>synchronize</span> <span class='kw'>do</span>
@@ -2699,18 +2671,18 @@
2699
2671
  <pre class="lines">
2700
2672
 
2701
2673
 
2674
+ 443
2675
+ 444
2676
+ 445
2677
+ 446
2702
2678
  447
2703
2679
  448
2704
2680
  449
2705
2681
  450
2706
- 451
2707
- 452
2708
- 453
2709
- 454
2710
- 455</pre>
2682
+ 451</pre>
2711
2683
  </td>
2712
2684
  <td>
2713
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 447</span>
2685
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 443</span>
2714
2686
 
2715
2687
  <span class='kw'>def</span> <span class='id identifier rubyid_on_capture'>on_capture</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
2716
2688
  <span class='id identifier rubyid_mutex'>mutex</span><span class='period'>.</span><span class='id identifier rubyid_synchronize'>synchronize</span> <span class='kw'>do</span>
@@ -2741,14 +2713,14 @@
2741
2713
  <pre class="lines">
2742
2714
 
2743
2715
 
2744
- 457
2745
- 458
2746
- 459
2747
- 460
2748
- 461</pre>
2716
+ 453
2717
+ 454
2718
+ 455
2719
+ 456
2720
+ 457</pre>
2749
2721
  </td>
2750
2722
  <td>
2751
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 457</span>
2723
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 453</span>
2752
2724
 
2753
2725
  <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>
2754
2726
  <span class='id identifier rubyid_mutex'>mutex</span><span class='period'>.</span><span class='id identifier rubyid_synchronize'>synchronize</span> <span class='kw'>do</span>
@@ -2775,18 +2747,18 @@
2775
2747
  <pre class="lines">
2776
2748
 
2777
2749
 
2750
+ 459
2751
+ 460
2752
+ 461
2753
+ 462
2778
2754
  463
2779
2755
  464
2780
2756
  465
2781
2757
  466
2782
- 467
2783
- 468
2784
- 469
2785
- 470
2786
- 471</pre>
2758
+ 467</pre>
2787
2759
  </td>
2788
2760
  <td>
2789
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 463</span>
2761
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 459</span>
2790
2762
 
2791
2763
  <span class='kw'>def</span> <span class='id identifier rubyid_on_format'>on_format</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
2792
2764
  <span class='id identifier rubyid_mutex'>mutex</span><span class='period'>.</span><span class='id identifier rubyid_synchronize'>synchronize</span> <span class='kw'>do</span>
@@ -2817,14 +2789,14 @@
2817
2789
  <pre class="lines">
2818
2790
 
2819
2791
 
2820
- 473
2821
- 474
2822
- 475
2823
- 476
2824
- 477</pre>
2792
+ 469
2793
+ 470
2794
+ 471
2795
+ 472
2796
+ 473</pre>
2825
2797
  </td>
2826
2798
  <td>
2827
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 473</span>
2799
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 469</span>
2828
2800
 
2829
2801
  <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>
2830
2802
  <span class='id identifier rubyid_mutex'>mutex</span><span class='period'>.</span><span class='id identifier rubyid_synchronize'>synchronize</span> <span class='kw'>do</span>
@@ -2851,6 +2823,7 @@
2851
2823
  <pre class="lines">
2852
2824
 
2853
2825
 
2826
+ 212
2854
2827
  213
2855
2828
  214
2856
2829
  215
@@ -2867,11 +2840,10 @@
2867
2840
  226
2868
2841
  227
2869
2842
  228
2870
- 229
2871
- 230</pre>
2843
+ 229</pre>
2872
2844
  </td>
2873
2845
  <td>
2874
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 213</span>
2846
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 212</span>
2875
2847
 
2876
2848
  <span class='kw'>def</span> <span class='id identifier rubyid_override_exception_message'>override_exception_message</span><span class='lparen'>(</span><span class='id identifier rubyid_exception'>exception</span><span class='comma'>,</span> <span class='id identifier rubyid_binding_or_bindings'>binding_or_bindings</span><span class='rparen'>)</span>
2877
2849
  <span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>unless</span> <span class='id identifier rubyid_exception'>exception</span>
@@ -2911,6 +2883,7 @@
2911
2883
  <pre class="lines">
2912
2884
 
2913
2885
 
2886
+ 199
2914
2887
  200
2915
2888
  201
2916
2889
  202
@@ -2921,11 +2894,10 @@
2921
2894
  207
2922
2895
  208
2923
2896
  209
2924
- 210
2925
- 211</pre>
2897
+ 210</pre>
2926
2898
  </td>
2927
2899
  <td>
2928
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 200</span>
2900
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 199</span>
2929
2901
 
2930
2902
  <span class='kw'>def</span> <span class='id identifier rubyid_override_rspec_message'>override_rspec_message</span><span class='lparen'>(</span><span class='id identifier rubyid_example'>example</span><span class='comma'>,</span> <span class='id identifier rubyid_binding_or_bindings'>binding_or_bindings</span><span class='rparen'>)</span>
2931
2903
  <span class='id identifier rubyid_exception_obj'>exception_obj</span> <span class='op'>=</span> <span class='id identifier rubyid_example'>example</span><span class='period'>.</span><span class='id identifier rubyid_exception'>exception</span>
@@ -2945,9 +2917,9 @@
2945
2917
  </div>
2946
2918
 
2947
2919
  <div class="method_details ">
2948
- <h3 class="signature " id="reset_capture_events_count-class_method">
2920
+ <h3 class="signature " id="reset!-class_method">
2949
2921
 
2950
- .<strong>reset_capture_events_count</strong> &#x21d2; <tt>Object</tt>
2922
+ .<strong>reset!</strong> &#x21d2; <tt>Object</tt>
2951
2923
 
2952
2924
 
2953
2925
 
@@ -2959,18 +2931,32 @@
2959
2931
  <pre class="lines">
2960
2932
 
2961
2933
 
2934
+ 169
2935
+ 170
2936
+ 171
2937
+ 172
2938
+ 173
2939
+ 174
2940
+ 175
2941
+ 176
2962
2942
  177
2963
2943
  178
2964
2944
  179
2965
- 180
2966
- 181</pre>
2945
+ 180</pre>
2967
2946
  </td>
2968
2947
  <td>
2969
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 177</span>
2948
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 169</span>
2970
2949
 
2971
- <span class='kw'>def</span> <span class='id identifier rubyid_reset_capture_events_count'>reset_capture_events_count</span>
2950
+ <span class='kw'>def</span> <span class='id identifier rubyid_reset!'>reset!</span>
2972
2951
  <span class='id identifier rubyid_mutex'>mutex</span><span class='period'>.</span><span class='id identifier rubyid_synchronize'>synchronize</span> <span class='kw'>do</span>
2952
+ <span class='ivar'>@rspec_tracepoint</span><span class='op'>&amp;.</span><span class='id identifier rubyid_disable'>disable</span>
2953
+ <span class='ivar'>@minitest_trace</span><span class='op'>&amp;.</span><span class='id identifier rubyid_disable'>disable</span>
2954
+ <span class='ivar'>@exception_trace</span><span class='op'>&amp;.</span><span class='id identifier rubyid_disable'>disable</span>
2955
+ <span class='ivar'>@rspec_tracepoint</span> <span class='op'>=</span> <span class='kw'>nil</span>
2956
+ <span class='ivar'>@minitest_trace</span> <span class='op'>=</span> <span class='kw'>nil</span>
2957
+ <span class='ivar'>@exception_trace</span> <span class='op'>=</span> <span class='kw'>nil</span>
2973
2958
  <span class='ivar'>@capture_events_count</span> <span class='op'>=</span> <span class='int'>0</span>
2959
+ <span class='ivar'>@enabled</span> <span class='op'>=</span> <span class='kw'>true</span>
2974
2960
  <span class='kw'>end</span>
2975
2961
  <span class='kw'>end</span></pre>
2976
2962
  </td>
@@ -3015,6 +3001,10 @@
3015
3001
  <pre class="lines">
3016
3002
 
3017
3003
 
3004
+ 522
3005
+ 523
3006
+ 524
3007
+ 525
3018
3008
  526
3019
3009
  527
3020
3010
  528
@@ -3025,14 +3015,10 @@
3025
3015
  533
3026
3016
  534
3027
3017
  535
3028
- 536
3029
- 537
3030
- 538
3031
- 539
3032
- 540</pre>
3018
+ 536</pre>
3033
3019
  </td>
3034
3020
  <td>
3035
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 526</span>
3021
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 522</span>
3036
3022
 
3037
3023
  <span class='kw'>def</span> <span class='id identifier rubyid_running_in_ci?'>running_in_ci?</span>
3038
3024
  <span class='id identifier rubyid_mutex'>mutex</span><span class='period'>.</span><span class='id identifier rubyid_synchronize'>synchronize</span> <span class='kw'>do</span>
@@ -3069,19 +3055,19 @@
3069
3055
  <pre class="lines">
3070
3056
 
3071
3057
 
3058
+ 291
3059
+ 292
3060
+ 293
3061
+ 294
3062
+ 295
3063
+ 296
3064
+ 297
3072
3065
  298
3073
3066
  299
3074
- 300
3075
- 301
3076
- 302
3077
- 303
3078
- 304
3079
- 305
3080
- 306
3081
- 307</pre>
3067
+ 300</pre>
3082
3068
  </td>
3083
3069
  <td>
3084
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 298</span>
3070
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 291</span>
3085
3071
 
3086
3072
  <span class='kw'>def</span> <span class='id identifier rubyid_safe_prepend_module'>safe_prepend_module</span><span class='lparen'>(</span><span class='id identifier rubyid_target_class'>target_class</span><span class='comma'>,</span> <span class='id identifier rubyid_mod'>mod</span><span class='rparen'>)</span>
3087
3073
  <span class='id identifier rubyid_mutex'>mutex</span><span class='period'>.</span><span class='id identifier rubyid_synchronize'>synchronize</span> <span class='kw'>do</span>
@@ -3113,14 +3099,14 @@
3113
3099
  <pre class="lines">
3114
3100
 
3115
3101
 
3102
+ 193
3116
3103
  194
3117
3104
  195
3118
3105
  196
3119
- 197
3120
- 198</pre>
3106
+ 197</pre>
3121
3107
  </td>
3122
3108
  <td>
3123
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 194</span>
3109
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 193</span>
3124
3110
 
3125
3111
  <span class='kw'>def</span> <span class='id identifier rubyid_skip_list'>skip_list</span>
3126
3112
  <span class='id identifier rubyid_mutex'>mutex</span><span class='period'>.</span><span class='id identifier rubyid_synchronize'>synchronize</span> <span class='kw'>do</span>
@@ -3147,26 +3133,30 @@
3147
3133
  <pre class="lines">
3148
3134
 
3149
3135
 
3136
+ 306
3137
+ 307
3138
+ 308
3139
+ 309
3140
+ 310
3141
+ 311
3142
+ 312
3150
3143
  313
3151
3144
  314
3152
3145
  315
3153
3146
  316
3154
- 317
3155
- 318
3156
- 319
3157
- 320
3158
- 321
3159
- 322</pre>
3147
+ 317</pre>
3160
3148
  </td>
3161
3149
  <td>
3162
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 313</span>
3150
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 306</span>
3163
3151
 
3164
3152
  <span class='kw'>def</span> <span class='id identifier rubyid_start_minitest_binding_capture'>start_minitest_binding_capture</span>
3165
- <span class='kw'>return</span> <span class='kw'>if</span> <span class='id identifier rubyid_capture_limit_exceeded?'>capture_limit_exceeded?</span>
3153
+ <span class='kw'>return</span> <span class='kw'>if</span> <span class='id identifier rubyid_enforce_capture_limit'>enforce_capture_limit</span>
3154
+ <span class='ivar'>@enabled</span> <span class='op'>=</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='ivar'>@enabled</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
3166
3155
  <span class='id identifier rubyid_mutex'>mutex</span><span class='period'>.</span><span class='id identifier rubyid_synchronize'>synchronize</span> <span class='kw'>do</span>
3167
3156
  <span class='ivar'>@minitest_trace</span> <span class='op'>=</span> <span class='const'>TracePoint</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:return</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_tp'>tp</span><span class='op'>|</span>
3168
3157
  <span class='kw'>next</span> <span class='kw'>unless</span> <span class='id identifier rubyid_tp'>tp</span><span class='period'>.</span><span class='id identifier rubyid_method_id'>method_id</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'>&#39;</span><span class='tstring_content'>test_</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_is_a_minitest?'>is_a_minitest?</span><span class='lparen'>(</span><span class='id identifier rubyid_tp'>tp</span><span class='period'>.</span><span class='id identifier rubyid_defined_class'>defined_class</span><span class='rparen'>)</span>
3169
3158
  <span class='ivar'>@minitest_test_binding</span> <span class='op'>=</span> <span class='id identifier rubyid_tp'>tp</span><span class='period'>.</span><span class='id identifier rubyid_binding'>binding</span>
3159
+ <span class='id identifier rubyid_increment_capture_events_count'>increment_capture_events_count</span>
3170
3160
  <span class='kw'>end</span>
3171
3161
  <span class='ivar'>@minitest_trace</span><span class='period'>.</span><span class='id identifier rubyid_enable'>enable</span>
3172
3162
  <span class='kw'>end</span>
@@ -3191,6 +3181,11 @@
3191
3181
  <pre class="lines">
3192
3182
 
3193
3183
 
3184
+ 341
3185
+ 342
3186
+ 343
3187
+ 344
3188
+ 345
3194
3189
  346
3195
3190
  347
3196
3191
  348
@@ -3223,17 +3218,14 @@
3223
3218
  375
3224
3219
  376
3225
3220
  377
3226
- 378
3227
- 379
3228
- 380
3229
- 381
3230
- 382</pre>
3221
+ 378</pre>
3231
3222
  </td>
3232
3223
  <td>
3233
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 346</span>
3224
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 341</span>
3234
3225
 
3235
3226
  <span class='kw'>def</span> <span class='id identifier rubyid_start_rspec_binding_capture'>start_rspec_binding_capture</span>
3236
- <span class='kw'>return</span> <span class='kw'>if</span> <span class='id identifier rubyid_capture_limit_exceeded?'>capture_limit_exceeded?</span>
3227
+ <span class='kw'>return</span> <span class='kw'>if</span> <span class='id identifier rubyid_enforce_capture_limit'>enforce_capture_limit</span>
3228
+ <span class='ivar'>@enabled</span> <span class='op'>=</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='ivar'>@enabled</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
3237
3229
  <span class='id identifier rubyid_mutex'>mutex</span><span class='period'>.</span><span class='id identifier rubyid_synchronize'>synchronize</span> <span class='kw'>do</span>
3238
3230
  <span class='ivar'>@rspec_example_binding</span> <span class='op'>=</span> <span class='kw'>nil</span>
3239
3231
  <span class='ivar'>@capture_next_binding</span> <span class='op'>=</span> <span class='kw'>false</span>
@@ -3252,8 +3244,8 @@
3252
3244
  <span class='kw'>next</span> <span class='kw'>unless</span> <span class='ivar'>@capture_next_binding</span>
3253
3245
 
3254
3246
  <span class='kw'>if</span> <span class='ivar'>@capture_next_binding</span> <span class='op'>==</span> <span class='symbol'>:next</span> <span class='op'>||</span> <span class='ivar'>@capture_next_binding</span> <span class='op'>==</span> <span class='symbol'>:next_matching</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_is_rspec_example?'>is_rspec_example?</span><span class='lparen'>(</span><span class='id identifier rubyid_tp'>tp</span><span class='rparen'>)</span>
3255
- <span class='id identifier rubyid_increment_capture_events_count'>increment_capture_events_count</span>
3256
3247
  <span class='ivar'>@capture_next_binding</span> <span class='op'>=</span> <span class='kw'>false</span>
3248
+ <span class='id identifier rubyid_increment_capture_events_count'>increment_capture_events_count</span>
3257
3249
  <span class='ivar'>@rspec_example_binding</span> <span class='op'>=</span> <span class='id identifier rubyid_tp'>tp</span><span class='period'>.</span><span class='id identifier rubyid_binding'>binding</span>
3258
3250
  <span class='kw'>end</span>
3259
3251
  <span class='kw'>elsif</span> <span class='id identifier rubyid_tp'>tp</span><span class='period'>.</span><span class='id identifier rubyid_event'>event</span> <span class='op'>==</span> <span class='symbol'>:raise</span>
@@ -3289,17 +3281,17 @@
3289
3281
  <pre class="lines">
3290
3282
 
3291
3283
 
3284
+ 319
3285
+ 320
3286
+ 321
3287
+ 322
3288
+ 323
3292
3289
  324
3293
3290
  325
3294
- 326
3295
- 327
3296
- 328
3297
- 329
3298
- 330
3299
- 331</pre>
3291
+ 326</pre>
3300
3292
  </td>
3301
3293
  <td>
3302
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 324</span>
3294
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 319</span>
3303
3295
 
3304
3296
  <span class='kw'>def</span> <span class='id identifier rubyid_stop_minitest_binding_capture'>stop_minitest_binding_capture</span>
3305
3297
  <span class='id identifier rubyid_disable_capturing!'>disable_capturing!</span> <span class='kw'>if</span> <span class='id identifier rubyid_capture_limit_exceeded?'>capture_limit_exceeded?</span>
@@ -3329,20 +3321,20 @@
3329
3321
  <pre class="lines">
3330
3322
 
3331
3323
 
3324
+ 380
3325
+ 381
3326
+ 382
3327
+ 383
3332
3328
  384
3333
3329
  385
3334
3330
  386
3335
3331
  387
3336
3332
  388
3337
3333
  389
3338
- 390
3339
- 391
3340
- 392
3341
- 393
3342
- 394</pre>
3334
+ 390</pre>
3343
3335
  </td>
3344
3336
  <td>
3345
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 384</span>
3337
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 380</span>
3346
3338
 
3347
3339
  <span class='kw'>def</span> <span class='id identifier rubyid_stop_rspec_binding_capture'>stop_rspec_binding_capture</span>
3348
3340
  <span class='id identifier rubyid_disable_capturing!'>disable_capturing!</span> <span class='kw'>if</span> <span class='id identifier rubyid_capture_limit_exceeded?'>capture_limit_exceeded?</span>
@@ -3375,15 +3367,15 @@
3375
3367
  <pre class="lines">
3376
3368
 
3377
3369
 
3370
+ 550
3371
+ 551
3372
+ 552
3373
+ 553
3378
3374
  554
3379
- 555
3380
- 556
3381
- 557
3382
- 558
3383
- 559</pre>
3375
+ 555</pre>
3384
3376
  </td>
3385
3377
  <td>
3386
- <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 554</span>
3378
+ <pre class="code"><span class="info file"># File 'lib/enhanced_errors.rb', line 550</span>
3387
3379
 
3388
3380
  <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>
3389
3381
  <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_event</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</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>
@@ -3401,7 +3393,7 @@
3401
3393
  </div>
3402
3394
 
3403
3395
  <div id="footer">
3404
- Generated on Mon Dec 16 10:41:42 2024 by
3396
+ Generated on Mon Dec 16 11:33:57 2024 by
3405
3397
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
3406
3398
  0.9.37 (ruby-3.3.6).
3407
3399
  </div>
data/doc/Exception.html CHANGED
@@ -241,7 +241,7 @@
241
241
  </div>
242
242
 
243
243
  <div id="footer">
244
- Generated on Mon Dec 16 10:41:42 2024 by
244
+ Generated on Mon Dec 16 11:33:57 2024 by
245
245
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
246
246
  0.9.37 (ruby-3.3.6).
247
247
  </div>
data/doc/Minitest.html CHANGED
@@ -228,7 +228,7 @@
228
228
  </div>
229
229
 
230
230
  <div id="footer">
231
- Generated on Mon Dec 16 10:41:42 2024 by
231
+ Generated on Mon Dec 16 11:33:57 2024 by
232
232
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
233
233
  0.9.37 (ruby-3.3.6).
234
234
  </div>
data/doc/_index.html CHANGED
@@ -135,7 +135,7 @@
135
135
  </div>
136
136
 
137
137
  <div id="footer">
138
- Generated on Mon Dec 16 10:41:42 2024 by
138
+ Generated on Mon Dec 16 11:33:57 2024 by
139
139
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
140
140
  0.9.37 (ruby-3.3.6).
141
141
  </div>
data/doc/file.README.html CHANGED
@@ -486,7 +486,7 @@
486
486
  </div></div>
487
487
 
488
488
  <div id="footer">
489
- Generated on Mon Dec 16 10:41:42 2024 by
489
+ Generated on Mon Dec 16 11:33:57 2024 by
490
490
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
491
491
  0.9.37 (ruby-3.3.6).
492
492
  </div>
data/doc/index.html CHANGED
@@ -486,7 +486,7 @@
486
486
  </div></div>
487
487
 
488
488
  <div id="footer">
489
- Generated on Mon Dec 16 10:41:42 2024 by
489
+ Generated on Mon Dec 16 11:33:57 2024 by
490
490
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
491
491
  0.9.37 (ruby-3.3.6).
492
492
  </div>
data/doc/method_list.html CHANGED
@@ -217,7 +217,7 @@
217
217
 
218
218
  <li class="even ">
219
219
  <div class="item">
220
- <span class='object_link'><a href="EnhancedErrors.html#enforce_capture_limit!-class_method" title="EnhancedErrors.enforce_capture_limit! (method)">enforce_capture_limit!</a></span>
220
+ <span class='object_link'><a href="EnhancedErrors.html#enforce_capture_limit-class_method" title="EnhancedErrors.enforce_capture_limit (method)">enforce_capture_limit</a></span>
221
221
  <small>EnhancedErrors</small>
222
222
  </div>
223
223
  </li>
@@ -385,7 +385,7 @@
385
385
 
386
386
  <li class="odd ">
387
387
  <div class="item">
388
- <span class='object_link'><a href="EnhancedErrors.html#reset_capture_events_count-class_method" title="EnhancedErrors.reset_capture_events_count (method)">reset_capture_events_count</a></span>
388
+ <span class='object_link'><a href="EnhancedErrors.html#reset!-class_method" title="EnhancedErrors.reset! (method)">reset!</a></span>
389
389
  <small>EnhancedErrors</small>
390
390
  </div>
391
391
  </li>
@@ -122,7 +122,7 @@
122
122
  </div>
123
123
 
124
124
  <div id="footer">
125
- Generated on Mon Dec 16 10:41:42 2024 by
125
+ Generated on Mon Dec 16 11:33:57 2024 by
126
126
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
127
127
  0.9.37 (ruby-3.3.6).
128
128
  </div>
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "enhanced_errors"
3
- spec.version = "2.1.2"
3
+ spec.version = "2.1.3"
4
4
  spec.authors = ["Eric Beland"]
5
5
 
6
6
  spec.summary = "Automatically enhance your errors with messages containing variable values from the moment they were raised."
@@ -86,7 +86,7 @@ class EnhancedErrors
86
86
 
87
87
  RSPEC_HANDLER_NAMES = ['RSpec::Expectations::PositiveExpectationHandler', 'RSpec::Expectations::NegativeExpectationHandler']
88
88
 
89
- @enabled = false
89
+ @enabled = nil
90
90
  @max_length = nil
91
91
  @capture_rescue = nil
92
92
  @skip_list = nil
@@ -134,21 +134,13 @@ class EnhancedErrors
134
134
  def max_capture_events=(value)
135
135
  mutex.synchronize do
136
136
  @max_capture_events = value
137
- if @max_capture_events == 0
138
- # Disable capturing
139
- if @enabled
140
- puts "EnhancedErrors: max_capture_events set to 0, disabling capturing."
141
- @enabled = false
142
- @exception_trace&.disable
143
- @rspec_tracepoint&.disable
144
- @minitest_trace&.disable
145
- end
146
- end
147
137
  end
148
138
  end
149
139
 
150
- def enforce_capture_limit!
140
+ def enforce_capture_limit
141
+ exceeded = capture_limit_exceeded?
151
142
  disable_capturing! if capture_limit_exceeded?
143
+ exceeded
152
144
  end
153
145
 
154
146
  def capture_limit_exceeded?
@@ -174,9 +166,16 @@ class EnhancedErrors
174
166
  end
175
167
  end
176
168
 
177
- def reset_capture_events_count
169
+ def reset!
178
170
  mutex.synchronize do
171
+ @rspec_tracepoint&.disable
172
+ @minitest_trace&.disable
173
+ @exception_trace&.disable
174
+ @rspec_tracepoint = nil
175
+ @minitest_trace = nil
176
+ @exception_trace = nil
179
177
  @capture_events_count = 0
178
+ @enabled = true
180
179
  end
181
180
  end
182
181
 
@@ -249,17 +248,11 @@ class EnhancedErrors
249
248
  if @max_capture_events.nil?
250
249
  @max_capture_events = -1
251
250
  end
252
- @capture_events_count = 0
251
+ @capture_events_count ||= 0
253
252
 
254
253
  @rspec_failure_message_loaded = true
255
254
 
256
- if !enabled
257
- @original_global_variables = nil
258
- @enabled = false
259
- return
260
- end
261
-
262
- @enabled = true
255
+ @enabled = enabled
263
256
  @debug = debug
264
257
  @original_global_variables = global_variables if @debug
265
258
 
@@ -311,11 +304,13 @@ class EnhancedErrors
311
304
  end
312
305
 
313
306
  def start_minitest_binding_capture
314
- return if capture_limit_exceeded?
307
+ return if enforce_capture_limit
308
+ @enabled = true if @enabled.nil?
315
309
  mutex.synchronize do
316
310
  @minitest_trace = TracePoint.new(:return) do |tp|
317
311
  next unless tp.method_id.to_s.start_with?('test_') && is_a_minitest?(tp.defined_class)
318
312
  @minitest_test_binding = tp.binding
313
+ increment_capture_events_count
319
314
  end
320
315
  @minitest_trace.enable
321
316
  end
@@ -344,7 +339,8 @@ class EnhancedErrors
344
339
  end
345
340
 
346
341
  def start_rspec_binding_capture
347
- return if capture_limit_exceeded?
342
+ return if enforce_capture_limit
343
+ @enabled = true if @enabled.nil?
348
344
  mutex.synchronize do
349
345
  @rspec_example_binding = nil
350
346
  @capture_next_binding = false
@@ -363,8 +359,8 @@ class EnhancedErrors
363
359
  next unless @capture_next_binding
364
360
 
365
361
  if @capture_next_binding == :next || @capture_next_binding == :next_matching && is_rspec_example?(tp)
366
- increment_capture_events_count
367
362
  @capture_next_binding = false
363
+ increment_capture_events_count
368
364
  @rspec_example_binding = tp.binding
369
365
  end
370
366
  elsif tp.event == :raise
@@ -608,8 +604,8 @@ class EnhancedErrors
608
604
 
609
605
  def handle_tracepoint_event(tp)
610
606
  # Check enabled outside the synchronized block for speed, but still safe due to re-check inside.
611
- enforce_capture_limit!
612
- return unless mutex.synchronize { @enabled }
607
+ return unless enabled
608
+ return if enforce_capture_limit
613
609
  return if Thread.current[:enhanced_errors_processing] || Thread.current[:on_capture] || ignored_exception?(tp.raised_exception)
614
610
 
615
611
  Thread.current[:enhanced_errors_processing] = true
@@ -685,6 +681,7 @@ class EnhancedErrors
685
681
 
686
682
  if binding_info
687
683
  binding_info = validate_binding_format(binding_info)
684
+ increment_capture_events_count
688
685
  if binding_info && exception.binding_infos.length >= MAX_BINDING_INFOS
689
686
  exception.binding_infos.delete_at(MAX_BINDING_INFOS / 2.round)
690
687
  end
@@ -693,7 +690,6 @@ class EnhancedErrors
693
690
  mutex.synchronize do
694
691
  override_exception_message(exception, exception.binding_infos) if @override_messages
695
692
  end
696
- increment_capture_events_count
697
693
  end
698
694
  end
699
695
  rescue
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enhanced_errors
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Beland