enhanced_errors 3.0.3 → 3.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +43 -35
- data/benchmark/benchmark.rb +31 -29
- data/benchmark/memory_bench.rb +1 -1
- data/benchmark/result.txt +11 -0
- data/doc/Enhanced/Colors.html +2 -2
- data/doc/Enhanced/Context.html +283 -0
- data/doc/Enhanced/ExceptionBindingInfos.html +249 -0
- data/doc/Enhanced/ExceptionContext.html +397 -0
- data/doc/Enhanced.html +8 -4
- data/doc/EnhancedErrors.html +395 -275
- data/doc/EnhancedExceptionContext.html +15 -15
- data/doc/Exception.html +5 -5
- data/doc/ExceptionBindingInfos.html +2 -2
- data/doc/Minitest.html +3 -3
- data/doc/_index.html +12 -6
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +39 -44
- data/doc/index.html +39 -44
- data/doc/method_list.html +34 -18
- data/doc/top-level-namespace.html +18 -8
- data/enhanced_errors.gemspec +1 -1
- data/lib/enhanced/context.rb +7 -5
- data/lib/enhanced/exception.rb +35 -36
- data/lib/enhanced/exception_context.rb +49 -0
- data/lib/enhanced/minitest_patch.rb +1 -1
- data/lib/enhanced_errors.rb +147 -98
- metadata +8 -13
- data/.yardoc/checksums +0 -6
- data/.yardoc/complete +0 -0
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/lib/enhanced/enhanced_exception_context.rb +0 -47
@@ -0,0 +1,249 @@
|
|
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
|
+
Module: Enhanced::ExceptionBindingInfos
|
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 = "Enhanced::ExceptionBindingInfos";
|
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
|
+
<span class='title'><span class='object_link'><a href="../Enhanced.html" title="Enhanced (module)">Enhanced</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">ExceptionBindingInfos</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>Module: Enhanced::ExceptionBindingInfos
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
<dl>
|
78
|
+
<dt>Included in:</dt>
|
79
|
+
<dd><span class='object_link'><a href="../Exception.html" title="Exception (class)">Exception</a></span></dd>
|
80
|
+
</dl>
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
<dl>
|
85
|
+
<dt>Defined in:</dt>
|
86
|
+
<dd>lib/enhanced/exception.rb</dd>
|
87
|
+
</dl>
|
88
|
+
|
89
|
+
</div>
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
<h2>
|
100
|
+
Instance Method Summary
|
101
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
102
|
+
</h2>
|
103
|
+
|
104
|
+
<ul class="summary">
|
105
|
+
|
106
|
+
<li class="public ">
|
107
|
+
<span class="summary_signature">
|
108
|
+
|
109
|
+
<a href="#binding_infos-instance_method" title="#binding_infos (instance method)">#<strong>binding_infos</strong> ⇒ Object </a>
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
</span>
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
124
|
+
|
125
|
+
</li>
|
126
|
+
|
127
|
+
|
128
|
+
<li class="public ">
|
129
|
+
<span class="summary_signature">
|
130
|
+
|
131
|
+
<a href="#captured_variables-instance_method" title="#captured_variables (instance method)">#<strong>captured_variables</strong> ⇒ Object </a>
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
</span>
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
146
|
+
|
147
|
+
</li>
|
148
|
+
|
149
|
+
|
150
|
+
</ul>
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
<div id="instance_method_details" class="method_details_list">
|
156
|
+
<h2>Instance Method Details</h2>
|
157
|
+
|
158
|
+
|
159
|
+
<div class="method_details first">
|
160
|
+
<h3 class="signature first" id="binding_infos-instance_method">
|
161
|
+
|
162
|
+
#<strong>binding_infos</strong> ⇒ <tt>Object</tt>
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
</h3><table class="source_code">
|
169
|
+
<tr>
|
170
|
+
<td>
|
171
|
+
<pre class="lines">
|
172
|
+
|
173
|
+
|
174
|
+
6
|
175
|
+
7
|
176
|
+
8
|
177
|
+
9
|
178
|
+
10
|
179
|
+
11
|
180
|
+
12
|
181
|
+
13</pre>
|
182
|
+
</td>
|
183
|
+
<td>
|
184
|
+
<pre class="code"><span class="info file"># File 'lib/enhanced/exception.rb', line 6</span>
|
185
|
+
|
186
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_binding_infos'>binding_infos</span>
|
187
|
+
<span class='id identifier rubyid_ctx'>ctx</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Enhanced.html" title="Enhanced (module)">Enhanced</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ExceptionContext.html" title="Enhanced::ExceptionContext (module)">ExceptionContext</a></span></span><span class='period'>.</span><span class='id identifier rubyid_context_for'><span class='object_link'><a href="ExceptionContext.html#context_for-instance_method" title="Enhanced::ExceptionContext#context_for (method)">context_for</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
|
188
|
+
<span class='kw'>unless</span> <span class='id identifier rubyid_ctx'>ctx</span>
|
189
|
+
<span class='id identifier rubyid_ctx'>ctx</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Context.html" title="Enhanced::Context (class)">Context</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Context.html#initialize-instance_method" title="Enhanced::Context#initialize (method)">new</a></span></span>
|
190
|
+
<span class='const'><span class='object_link'><a href="../Enhanced.html" title="Enhanced (module)">Enhanced</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ExceptionContext.html" title="Enhanced::ExceptionContext (module)">ExceptionContext</a></span></span><span class='period'>.</span><span class='id identifier rubyid_store_context'><span class='object_link'><a href="ExceptionContext.html#store_context-instance_method" title="Enhanced::ExceptionContext#store_context (method)">store_context</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_ctx'>ctx</span><span class='rparen'>)</span>
|
191
|
+
<span class='kw'>end</span>
|
192
|
+
<span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_binding_infos'>binding_infos</span>
|
193
|
+
<span class='kw'>end</span></pre>
|
194
|
+
</td>
|
195
|
+
</tr>
|
196
|
+
</table>
|
197
|
+
</div>
|
198
|
+
|
199
|
+
<div class="method_details ">
|
200
|
+
<h3 class="signature " id="captured_variables-instance_method">
|
201
|
+
|
202
|
+
#<strong>captured_variables</strong> ⇒ <tt>Object</tt>
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
</h3><table class="source_code">
|
209
|
+
<tr>
|
210
|
+
<td>
|
211
|
+
<pre class="lines">
|
212
|
+
|
213
|
+
|
214
|
+
15
|
215
|
+
16
|
216
|
+
17
|
217
|
+
18
|
218
|
+
19
|
219
|
+
20
|
220
|
+
21</pre>
|
221
|
+
</td>
|
222
|
+
<td>
|
223
|
+
<pre class="code"><span class="info file"># File 'lib/enhanced/exception.rb', line 15</span>
|
224
|
+
|
225
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_captured_variables'>captured_variables</span>
|
226
|
+
<span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_binding_infos'>binding_infos</span><span class='op'>&.</span><span class='id identifier rubyid_any?'>any?</span>
|
227
|
+
<span class='id identifier rubyid_bindings_of_interest'>bindings_of_interest</span> <span class='op'>=</span> <span class='id identifier rubyid_select_binding_infos'>select_binding_infos</span>
|
228
|
+
<span class='const'><span class='object_link'><a href="../EnhancedErrors.html" title="EnhancedErrors (class)">EnhancedErrors</a></span></span><span class='period'>.</span><span class='id identifier rubyid_format'><span class='object_link'><a href="../EnhancedErrors.html#format-class_method" title="EnhancedErrors.format (method)">format</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_bindings_of_interest'>bindings_of_interest</span><span class='rparen'>)</span>
|
229
|
+
<span class='kw'>rescue</span>
|
230
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span>
|
231
|
+
<span class='kw'>end</span></pre>
|
232
|
+
</td>
|
233
|
+
</tr>
|
234
|
+
</table>
|
235
|
+
</div>
|
236
|
+
|
237
|
+
</div>
|
238
|
+
|
239
|
+
</div>
|
240
|
+
|
241
|
+
<div id="footer">
|
242
|
+
Generated on Wed Dec 25 13:01:48 2024 by
|
243
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
244
|
+
0.9.37 (ruby-3.4.1).
|
245
|
+
</div>
|
246
|
+
|
247
|
+
</div>
|
248
|
+
</body>
|
249
|
+
</html>
|
@@ -0,0 +1,397 @@
|
|
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
|
+
Module: Enhanced::ExceptionContext
|
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 = "Enhanced::ExceptionContext";
|
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
|
+
<span class='title'><span class='object_link'><a href="../Enhanced.html" title="Enhanced (module)">Enhanced</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">ExceptionContext</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>Module: Enhanced::ExceptionContext
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
<dl>
|
73
|
+
<dt>Extended by:</dt>
|
74
|
+
<dd><span class='object_link'><a href="" title="Enhanced::ExceptionContext (module)">ExceptionContext</a></span></dd>
|
75
|
+
</dl>
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
<dl>
|
83
|
+
<dt>Included in:</dt>
|
84
|
+
<dd><span class='object_link'><a href="" title="Enhanced::ExceptionContext (module)">ExceptionContext</a></span></dd>
|
85
|
+
</dl>
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
<dl>
|
90
|
+
<dt>Defined in:</dt>
|
91
|
+
<dd>lib/enhanced/exception_context.rb</dd>
|
92
|
+
</dl>
|
93
|
+
|
94
|
+
</div>
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
<h2>
|
99
|
+
Constant Summary
|
100
|
+
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
101
|
+
</h2>
|
102
|
+
|
103
|
+
<dl class="constants">
|
104
|
+
|
105
|
+
<dt id="REGISTRY-constant" class="">REGISTRY =
|
106
|
+
|
107
|
+
</dt>
|
108
|
+
<dd><pre class="code"><span class='lbrace'>{</span><span class='rbrace'>}</span></pre></dd>
|
109
|
+
|
110
|
+
<dt id="MUTEX-constant" class="">MUTEX =
|
111
|
+
|
112
|
+
</dt>
|
113
|
+
<dd><pre class="code"><span class='const'>Monitor</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span></pre></dd>
|
114
|
+
|
115
|
+
</dl>
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
<h2>
|
126
|
+
Instance Method Summary
|
127
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
128
|
+
</h2>
|
129
|
+
|
130
|
+
<ul class="summary">
|
131
|
+
|
132
|
+
<li class="public ">
|
133
|
+
<span class="summary_signature">
|
134
|
+
|
135
|
+
<a href="#clear_all-instance_method" title="#clear_all (instance method)">#<strong>clear_all</strong> ⇒ Object </a>
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
</span>
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
150
|
+
|
151
|
+
</li>
|
152
|
+
|
153
|
+
|
154
|
+
<li class="public ">
|
155
|
+
<span class="summary_signature">
|
156
|
+
|
157
|
+
<a href="#clear_context-instance_method" title="#clear_context (instance method)">#<strong>clear_context</strong>(exception) ⇒ Object </a>
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
</span>
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
172
|
+
|
173
|
+
</li>
|
174
|
+
|
175
|
+
|
176
|
+
<li class="public ">
|
177
|
+
<span class="summary_signature">
|
178
|
+
|
179
|
+
<a href="#context_for-instance_method" title="#context_for (instance method)">#<strong>context_for</strong>(exception) ⇒ Object </a>
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
</span>
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
194
|
+
|
195
|
+
</li>
|
196
|
+
|
197
|
+
|
198
|
+
<li class="public ">
|
199
|
+
<span class="summary_signature">
|
200
|
+
|
201
|
+
<a href="#store_context-instance_method" title="#store_context (instance method)">#<strong>store_context</strong>(exception, context) ⇒ Object </a>
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
</span>
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
216
|
+
|
217
|
+
</li>
|
218
|
+
|
219
|
+
|
220
|
+
</ul>
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
<div id="instance_method_details" class="method_details_list">
|
226
|
+
<h2>Instance Method Details</h2>
|
227
|
+
|
228
|
+
|
229
|
+
<div class="method_details first">
|
230
|
+
<h3 class="signature first" id="clear_all-instance_method">
|
231
|
+
|
232
|
+
#<strong>clear_all</strong> ⇒ <tt>Object</tt>
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
</h3><table class="source_code">
|
239
|
+
<tr>
|
240
|
+
<td>
|
241
|
+
<pre class="lines">
|
242
|
+
|
243
|
+
|
244
|
+
43
|
245
|
+
44
|
246
|
+
45
|
247
|
+
46
|
248
|
+
47</pre>
|
249
|
+
</td>
|
250
|
+
<td>
|
251
|
+
<pre class="code"><span class="info file"># File 'lib/enhanced/exception_context.rb', line 43</span>
|
252
|
+
|
253
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_clear_all'>clear_all</span>
|
254
|
+
<span class='const'><span class='object_link'><a href="#MUTEX-constant" title="Enhanced::ExceptionContext::MUTEX (constant)">MUTEX</a></span></span><span class='period'>.</span><span class='id identifier rubyid_synchronize'>synchronize</span> <span class='kw'>do</span>
|
255
|
+
<span class='const'><span class='object_link'><a href="#REGISTRY-constant" title="Enhanced::ExceptionContext::REGISTRY (constant)">REGISTRY</a></span></span><span class='period'>.</span><span class='id identifier rubyid_clear'>clear</span>
|
256
|
+
<span class='kw'>end</span>
|
257
|
+
<span class='kw'>end</span></pre>
|
258
|
+
</td>
|
259
|
+
</tr>
|
260
|
+
</table>
|
261
|
+
</div>
|
262
|
+
|
263
|
+
<div class="method_details ">
|
264
|
+
<h3 class="signature " id="clear_context-instance_method">
|
265
|
+
|
266
|
+
#<strong>clear_context</strong>(exception) ⇒ <tt>Object</tt>
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
</h3><table class="source_code">
|
273
|
+
<tr>
|
274
|
+
<td>
|
275
|
+
<pre class="lines">
|
276
|
+
|
277
|
+
|
278
|
+
37
|
279
|
+
38
|
280
|
+
39
|
281
|
+
40
|
282
|
+
41</pre>
|
283
|
+
</td>
|
284
|
+
<td>
|
285
|
+
<pre class="code"><span class="info file"># File 'lib/enhanced/exception_context.rb', line 37</span>
|
286
|
+
|
287
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_clear_context'>clear_context</span><span class='lparen'>(</span><span class='id identifier rubyid_exception'>exception</span><span class='rparen'>)</span>
|
288
|
+
<span class='const'><span class='object_link'><a href="#MUTEX-constant" title="Enhanced::ExceptionContext::MUTEX (constant)">MUTEX</a></span></span><span class='period'>.</span><span class='id identifier rubyid_synchronize'>synchronize</span> <span class='kw'>do</span>
|
289
|
+
<span class='const'><span class='object_link'><a href="#REGISTRY-constant" title="Enhanced::ExceptionContext::REGISTRY (constant)">REGISTRY</a></span></span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_exception'>exception</span><span class='period'>.</span><span class='id identifier rubyid_object_id'>object_id</span><span class='rparen'>)</span>
|
290
|
+
<span class='kw'>end</span>
|
291
|
+
<span class='kw'>end</span></pre>
|
292
|
+
</td>
|
293
|
+
</tr>
|
294
|
+
</table>
|
295
|
+
</div>
|
296
|
+
|
297
|
+
<div class="method_details ">
|
298
|
+
<h3 class="signature " id="context_for-instance_method">
|
299
|
+
|
300
|
+
#<strong>context_for</strong>(exception) ⇒ <tt>Object</tt>
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
</h3><table class="source_code">
|
307
|
+
<tr>
|
308
|
+
<td>
|
309
|
+
<pre class="lines">
|
310
|
+
|
311
|
+
|
312
|
+
21
|
313
|
+
22
|
314
|
+
23
|
315
|
+
24
|
316
|
+
25
|
317
|
+
26
|
318
|
+
27
|
319
|
+
28
|
320
|
+
29
|
321
|
+
30
|
322
|
+
31
|
323
|
+
32
|
324
|
+
33
|
325
|
+
34
|
326
|
+
35</pre>
|
327
|
+
</td>
|
328
|
+
<td>
|
329
|
+
<pre class="code"><span class="info file"># File 'lib/enhanced/exception_context.rb', line 21</span>
|
330
|
+
|
331
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_context_for'>context_for</span><span class='lparen'>(</span><span class='id identifier rubyid_exception'>exception</span><span class='rparen'>)</span>
|
332
|
+
<span class='const'><span class='object_link'><a href="#MUTEX-constant" title="Enhanced::ExceptionContext::MUTEX (constant)">MUTEX</a></span></span><span class='period'>.</span><span class='id identifier rubyid_synchronize'>synchronize</span> <span class='kw'>do</span>
|
333
|
+
<span class='id identifier rubyid_entry'>entry</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="#REGISTRY-constant" title="Enhanced::ExceptionContext::REGISTRY (constant)">REGISTRY</a></span></span><span class='lbracket'>[</span><span class='id identifier rubyid_exception'>exception</span><span class='period'>.</span><span class='id identifier rubyid_object_id'>object_id</span><span class='rbracket'>]</span>
|
334
|
+
<span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>unless</span> <span class='id identifier rubyid_entry'>entry</span>
|
335
|
+
|
336
|
+
<span class='kw'>begin</span>
|
337
|
+
<span class='id identifier rubyid__'>_</span> <span class='op'>=</span> <span class='id identifier rubyid_entry'>entry</span><span class='lbracket'>[</span><span class='symbol'>:weak_exc</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid___getobj__'>__getobj__</span> <span class='comment'># ensure exception is still alive
|
338
|
+
</span> <span class='id identifier rubyid_entry'>entry</span><span class='lbracket'>[</span><span class='symbol'>:context</span><span class='rbracket'>]</span>
|
339
|
+
<span class='kw'>rescue</span> <span class='const'>RefError</span>
|
340
|
+
<span class='comment'># Exception no longer alive, clean up
|
341
|
+
</span> <span class='const'><span class='object_link'><a href="#REGISTRY-constant" title="Enhanced::ExceptionContext::REGISTRY (constant)">REGISTRY</a></span></span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_exception'>exception</span><span class='period'>.</span><span class='id identifier rubyid_object_id'>object_id</span><span class='rparen'>)</span>
|
342
|
+
<span class='kw'>nil</span>
|
343
|
+
<span class='kw'>end</span>
|
344
|
+
<span class='kw'>end</span>
|
345
|
+
<span class='kw'>end</span></pre>
|
346
|
+
</td>
|
347
|
+
</tr>
|
348
|
+
</table>
|
349
|
+
</div>
|
350
|
+
|
351
|
+
<div class="method_details ">
|
352
|
+
<h3 class="signature " id="store_context-instance_method">
|
353
|
+
|
354
|
+
#<strong>store_context</strong>(exception, context) ⇒ <tt>Object</tt>
|
355
|
+
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
|
360
|
+
</h3><table class="source_code">
|
361
|
+
<tr>
|
362
|
+
<td>
|
363
|
+
<pre class="lines">
|
364
|
+
|
365
|
+
|
366
|
+
15
|
367
|
+
16
|
368
|
+
17
|
369
|
+
18
|
370
|
+
19</pre>
|
371
|
+
</td>
|
372
|
+
<td>
|
373
|
+
<pre class="code"><span class="info file"># File 'lib/enhanced/exception_context.rb', line 15</span>
|
374
|
+
|
375
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_store_context'>store_context</span><span class='lparen'>(</span><span class='id identifier rubyid_exception'>exception</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
376
|
+
<span class='const'><span class='object_link'><a href="#MUTEX-constant" title="Enhanced::ExceptionContext::MUTEX (constant)">MUTEX</a></span></span><span class='period'>.</span><span class='id identifier rubyid_synchronize'>synchronize</span> <span class='kw'>do</span>
|
377
|
+
<span class='const'><span class='object_link'><a href="#REGISTRY-constant" title="Enhanced::ExceptionContext::REGISTRY (constant)">REGISTRY</a></span></span><span class='lbracket'>[</span><span class='id identifier rubyid_exception'>exception</span><span class='period'>.</span><span class='id identifier rubyid_object_id'>object_id</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>weak_exc:</span> <span class='const'>WeakRef</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_exception'>exception</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='label'>context:</span> <span class='id identifier rubyid_context'>context</span> <span class='rbrace'>}</span>
|
378
|
+
<span class='kw'>end</span>
|
379
|
+
<span class='kw'>end</span></pre>
|
380
|
+
</td>
|
381
|
+
</tr>
|
382
|
+
</table>
|
383
|
+
</div>
|
384
|
+
|
385
|
+
</div>
|
386
|
+
|
387
|
+
</div>
|
388
|
+
|
389
|
+
<div id="footer">
|
390
|
+
Generated on Wed Dec 25 13:01:48 2024 by
|
391
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
392
|
+
0.9.37 (ruby-3.4.1).
|
393
|
+
</div>
|
394
|
+
|
395
|
+
</div>
|
396
|
+
</body>
|
397
|
+
</html>
|
data/doc/Enhanced.html
CHANGED
@@ -83,7 +83,9 @@
|
|
83
83
|
|
84
84
|
<dl>
|
85
85
|
<dt>Defined in:</dt>
|
86
|
-
<dd>lib/enhanced/colors.rb
|
86
|
+
<dd>lib/enhanced/colors.rb<span class="defines">,<br />
|
87
|
+
lib/enhanced_errors.rb,<br /> lib/enhanced_errors.rb,<br /> lib/enhanced/context.rb,<br /> lib/enhanced/exception.rb,<br /> lib/enhanced/exception_context.rb</span>
|
88
|
+
</dd>
|
87
89
|
</dl>
|
88
90
|
|
89
91
|
</div>
|
@@ -92,9 +94,11 @@
|
|
92
94
|
<p class="children">
|
93
95
|
|
94
96
|
|
97
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Enhanced/ExceptionBindingInfos.html" title="Enhanced::ExceptionBindingInfos (module)">ExceptionBindingInfos</a></span>, <span class='object_link'><a href="Enhanced/ExceptionContext.html" title="Enhanced::ExceptionContext (module)">ExceptionContext</a></span>
|
98
|
+
|
95
99
|
|
96
100
|
|
97
|
-
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Enhanced/Colors.html" title="Enhanced::Colors (class)">Colors</a></span>
|
101
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Enhanced/Colors.html" title="Enhanced::Colors (class)">Colors</a></span>, <span class='object_link'><a href="Enhanced/Context.html" title="Enhanced::Context (class)">Context</a></span>
|
98
102
|
|
99
103
|
|
100
104
|
</p>
|
@@ -110,9 +114,9 @@
|
|
110
114
|
</div>
|
111
115
|
|
112
116
|
<div id="footer">
|
113
|
-
Generated on
|
117
|
+
Generated on Wed Dec 25 13:01:48 2024 by
|
114
118
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
115
|
-
0.9.37 (ruby-3.
|
119
|
+
0.9.37 (ruby-3.4.1).
|
116
120
|
</div>
|
117
121
|
|
118
122
|
</div>
|