structured_warnings 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/License.txt +1 -1
- data/README.rdoc +20 -11
- data/Rakefile +46 -29
- data/doc/DeprecatedMethodWarning.html +170 -0
- data/doc/DeprecatedSignatureWarning.html +171 -0
- data/doc/DeprecationWarning.html +171 -0
- data/doc/Dynamic.html +172 -0
- data/doc/Object.html +186 -0
- data/doc/README_rdoc.html +296 -0
- data/doc/StandardWarning.html +169 -0
- data/doc/StructuredWarnings.html +187 -0
- data/doc/StructuredWarnings/ClassMethods.html +254 -0
- data/doc/StructuredWarnings/Kernel.html +274 -0
- data/doc/StructuredWarnings/Test.html +176 -0
- data/doc/StructuredWarnings/Test/Assertions.html +322 -0
- data/doc/StructuredWarnings/Test/Warner.html +271 -0
- data/doc/StructuredWarnings/Warner.html +226 -0
- data/doc/Warning.html +460 -0
- data/doc/Warning/ClassMethods.html +334 -0
- data/doc/created.rid +10 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +120 -0
- data/doc/js/darkfish.js +116 -0
- data/doc/js/jquery.js +32 -0
- data/doc/js/quicksearch.js +114 -0
- data/doc/js/thickbox-compressed.js +10 -0
- data/doc/lib/structured_warnings/dynamic_rb.html +65 -0
- data/doc/lib/structured_warnings/kernel_rb.html +52 -0
- data/doc/lib/structured_warnings/test/assertions_rb.html +52 -0
- data/doc/lib/structured_warnings/test/warner_rb.html +52 -0
- data/doc/lib/structured_warnings/test_rb.html +56 -0
- data/doc/lib/structured_warnings/warner_rb.html +52 -0
- data/doc/lib/structured_warnings/warning_rb.html +64 -0
- data/doc/lib/structured_warnings_rb.html +62 -0
- data/doc/rdoc.css +763 -0
- data/lib/structured_warnings.rb +6 -9
- data/lib/structured_warnings/dynamic.rb +6 -6
- data/lib/structured_warnings/kernel.rb +9 -9
- data/lib/structured_warnings/test.rb +2 -3
- data/lib/structured_warnings/test/assertions.rb +21 -9
- data/lib/structured_warnings/test/warner.rb +2 -2
- data/lib/structured_warnings/warner.rb +1 -1
- data/lib/structured_warnings/warning.rb +11 -11
- data/structured_warnings.gemspec +15 -58
- data/test/structured_warnings_test.rb +7 -6
- metadata +85 -62
- data/.gitignore +0 -2
- data/test/test_helper.rb +0 -4
- data/version.yml +0 -4
@@ -0,0 +1,271 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
7
|
+
|
8
|
+
<title>Class: StructuredWarnings::Test::Warner</title>
|
9
|
+
|
10
|
+
<link rel="stylesheet" href="../../rdoc.css" type="text/css" media="screen" />
|
11
|
+
|
12
|
+
<script src="../../js/jquery.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
<script src="../../js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
|
14
|
+
<script src="../../js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
|
15
|
+
<script src="../../js/darkfish.js" type="text/javascript" charset="utf-8"></script>
|
16
|
+
|
17
|
+
</head>
|
18
|
+
<body id="top" class="class">
|
19
|
+
|
20
|
+
<div id="metadata">
|
21
|
+
<div id="home-metadata">
|
22
|
+
<div id="home-section" class="section">
|
23
|
+
<h3 class="section-header">
|
24
|
+
<a href="../../index.html">Home</a>
|
25
|
+
<a href="../../index.html#classes">Classes</a>
|
26
|
+
<a href="../../index.html#methods">Methods</a>
|
27
|
+
</h3>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
|
31
|
+
<div id="file-metadata">
|
32
|
+
<div id="file-list-section" class="section">
|
33
|
+
<h3 class="section-header">In Files</h3>
|
34
|
+
<div class="section-body">
|
35
|
+
<ul>
|
36
|
+
|
37
|
+
<li><a href="../../lib/structured_warnings/test/warner_rb.html?TB_iframe=true&height=550&width=785"
|
38
|
+
class="thickbox" title="lib/structured_warnings/test/warner.rb">lib/structured_warnings/test/warner.rb</a></li>
|
39
|
+
|
40
|
+
</ul>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<div id="class-metadata">
|
48
|
+
|
49
|
+
<!-- Parent Class -->
|
50
|
+
<div id="parent-class-section" class="section">
|
51
|
+
<h3 class="section-header">Parent</h3>
|
52
|
+
|
53
|
+
<p class="link"><a href="../Warner.html">StructuredWarnings::Warner</a></p>
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
<!-- Method Quickref -->
|
64
|
+
<div id="method-list-section" class="section">
|
65
|
+
<h3 class="section-header">Methods</h3>
|
66
|
+
<ul class="link-list">
|
67
|
+
|
68
|
+
<li><a href="#method-i-format">#format</a></li>
|
69
|
+
|
70
|
+
<li><a href="#method-i-warned-3F">#warned?</a></li>
|
71
|
+
|
72
|
+
</ul>
|
73
|
+
</div>
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
</div>
|
78
|
+
|
79
|
+
<div id="project-metadata">
|
80
|
+
|
81
|
+
|
82
|
+
<div id="fileindex-section" class="section project-section">
|
83
|
+
<h3 class="section-header">Files</h3>
|
84
|
+
<ul>
|
85
|
+
|
86
|
+
<li class="file"><a href="../../README_rdoc.html">README.rdoc</a></li>
|
87
|
+
|
88
|
+
</ul>
|
89
|
+
</div>
|
90
|
+
|
91
|
+
|
92
|
+
<div id="classindex-section" class="section project-section">
|
93
|
+
<h3 class="section-header">Class/Module Index
|
94
|
+
<span class="search-toggle"><img src="../../images/find.png"
|
95
|
+
height="16" width="16" alt="[+]"
|
96
|
+
title="show/hide quicksearch" /></span></h3>
|
97
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
98
|
+
<fieldset>
|
99
|
+
<legend>Quicksearch</legend>
|
100
|
+
<input type="text" name="quicksearch" value=""
|
101
|
+
class="quicksearch-field" />
|
102
|
+
</fieldset>
|
103
|
+
</form>
|
104
|
+
|
105
|
+
<ul class="link-list">
|
106
|
+
|
107
|
+
<li><a href="../../StructuredWarnings.html">StructuredWarnings</a></li>
|
108
|
+
|
109
|
+
<li><a href="../../StructuredWarnings/ClassMethods.html">StructuredWarnings::ClassMethods</a></li>
|
110
|
+
|
111
|
+
<li><a href="../../StructuredWarnings/Kernel.html">StructuredWarnings::Kernel</a></li>
|
112
|
+
|
113
|
+
<li><a href="../../StructuredWarnings/Test.html">StructuredWarnings::Test</a></li>
|
114
|
+
|
115
|
+
<li><a href="../../StructuredWarnings/Test/Assertions.html">StructuredWarnings::Test::Assertions</a></li>
|
116
|
+
|
117
|
+
<li><a href="../../StructuredWarnings/Test/Warner.html">StructuredWarnings::Test::Warner</a></li>
|
118
|
+
|
119
|
+
<li><a href="../../StructuredWarnings/Warner.html">StructuredWarnings::Warner</a></li>
|
120
|
+
|
121
|
+
<li><a href="../../Warning.html">Warning</a></li>
|
122
|
+
|
123
|
+
<li><a href="../../Warning/ClassMethods.html">Warning::ClassMethods</a></li>
|
124
|
+
|
125
|
+
<li><a href="../../DeprecatedMethodWarning.html">DeprecatedMethodWarning</a></li>
|
126
|
+
|
127
|
+
<li><a href="../../DeprecatedSignatureWarning.html">DeprecatedSignatureWarning</a></li>
|
128
|
+
|
129
|
+
<li><a href="../../DeprecationWarning.html">DeprecationWarning</a></li>
|
130
|
+
|
131
|
+
<li><a href="../../Dynamic.html">Dynamic</a></li>
|
132
|
+
|
133
|
+
<li><a href="../../Object.html">Object</a></li>
|
134
|
+
|
135
|
+
<li><a href="../../StandardWarning.html">StandardWarning</a></li>
|
136
|
+
|
137
|
+
</ul>
|
138
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
139
|
+
</div>
|
140
|
+
|
141
|
+
|
142
|
+
</div>
|
143
|
+
</div>
|
144
|
+
|
145
|
+
<div id="documentation">
|
146
|
+
<h1 class="class">StructuredWarnings::Test::Warner</h1>
|
147
|
+
|
148
|
+
<div id="description" class="description">
|
149
|
+
|
150
|
+
<p>This warner is used in <a
|
151
|
+
href="Assertions.html#method-i-assert_warn">Assertions#assert_warn</a> and
|
152
|
+
<a
|
153
|
+
href="Assertions.html#method-i-assert_no_warn">Assertions#assert_no_warn</a>
|
154
|
+
blocks. It captures all warnings in format and provides access to them
|
155
|
+
using the warned? method.</p>
|
156
|
+
|
157
|
+
</div><!-- description -->
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
<div id="5Buntitled-5D" class="documentation-section">
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
<!-- Methods -->
|
172
|
+
|
173
|
+
<div id="public-instance-method-details" class="method-section section">
|
174
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
175
|
+
|
176
|
+
|
177
|
+
<div id="format-method" class="method-detail ">
|
178
|
+
<a name="method-i-format"></a>
|
179
|
+
|
180
|
+
|
181
|
+
<div class="method-heading">
|
182
|
+
<span class="method-name">format</span><span
|
183
|
+
class="method-args">(warning, message, call_stack)</span>
|
184
|
+
<span class="method-click-advice">click to toggle source</span>
|
185
|
+
</div>
|
186
|
+
|
187
|
+
|
188
|
+
<div class="method-description">
|
189
|
+
|
190
|
+
<p>Overrides the public interface of <a
|
191
|
+
href="../Warner.html">StructuredWarnings::Warner</a>. This method always
|
192
|
+
returns nil to avoid warnings on stdout during assert_warn and
|
193
|
+
assert_no_warn blocks.</p>
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
<div class="method-source-code" id="format-source">
|
198
|
+
<pre>
|
199
|
+
<span class="ruby-comment"># File lib/structured_warnings/test/warner.rb, line 10</span>
|
200
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">format</span>(<span class="ruby-identifier">warning</span>, <span class="ruby-identifier">message</span>, <span class="ruby-identifier">call_stack</span>)
|
201
|
+
<span class="ruby-identifier">given_warnings</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">warning</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">message</span>)
|
202
|
+
<span class="ruby-keyword">nil</span>
|
203
|
+
<span class="ruby-keyword">end</span></pre>
|
204
|
+
</div><!-- format-source -->
|
205
|
+
|
206
|
+
</div>
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
</div><!-- format-method -->
|
212
|
+
|
213
|
+
|
214
|
+
<div id="warned-3F-method" class="method-detail ">
|
215
|
+
<a name="method-i-warned-3F"></a>
|
216
|
+
|
217
|
+
|
218
|
+
<div class="method-heading">
|
219
|
+
<span class="method-name">warned?</span><span
|
220
|
+
class="method-args">(warning, message = nil)</span>
|
221
|
+
<span class="method-click-advice">click to toggle source</span>
|
222
|
+
</div>
|
223
|
+
|
224
|
+
|
225
|
+
<div class="method-description">
|
226
|
+
|
227
|
+
<p>Returns true if any warning or a subclass of warning was emitted.</p>
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
<div class="method-source-code" id="warned-3F-source">
|
232
|
+
<pre>
|
233
|
+
<span class="ruby-comment"># File lib/structured_warnings/test/warner.rb, line 16</span>
|
234
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">warned?</span>(<span class="ruby-identifier">warning</span>, <span class="ruby-identifier">message</span> = <span class="ruby-keyword">nil</span>)
|
235
|
+
<span class="ruby-keyword">case</span> <span class="ruby-identifier">message</span>
|
236
|
+
<span class="ruby-keyword">when</span> <span class="ruby-constant">Regexp</span>
|
237
|
+
<span class="ruby-identifier">given_warnings</span>.<span class="ruby-identifier">any?</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">w</span><span class="ruby-operator">|</span> <span class="ruby-identifier">w</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-identifier">warning</span>) <span class="ruby-operator">&&</span> <span class="ruby-identifier">w</span>.<span class="ruby-identifier">message</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">message</span>}
|
238
|
+
<span class="ruby-keyword">when</span> <span class="ruby-constant">String</span>
|
239
|
+
<span class="ruby-identifier">given_warnings</span>.<span class="ruby-identifier">any?</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">w</span><span class="ruby-operator">|</span> <span class="ruby-identifier">w</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-identifier">warning</span>) <span class="ruby-operator">&&</span> <span class="ruby-identifier">w</span>.<span class="ruby-identifier">message</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">message</span>}
|
240
|
+
<span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>
|
241
|
+
<span class="ruby-identifier">given_warnings</span>.<span class="ruby-identifier">any?</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">w</span><span class="ruby-operator">|</span> <span class="ruby-identifier">w</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-identifier">warning</span>)}
|
242
|
+
<span class="ruby-keyword">else</span>
|
243
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-string">"Unkown argument for 'message'"</span>
|
244
|
+
<span class="ruby-keyword">end</span>
|
245
|
+
<span class="ruby-keyword">end</span></pre>
|
246
|
+
</div><!-- warned-3F-source -->
|
247
|
+
|
248
|
+
</div>
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
</div><!-- warned-3F-method -->
|
254
|
+
|
255
|
+
|
256
|
+
</div><!-- public-instance-method-details -->
|
257
|
+
|
258
|
+
</div><!-- 5Buntitled-5D -->
|
259
|
+
|
260
|
+
|
261
|
+
</div><!-- documentation -->
|
262
|
+
|
263
|
+
<div id="validator-badges">
|
264
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
265
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
266
|
+
Rdoc Generator</a> 2</small>.</p>
|
267
|
+
</div>
|
268
|
+
|
269
|
+
</body>
|
270
|
+
</html>
|
271
|
+
|
@@ -0,0 +1,226 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
7
|
+
|
8
|
+
<title>Class: StructuredWarnings::Warner</title>
|
9
|
+
|
10
|
+
<link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
|
11
|
+
|
12
|
+
<script src="../js/jquery.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
<script src="../js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
|
14
|
+
<script src="../js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
|
15
|
+
<script src="../js/darkfish.js" type="text/javascript" charset="utf-8"></script>
|
16
|
+
|
17
|
+
</head>
|
18
|
+
<body id="top" class="class">
|
19
|
+
|
20
|
+
<div id="metadata">
|
21
|
+
<div id="home-metadata">
|
22
|
+
<div id="home-section" class="section">
|
23
|
+
<h3 class="section-header">
|
24
|
+
<a href="../index.html">Home</a>
|
25
|
+
<a href="../index.html#classes">Classes</a>
|
26
|
+
<a href="../index.html#methods">Methods</a>
|
27
|
+
</h3>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
|
31
|
+
<div id="file-metadata">
|
32
|
+
<div id="file-list-section" class="section">
|
33
|
+
<h3 class="section-header">In Files</h3>
|
34
|
+
<div class="section-body">
|
35
|
+
<ul>
|
36
|
+
|
37
|
+
<li><a href="../lib/structured_warnings/warner_rb.html?TB_iframe=true&height=550&width=785"
|
38
|
+
class="thickbox" title="lib/structured_warnings/warner.rb">lib/structured_warnings/warner.rb</a></li>
|
39
|
+
|
40
|
+
</ul>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<div id="class-metadata">
|
48
|
+
|
49
|
+
<!-- Parent Class -->
|
50
|
+
<div id="parent-class-section" class="section">
|
51
|
+
<h3 class="section-header">Parent</h3>
|
52
|
+
|
53
|
+
<p class="link"><a href="../Object.html">Object</a></p>
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
<!-- Method Quickref -->
|
64
|
+
<div id="method-list-section" class="section">
|
65
|
+
<h3 class="section-header">Methods</h3>
|
66
|
+
<ul class="link-list">
|
67
|
+
|
68
|
+
<li><a href="#method-i-format">#format</a></li>
|
69
|
+
|
70
|
+
</ul>
|
71
|
+
</div>
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
</div>
|
76
|
+
|
77
|
+
<div id="project-metadata">
|
78
|
+
|
79
|
+
|
80
|
+
<div id="fileindex-section" class="section project-section">
|
81
|
+
<h3 class="section-header">Files</h3>
|
82
|
+
<ul>
|
83
|
+
|
84
|
+
<li class="file"><a href="../README_rdoc.html">README.rdoc</a></li>
|
85
|
+
|
86
|
+
</ul>
|
87
|
+
</div>
|
88
|
+
|
89
|
+
|
90
|
+
<div id="classindex-section" class="section project-section">
|
91
|
+
<h3 class="section-header">Class/Module Index
|
92
|
+
<span class="search-toggle"><img src="../images/find.png"
|
93
|
+
height="16" width="16" alt="[+]"
|
94
|
+
title="show/hide quicksearch" /></span></h3>
|
95
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
96
|
+
<fieldset>
|
97
|
+
<legend>Quicksearch</legend>
|
98
|
+
<input type="text" name="quicksearch" value=""
|
99
|
+
class="quicksearch-field" />
|
100
|
+
</fieldset>
|
101
|
+
</form>
|
102
|
+
|
103
|
+
<ul class="link-list">
|
104
|
+
|
105
|
+
<li><a href="../StructuredWarnings.html">StructuredWarnings</a></li>
|
106
|
+
|
107
|
+
<li><a href="../StructuredWarnings/ClassMethods.html">StructuredWarnings::ClassMethods</a></li>
|
108
|
+
|
109
|
+
<li><a href="../StructuredWarnings/Kernel.html">StructuredWarnings::Kernel</a></li>
|
110
|
+
|
111
|
+
<li><a href="../StructuredWarnings/Test.html">StructuredWarnings::Test</a></li>
|
112
|
+
|
113
|
+
<li><a href="../StructuredWarnings/Test/Assertions.html">StructuredWarnings::Test::Assertions</a></li>
|
114
|
+
|
115
|
+
<li><a href="../StructuredWarnings/Test/Warner.html">StructuredWarnings::Test::Warner</a></li>
|
116
|
+
|
117
|
+
<li><a href="../StructuredWarnings/Warner.html">StructuredWarnings::Warner</a></li>
|
118
|
+
|
119
|
+
<li><a href="../Warning.html">Warning</a></li>
|
120
|
+
|
121
|
+
<li><a href="../Warning/ClassMethods.html">Warning::ClassMethods</a></li>
|
122
|
+
|
123
|
+
<li><a href="../DeprecatedMethodWarning.html">DeprecatedMethodWarning</a></li>
|
124
|
+
|
125
|
+
<li><a href="../DeprecatedSignatureWarning.html">DeprecatedSignatureWarning</a></li>
|
126
|
+
|
127
|
+
<li><a href="../DeprecationWarning.html">DeprecationWarning</a></li>
|
128
|
+
|
129
|
+
<li><a href="../Dynamic.html">Dynamic</a></li>
|
130
|
+
|
131
|
+
<li><a href="../Object.html">Object</a></li>
|
132
|
+
|
133
|
+
<li><a href="../StandardWarning.html">StandardWarning</a></li>
|
134
|
+
|
135
|
+
</ul>
|
136
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
137
|
+
</div>
|
138
|
+
|
139
|
+
|
140
|
+
</div>
|
141
|
+
</div>
|
142
|
+
|
143
|
+
<div id="documentation">
|
144
|
+
<h1 class="class">StructuredWarnings::Warner</h1>
|
145
|
+
|
146
|
+
<div id="description" class="description">
|
147
|
+
|
148
|
+
<p>The <a href="Warner.html">Warner</a> class implements a very simple
|
149
|
+
interface. It simply formats a warning, so it is more than just the message
|
150
|
+
itself. This default warner uses a format comparable to warnings emitted by
|
151
|
+
rb_warn including the place where the “thing that caused the warning”
|
152
|
+
resides.</p>
|
153
|
+
|
154
|
+
</div><!-- description -->
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
<div id="5Buntitled-5D" class="documentation-section">
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
<!-- Methods -->
|
169
|
+
|
170
|
+
<div id="public-instance-method-details" class="method-section section">
|
171
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
172
|
+
|
173
|
+
|
174
|
+
<div id="format-method" class="method-detail ">
|
175
|
+
<a name="method-i-format"></a>
|
176
|
+
|
177
|
+
|
178
|
+
<div class="method-heading">
|
179
|
+
<span class="method-name">format</span><span
|
180
|
+
class="method-args">(warning, message, stack)</span>
|
181
|
+
<span class="method-click-advice">click to toggle source</span>
|
182
|
+
</div>
|
183
|
+
|
184
|
+
|
185
|
+
<div class="method-description">
|
186
|
+
|
187
|
+
<p>Warner.new.format(<a
|
188
|
+
href="../DeprecationWarning.html">DeprecationWarning</a>, “more info..”,
|
189
|
+
caller)</p>
|
190
|
+
|
191
|
+
<pre># => "demo.rb:5 : more info.. (DeprecationWarning)"</pre>
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
<div class="method-source-code" id="format-source">
|
196
|
+
<pre>
|
197
|
+
<span class="ruby-comment"># File lib/structured_warnings/warner.rb, line 9</span>
|
198
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">format</span>(<span class="ruby-identifier">warning</span>, <span class="ruby-identifier">message</span>, <span class="ruby-identifier">stack</span>)
|
199
|
+
<span class="ruby-node">"#{stack.shift} : #{message} (#{warning})"</span>
|
200
|
+
<span class="ruby-keyword">end</span></pre>
|
201
|
+
</div><!-- format-source -->
|
202
|
+
|
203
|
+
</div>
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
</div><!-- format-method -->
|
209
|
+
|
210
|
+
|
211
|
+
</div><!-- public-instance-method-details -->
|
212
|
+
|
213
|
+
</div><!-- 5Buntitled-5D -->
|
214
|
+
|
215
|
+
|
216
|
+
</div><!-- documentation -->
|
217
|
+
|
218
|
+
<div id="validator-badges">
|
219
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
220
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
221
|
+
Rdoc Generator</a> 2</small>.</p>
|
222
|
+
</div>
|
223
|
+
|
224
|
+
</body>
|
225
|
+
</html>
|
226
|
+
|