structured_warnings 0.1.4 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +21 -0
- data/History.txt +7 -0
- data/README.rdoc +5 -5
- data/doc/DeprecatedMethodWarning.html +76 -141
- data/doc/DeprecatedSignatureWarning.html +76 -141
- data/doc/DeprecationWarning.html +76 -141
- data/doc/Dynamic.html +89 -136
- data/doc/Object.html +92 -161
- data/doc/README_rdoc.html +144 -157
- data/doc/StandardWarning.html +76 -141
- data/doc/StructuredWarnings.html +95 -157
- data/doc/StructuredWarnings/ClassMethods.html +131 -193
- data/doc/StructuredWarnings/Kernel.html +146 -198
- data/doc/StructuredWarnings/Test.html +71 -150
- data/doc/StructuredWarnings/Test/Assertions.html +194 -244
- data/doc/StructuredWarnings/Test/Warner.html +138 -201
- data/doc/StructuredWarnings/Warner.html +113 -177
- data/doc/Test.html +95 -0
- data/doc/Test/Unit.html +95 -0
- data/doc/Warning.html +276 -338
- data/doc/Warning/ClassMethods.html +182 -238
- data/doc/created.rid +10 -10
- data/doc/css/fonts.css +167 -0
- data/doc/css/rdoc.css +590 -0
- data/doc/fonts/Lato-Light.ttf +0 -0
- data/doc/fonts/Lato-LightItalic.ttf +0 -0
- data/doc/fonts/Lato-Regular.ttf +0 -0
- data/doc/fonts/Lato-RegularItalic.ttf +0 -0
- data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/index.html +104 -103
- data/doc/js/darkfish.js +112 -67
- data/doc/js/jquery.js +4 -32
- data/doc/js/navigation.js +142 -0
- data/doc/js/navigation.js.gz +0 -0
- data/doc/js/search.js +109 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/searcher.js +228 -0
- data/doc/js/searcher.js.gz +0 -0
- data/doc/table_of_contents.html +200 -0
- data/lib/structured_warnings/dynamic.rb +12 -6
- data/lib/structured_warnings/kernel.rb +4 -4
- data/structured_warnings.gemspec +5 -1
- data/test/structured_warnings_test.rb +63 -9
- metadata +84 -43
- data/doc/js/quicksearch.js +0 -114
- data/doc/js/thickbox-compressed.js +0 -10
- data/doc/lib/structured_warnings/dynamic_rb.html +0 -65
- data/doc/lib/structured_warnings/kernel_rb.html +0 -52
- data/doc/lib/structured_warnings/test/assertions_rb.html +0 -52
- data/doc/lib/structured_warnings/test/warner_rb.html +0 -52
- data/doc/lib/structured_warnings/test_rb.html +0 -56
- data/doc/lib/structured_warnings/warner_rb.html +0 -52
- data/doc/lib/structured_warnings/warning_rb.html +0 -64
- data/doc/lib/structured_warnings_rb.html +0 -62
- data/doc/rdoc.css +0 -763
|
@@ -1,254 +1,192 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
|
|
3
|
+
<html>
|
|
5
4
|
<head>
|
|
6
|
-
|
|
5
|
+
<meta charset="UTF-8">
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
<title>module StructuredWarnings::ClassMethods - structured_warnings</title>
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
<script type="text/javascript">
|
|
10
|
+
var rdoc_rel_prefix = "../";
|
|
11
|
+
</script>
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
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>
|
|
13
|
+
<script src="../js/jquery.js"></script>
|
|
14
|
+
<script src="../js/darkfish.js"></script>
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
<
|
|
16
|
+
<link href="../css/fonts.css" rel="stylesheet">
|
|
17
|
+
<link href="../css/rdoc.css" rel="stylesheet">
|
|
19
18
|
|
|
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
19
|
|
|
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_rb.html?TB_iframe=true&height=550&width=785"
|
|
38
|
-
class="thickbox" title="lib/structured_warnings.rb">lib/structured_warnings.rb</a></li>
|
|
39
|
-
|
|
40
|
-
</ul>
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
20
|
|
|
44
|
-
|
|
45
|
-
|
|
21
|
+
<body id="top" role="document" class="module">
|
|
22
|
+
<nav role="navigation">
|
|
23
|
+
<div id="project-navigation">
|
|
24
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
|
25
|
+
<h2>
|
|
26
|
+
<a href="../index.html" rel="home">Home</a>
|
|
27
|
+
</h2>
|
|
46
28
|
|
|
47
|
-
|
|
48
|
-
|
|
29
|
+
<div id="table-of-contents-navigation">
|
|
30
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
|
31
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
|
32
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
|
37
|
+
<form action="#" method="get" accept-charset="utf-8">
|
|
38
|
+
<div id="search-field-wrapper">
|
|
39
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
|
40
|
+
aria-autocomplete="list" aria-controls="search-results"
|
|
41
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
|
42
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
|
43
|
+
</div>
|
|
49
44
|
|
|
50
|
-
|
|
45
|
+
<ul id="search-results" aria-label="Search Results"
|
|
46
|
+
aria-busy="false" aria-expanded="false"
|
|
47
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
|
48
|
+
</form>
|
|
49
|
+
</div>
|
|
51
50
|
|
|
52
|
-
|
|
51
|
+
</div>
|
|
53
52
|
|
|
54
|
-
|
|
55
|
-
<!-- Method Quickref -->
|
|
56
|
-
<div id="method-list-section" class="section">
|
|
57
|
-
<h3 class="section-header">Methods</h3>
|
|
58
|
-
<ul class="link-list">
|
|
59
|
-
|
|
60
|
-
<li><a href="#method-i-warner">#warner</a></li>
|
|
61
|
-
|
|
62
|
-
<li><a href="#method-i-with_warner">#with_warner</a></li>
|
|
63
|
-
|
|
64
|
-
</ul>
|
|
65
|
-
</div>
|
|
66
|
-
|
|
53
|
+
|
|
67
54
|
|
|
68
|
-
|
|
69
|
-
|
|
55
|
+
<div id="class-metadata">
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
<!-- Method Quickref -->
|
|
61
|
+
<div id="method-list-section" class="nav-section">
|
|
62
|
+
<h3>Methods</h3>
|
|
70
63
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
</ul>
|
|
81
|
-
</div>
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
<div id="classindex-section" class="section project-section">
|
|
85
|
-
<h3 class="section-header">Class/Module Index
|
|
86
|
-
<span class="search-toggle"><img src="../images/find.png"
|
|
87
|
-
height="16" width="16" alt="[+]"
|
|
88
|
-
title="show/hide quicksearch" /></span></h3>
|
|
89
|
-
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
|
90
|
-
<fieldset>
|
|
91
|
-
<legend>Quicksearch</legend>
|
|
92
|
-
<input type="text" name="quicksearch" value=""
|
|
93
|
-
class="quicksearch-field" />
|
|
94
|
-
</fieldset>
|
|
95
|
-
</form>
|
|
96
|
-
|
|
97
|
-
<ul class="link-list">
|
|
98
|
-
|
|
99
|
-
<li><a href="../StructuredWarnings.html">StructuredWarnings</a></li>
|
|
100
|
-
|
|
101
|
-
<li><a href="../StructuredWarnings/ClassMethods.html">StructuredWarnings::ClassMethods</a></li>
|
|
102
|
-
|
|
103
|
-
<li><a href="../StructuredWarnings/Kernel.html">StructuredWarnings::Kernel</a></li>
|
|
104
|
-
|
|
105
|
-
<li><a href="../StructuredWarnings/Test.html">StructuredWarnings::Test</a></li>
|
|
106
|
-
|
|
107
|
-
<li><a href="../StructuredWarnings/Test/Assertions.html">StructuredWarnings::Test::Assertions</a></li>
|
|
108
|
-
|
|
109
|
-
<li><a href="../StructuredWarnings/Test/Warner.html">StructuredWarnings::Test::Warner</a></li>
|
|
110
|
-
|
|
111
|
-
<li><a href="../StructuredWarnings/Warner.html">StructuredWarnings::Warner</a></li>
|
|
112
|
-
|
|
113
|
-
<li><a href="../Warning.html">Warning</a></li>
|
|
114
|
-
|
|
115
|
-
<li><a href="../Warning/ClassMethods.html">Warning::ClassMethods</a></li>
|
|
116
|
-
|
|
117
|
-
<li><a href="../DeprecatedMethodWarning.html">DeprecatedMethodWarning</a></li>
|
|
118
|
-
|
|
119
|
-
<li><a href="../DeprecatedSignatureWarning.html">DeprecatedSignatureWarning</a></li>
|
|
120
|
-
|
|
121
|
-
<li><a href="../DeprecationWarning.html">DeprecationWarning</a></li>
|
|
122
|
-
|
|
123
|
-
<li><a href="../Dynamic.html">Dynamic</a></li>
|
|
124
|
-
|
|
125
|
-
<li><a href="../Object.html">Object</a></li>
|
|
126
|
-
|
|
127
|
-
<li><a href="../StandardWarning.html">StandardWarning</a></li>
|
|
128
|
-
|
|
129
|
-
</ul>
|
|
130
|
-
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
|
131
|
-
</div>
|
|
64
|
+
<ul class="link-list" role="directory">
|
|
65
|
+
|
|
66
|
+
<li ><a href="#method-i-warner">#warner</a>
|
|
67
|
+
|
|
68
|
+
<li ><a href="#method-i-with_warner">#with_warner</a>
|
|
69
|
+
|
|
70
|
+
</ul>
|
|
71
|
+
</div>
|
|
132
72
|
|
|
133
|
-
|
|
134
|
-
</div>
|
|
135
73
|
</div>
|
|
74
|
+
</nav>
|
|
136
75
|
|
|
137
|
-
|
|
138
|
-
|
|
76
|
+
<main role="main" aria-labelledby="module-StructuredWarnings::ClassMethods">
|
|
77
|
+
<h1 id="module-StructuredWarnings::ClassMethods" class="module">
|
|
78
|
+
module StructuredWarnings::ClassMethods
|
|
79
|
+
</h1>
|
|
139
80
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
<p>If you <
|
|
143
|
-
<
|
|
144
|
-
"structured_warnings/test"</
|
|
81
|
+
<section class="description">
|
|
82
|
+
|
|
83
|
+
<p>If you <code>require "test/unit"</code> after
|
|
84
|
+
<code>structured_warnings</code> you have to <code>require
|
|
85
|
+
"structured_warnings/test"</code> manually, otherwise the test
|
|
145
86
|
extensions will be added automatically.</p>
|
|
146
87
|
|
|
147
|
-
|
|
88
|
+
</section>
|
|
148
89
|
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
|
149
94
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
<div id="5Buntitled-5D" class="documentation-section">
|
|
153
|
-
|
|
154
95
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
96
|
+
|
|
158
97
|
|
|
159
|
-
|
|
98
|
+
|
|
160
99
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
<div id="public-instance-method-details" class="method-section section">
|
|
164
|
-
<h3 class="section-header">Public Instance Methods</h3>
|
|
100
|
+
|
|
165
101
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
102
|
+
|
|
103
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
|
104
|
+
<header>
|
|
105
|
+
<h3>Public Instance Methods</h3>
|
|
106
|
+
</header>
|
|
169
107
|
|
|
108
|
+
|
|
109
|
+
<div id="method-i-warner" class="method-detail ">
|
|
110
|
+
|
|
111
|
+
<div class="method-heading">
|
|
112
|
+
<span class="method-name">warner</span><span
|
|
113
|
+
class="method-args">()</span>
|
|
170
114
|
|
|
171
|
-
<
|
|
172
|
-
<span class="method-name">warner</span><span
|
|
173
|
-
class="method-args">()</span>
|
|
174
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
175
|
-
</div>
|
|
115
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
176
116
|
|
|
117
|
+
</div>
|
|
118
|
+
|
|
177
119
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
120
|
+
<div class="method-description">
|
|
121
|
+
|
|
122
|
+
<p>Gives access to the currently used warner. Default is an instance of <a
|
|
181
123
|
href="Warner.html">StructuredWarnings::Warner</a></p>
|
|
182
|
-
|
|
124
|
+
|
|
125
|
+
|
|
183
126
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
<pre>
|
|
187
|
-
<span class="ruby-comment"># File lib/structured_warnings.rb, line 23</span>
|
|
127
|
+
|
|
128
|
+
<div class="method-source-code" id="warner-source">
|
|
129
|
+
<pre><span class="ruby-comment"># File lib/structured_warnings.rb, line 23</span>
|
|
188
130
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">warner</span>
|
|
189
131
|
<span class="ruby-constant">Dynamic</span>[<span class="ruby-value">:warner</span>]
|
|
190
132
|
<span class="ruby-keyword">end</span></pre>
|
|
191
|
-
</div><!-- warner-source -->
|
|
192
|
-
|
|
193
133
|
</div>
|
|
194
|
-
|
|
195
134
|
|
|
135
|
+
</div>
|
|
196
136
|
|
|
197
|
-
|
|
198
|
-
</div><!-- warner-method -->
|
|
137
|
+
|
|
199
138
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
<a name="method-i-with_warner"></a>
|
|
139
|
+
|
|
140
|
+
</div>
|
|
203
141
|
|
|
142
|
+
|
|
143
|
+
<div id="method-i-with_warner" class="method-detail ">
|
|
144
|
+
|
|
145
|
+
<div class="method-heading">
|
|
146
|
+
<span class="method-name">with_warner</span><span
|
|
147
|
+
class="method-args">(warner) { || ... }</span>
|
|
204
148
|
|
|
205
|
-
<
|
|
206
|
-
<span class="method-name">with_warner</span><span
|
|
207
|
-
class="method-args">(warner)</span>
|
|
208
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
209
|
-
</div>
|
|
149
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
210
150
|
|
|
151
|
+
</div>
|
|
152
|
+
|
|
211
153
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
154
|
+
<div class="method-description">
|
|
155
|
+
|
|
156
|
+
<p>Executes a block using the given warner. This may be used to suppress
|
|
215
157
|
warnings to stdout, but fetch them and redirect them to somewhere else.</p>
|
|
216
158
|
|
|
217
159
|
<p>This behaviour is used in the StructuredWarnings::Assertions</p>
|
|
218
|
-
|
|
160
|
+
|
|
161
|
+
|
|
219
162
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
<pre>
|
|
223
|
-
<span class="ruby-comment"># File lib/structured_warnings.rb, line 15</span>
|
|
163
|
+
|
|
164
|
+
<div class="method-source-code" id="with_warner-source">
|
|
165
|
+
<pre><span class="ruby-comment"># File lib/structured_warnings.rb, line 15</span>
|
|
224
166
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">with_warner</span>(<span class="ruby-identifier">warner</span>)
|
|
225
167
|
<span class="ruby-constant">Dynamic</span>.<span class="ruby-identifier">let</span>(<span class="ruby-value">:warner</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">warner</span>) <span class="ruby-keyword">do</span>
|
|
226
168
|
<span class="ruby-keyword">yield</span>
|
|
227
169
|
<span class="ruby-keyword">end</span>
|
|
228
170
|
<span class="ruby-keyword">end</span></pre>
|
|
229
|
-
</div><!-- with_warner-source -->
|
|
230
|
-
|
|
231
171
|
</div>
|
|
232
|
-
|
|
233
172
|
|
|
173
|
+
</div>
|
|
234
174
|
|
|
235
|
-
|
|
236
|
-
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
</div>
|
|
237
179
|
|
|
238
|
-
|
|
239
|
-
</div><!-- public-instance-method-details -->
|
|
240
180
|
|
|
241
|
-
</
|
|
181
|
+
</section>
|
|
242
182
|
|
|
183
|
+
</section>
|
|
184
|
+
</main>
|
|
243
185
|
|
|
244
|
-
</div><!-- documentation -->
|
|
245
|
-
|
|
246
|
-
<div id="validator-badges">
|
|
247
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
248
|
-
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
|
249
|
-
Rdoc Generator</a> 2</small>.</p>
|
|
250
|
-
</div>
|
|
251
186
|
|
|
252
|
-
|
|
253
|
-
</
|
|
187
|
+
<footer id="validator-badges" role="contentinfo">
|
|
188
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
|
189
|
+
<p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.0.
|
|
190
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
|
191
|
+
</footer>
|
|
254
192
|
|
|
@@ -1,192 +1,138 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
|
|
3
|
+
<html>
|
|
5
4
|
<head>
|
|
6
|
-
|
|
5
|
+
<meta charset="UTF-8">
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
<title>module StructuredWarnings::Kernel - structured_warnings</title>
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
<script type="text/javascript">
|
|
10
|
+
var rdoc_rel_prefix = "../";
|
|
11
|
+
</script>
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
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>
|
|
13
|
+
<script src="../js/jquery.js"></script>
|
|
14
|
+
<script src="../js/darkfish.js"></script>
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
<
|
|
16
|
+
<link href="../css/fonts.css" rel="stylesheet">
|
|
17
|
+
<link href="../css/rdoc.css" rel="stylesheet">
|
|
19
18
|
|
|
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
19
|
|
|
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/kernel_rb.html?TB_iframe=true&height=550&width=785"
|
|
38
|
-
class="thickbox" title="lib/structured_warnings/kernel.rb">lib/structured_warnings/kernel.rb</a></li>
|
|
39
|
-
|
|
40
|
-
</ul>
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
20
|
|
|
44
|
-
|
|
45
|
-
|
|
21
|
+
<body id="top" role="document" class="module">
|
|
22
|
+
<nav role="navigation">
|
|
23
|
+
<div id="project-navigation">
|
|
24
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
|
25
|
+
<h2>
|
|
26
|
+
<a href="../index.html" rel="home">Home</a>
|
|
27
|
+
</h2>
|
|
46
28
|
|
|
47
|
-
|
|
48
|
-
|
|
29
|
+
<div id="table-of-contents-navigation">
|
|
30
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
|
31
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
|
32
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
|
37
|
+
<form action="#" method="get" accept-charset="utf-8">
|
|
38
|
+
<div id="search-field-wrapper">
|
|
39
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
|
40
|
+
aria-autocomplete="list" aria-controls="search-results"
|
|
41
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
|
42
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
|
43
|
+
</div>
|
|
49
44
|
|
|
50
|
-
|
|
45
|
+
<ul id="search-results" aria-label="Search Results"
|
|
46
|
+
aria-busy="false" aria-expanded="false"
|
|
47
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
|
48
|
+
</form>
|
|
49
|
+
</div>
|
|
51
50
|
|
|
52
|
-
|
|
51
|
+
</div>
|
|
53
52
|
|
|
54
|
-
|
|
55
|
-
<!-- Method Quickref -->
|
|
56
|
-
<div id="method-list-section" class="section">
|
|
57
|
-
<h3 class="section-header">Methods</h3>
|
|
58
|
-
<ul class="link-list">
|
|
59
|
-
|
|
60
|
-
<li><a href="#method-i-warn">#warn</a></li>
|
|
61
|
-
|
|
62
|
-
</ul>
|
|
63
|
-
</div>
|
|
64
|
-
|
|
53
|
+
|
|
65
54
|
|
|
66
|
-
|
|
67
|
-
|
|
55
|
+
<div id="class-metadata">
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
<!-- Method Quickref -->
|
|
61
|
+
<div id="method-list-section" class="nav-section">
|
|
62
|
+
<h3>Methods</h3>
|
|
68
63
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
<li class="file"><a href="../README_rdoc.html">README.rdoc</a></li>
|
|
77
|
-
|
|
78
|
-
</ul>
|
|
79
|
-
</div>
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
<div id="classindex-section" class="section project-section">
|
|
83
|
-
<h3 class="section-header">Class/Module Index
|
|
84
|
-
<span class="search-toggle"><img src="../images/find.png"
|
|
85
|
-
height="16" width="16" alt="[+]"
|
|
86
|
-
title="show/hide quicksearch" /></span></h3>
|
|
87
|
-
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
|
88
|
-
<fieldset>
|
|
89
|
-
<legend>Quicksearch</legend>
|
|
90
|
-
<input type="text" name="quicksearch" value=""
|
|
91
|
-
class="quicksearch-field" />
|
|
92
|
-
</fieldset>
|
|
93
|
-
</form>
|
|
94
|
-
|
|
95
|
-
<ul class="link-list">
|
|
96
|
-
|
|
97
|
-
<li><a href="../StructuredWarnings.html">StructuredWarnings</a></li>
|
|
98
|
-
|
|
99
|
-
<li><a href="../StructuredWarnings/ClassMethods.html">StructuredWarnings::ClassMethods</a></li>
|
|
100
|
-
|
|
101
|
-
<li><a href="../StructuredWarnings/Kernel.html">StructuredWarnings::Kernel</a></li>
|
|
102
|
-
|
|
103
|
-
<li><a href="../StructuredWarnings/Test.html">StructuredWarnings::Test</a></li>
|
|
104
|
-
|
|
105
|
-
<li><a href="../StructuredWarnings/Test/Assertions.html">StructuredWarnings::Test::Assertions</a></li>
|
|
106
|
-
|
|
107
|
-
<li><a href="../StructuredWarnings/Test/Warner.html">StructuredWarnings::Test::Warner</a></li>
|
|
108
|
-
|
|
109
|
-
<li><a href="../StructuredWarnings/Warner.html">StructuredWarnings::Warner</a></li>
|
|
110
|
-
|
|
111
|
-
<li><a href="../Warning.html">Warning</a></li>
|
|
112
|
-
|
|
113
|
-
<li><a href="../Warning/ClassMethods.html">Warning::ClassMethods</a></li>
|
|
114
|
-
|
|
115
|
-
<li><a href="../DeprecatedMethodWarning.html">DeprecatedMethodWarning</a></li>
|
|
116
|
-
|
|
117
|
-
<li><a href="../DeprecatedSignatureWarning.html">DeprecatedSignatureWarning</a></li>
|
|
118
|
-
|
|
119
|
-
<li><a href="../DeprecationWarning.html">DeprecationWarning</a></li>
|
|
120
|
-
|
|
121
|
-
<li><a href="../Dynamic.html">Dynamic</a></li>
|
|
122
|
-
|
|
123
|
-
<li><a href="../Object.html">Object</a></li>
|
|
124
|
-
|
|
125
|
-
<li><a href="../StandardWarning.html">StandardWarning</a></li>
|
|
126
|
-
|
|
127
|
-
</ul>
|
|
128
|
-
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
|
129
|
-
</div>
|
|
64
|
+
<ul class="link-list" role="directory">
|
|
65
|
+
|
|
66
|
+
<li class="calls-super" ><a href="#method-i-warn">#warn</a>
|
|
67
|
+
|
|
68
|
+
</ul>
|
|
69
|
+
</div>
|
|
130
70
|
|
|
131
|
-
|
|
132
|
-
</div>
|
|
133
71
|
</div>
|
|
72
|
+
</nav>
|
|
134
73
|
|
|
135
|
-
|
|
136
|
-
|
|
74
|
+
<main role="main" aria-labelledby="module-StructuredWarnings::Kernel">
|
|
75
|
+
<h1 id="module-StructuredWarnings::Kernel" class="module">
|
|
76
|
+
module StructuredWarnings::Kernel
|
|
77
|
+
</h1>
|
|
137
78
|
|
|
138
|
-
|
|
139
|
-
|
|
79
|
+
<section class="description">
|
|
80
|
+
|
|
140
81
|
<p>This module encapsulates the extensions to <a
|
|
141
82
|
href="../Object.html">Object</a>, that are introduced by this library.</p>
|
|
142
83
|
|
|
143
|
-
|
|
84
|
+
</section>
|
|
144
85
|
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
|
145
90
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
<div id="5Buntitled-5D" class="documentation-section">
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
91
|
|
|
153
|
-
|
|
92
|
+
|
|
154
93
|
|
|
155
|
-
|
|
94
|
+
|
|
156
95
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
<div id="public-instance-method-details" class="method-section section">
|
|
160
|
-
<h3 class="section-header">Public Instance Methods</h3>
|
|
96
|
+
|
|
161
97
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
98
|
+
|
|
99
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
|
100
|
+
<header>
|
|
101
|
+
<h3>Public Instance Methods</h3>
|
|
102
|
+
</header>
|
|
165
103
|
|
|
104
|
+
|
|
105
|
+
<div id="method-i-warn" class="method-detail ">
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
<div class="method-heading">
|
|
109
|
+
<span class="method-callseq">
|
|
110
|
+
warn(message = nil)
|
|
111
|
+
</span>
|
|
166
112
|
|
|
113
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
167
114
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
</
|
|
174
|
-
|
|
175
|
-
<div class="method-heading">
|
|
176
|
-
<span class="method-callseq">warn(warning_class, message)</span>
|
|
177
|
-
|
|
178
|
-
</div>
|
|
179
|
-
|
|
180
|
-
<div class="method-heading">
|
|
181
|
-
<span class="method-callseq">warn(warning_instance)</span>
|
|
182
|
-
|
|
183
|
-
</div>
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
<div class="method-heading">
|
|
118
|
+
<span class="method-callseq">
|
|
119
|
+
warn(warning_class, message)
|
|
120
|
+
</span>
|
|
184
121
|
|
|
122
|
+
</div>
|
|
123
|
+
|
|
124
|
+
<div class="method-heading">
|
|
125
|
+
<span class="method-callseq">
|
|
126
|
+
warn(warning_instance)
|
|
127
|
+
</span>
|
|
185
128
|
|
|
129
|
+
</div>
|
|
130
|
+
|
|
131
|
+
|
|
186
132
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
133
|
+
<div class="method-description">
|
|
134
|
+
|
|
135
|
+
<p>This method provides a <code>raise</code>-like interface. It extends the
|
|
190
136
|
default warn in ::Kernel to allow the use of structured warnings.</p>
|
|
191
137
|
|
|
192
138
|
<p>Internally it uses the StructuredWarnings::warner to format a message based
|
|
@@ -201,27 +147,33 @@ need to redefine ::Kernel#warn.</p>
|
|
|
201
147
|
|
|
202
148
|
<p>Just like the original version, this method does not take command line
|
|
203
149
|
switches or verbosity levels into account. In order to deactivate all
|
|
204
|
-
warnings use <
|
|
205
|
-
|
|
206
|
-
<pre>warn
|
|
207
|
-
|
|
208
|
-
class Foo
|
|
209
|
-
def bar
|
|
210
|
-
warn DeprecationWarning
|
|
211
|
-
end
|
|
212
|
-
def beer
|
|
213
|
-
|
|
214
|
-
end
|
|
215
|
-
end
|
|
216
|
-
|
|
217
|
-
warn Warning
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
<div class="method-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
150
|
+
warnings use <code>Warning.disable</code>.</p>
|
|
151
|
+
|
|
152
|
+
<pre class="ruby"><span class="ruby-identifier">warn</span> <span class="ruby-string">"This is an old-style warning"</span> <span class="ruby-comment"># This will emit a StandardWarning</span>
|
|
153
|
+
|
|
154
|
+
<span class="ruby-keyword">class</span> <span class="ruby-constant">Foo</span>
|
|
155
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">bar</span>
|
|
156
|
+
<span class="ruby-identifier">warn</span> <span class="ruby-constant">DeprecationWarning</span>, <span class="ruby-string">"Never use bar again, use beer"</span>
|
|
157
|
+
<span class="ruby-keyword">end</span>
|
|
158
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">beer</span>
|
|
159
|
+
<span class="ruby-string">"Ahhh"</span>
|
|
160
|
+
<span class="ruby-keyword">end</span>
|
|
161
|
+
<span class="ruby-keyword">end</span>
|
|
162
|
+
|
|
163
|
+
<span class="ruby-identifier">warn</span> <span class="ruby-constant">Warning</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">"The least specific warning you can get"</span>)
|
|
164
|
+
</pre>
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
<div class="method-calls-super">
|
|
168
|
+
Calls superclass method
|
|
169
|
+
|
|
170
|
+
</div>
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
<div class="method-source-code" id="warn-source">
|
|
175
|
+
<pre><span class="ruby-comment"># File lib/structured_warnings/kernel.rb, line 41</span>
|
|
176
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">warn</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
|
225
177
|
<span class="ruby-identifier">first</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span>
|
|
226
178
|
<span class="ruby-keyword">if</span> <span class="ruby-identifier">first</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Class</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">first</span> <span class="ruby-operator"><=</span> <span class="ruby-constant">Warning</span>
|
|
227
179
|
<span class="ruby-identifier">warning</span> = <span class="ruby-identifier">first</span>
|
|
@@ -236,39 +188,35 @@ warn Warning.new("The least specific warning you can get")</pre>
|
|
|
236
188
|
<span class="ruby-identifier">message</span> = <span class="ruby-identifier">first</span>.<span class="ruby-identifier">to_s</span>
|
|
237
189
|
<span class="ruby-keyword">end</span>
|
|
238
190
|
|
|
239
|
-
<span class="ruby-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
<span class="ruby-keyword">
|
|
191
|
+
<span class="ruby-comment"># If args is not empty, user passed an incompatible set of arguments.</span>
|
|
192
|
+
<span class="ruby-comment"># Maybe somebody else is overriding warn as well and knows, what to do.</span>
|
|
193
|
+
<span class="ruby-comment"># Better do nothing in this case. See #5</span>
|
|
194
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">super</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">empty?</span>
|
|
243
195
|
|
|
244
196
|
<span class="ruby-keyword">if</span> <span class="ruby-identifier">warning</span>.<span class="ruby-identifier">active?</span>
|
|
245
197
|
<span class="ruby-identifier">output</span> = <span class="ruby-constant">StructuredWarnings</span>.<span class="ruby-identifier">warner</span>.<span class="ruby-identifier">format</span>(<span class="ruby-identifier">warning</span>, <span class="ruby-identifier">message</span>, <span class="ruby-identifier">caller</span>(<span class="ruby-value">1</span>))
|
|
246
198
|
<span class="ruby-keyword">super</span>(<span class="ruby-identifier">output</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">output</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">output</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">empty?</span>
|
|
247
199
|
<span class="ruby-keyword">end</span>
|
|
248
200
|
<span class="ruby-keyword">end</span></pre>
|
|
249
|
-
</div><!-- warn-source -->
|
|
250
|
-
|
|
251
201
|
</div>
|
|
252
|
-
|
|
253
202
|
|
|
203
|
+
</div>
|
|
254
204
|
|
|
255
|
-
|
|
256
|
-
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
</div>
|
|
257
209
|
|
|
258
|
-
|
|
259
|
-
</div><!-- public-instance-method-details -->
|
|
260
210
|
|
|
261
|
-
</
|
|
211
|
+
</section>
|
|
262
212
|
|
|
213
|
+
</section>
|
|
214
|
+
</main>
|
|
263
215
|
|
|
264
|
-
</div><!-- documentation -->
|
|
265
|
-
|
|
266
|
-
<div id="validator-badges">
|
|
267
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
268
|
-
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
|
269
|
-
Rdoc Generator</a> 2</small>.</p>
|
|
270
|
-
</div>
|
|
271
216
|
|
|
272
|
-
|
|
273
|
-
</
|
|
217
|
+
<footer id="validator-badges" role="contentinfo">
|
|
218
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
|
219
|
+
<p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.0.
|
|
220
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
|
221
|
+
</footer>
|
|
274
222
|
|