structured_warnings 0.1.3 → 0.1.4
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.
- 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,187 @@
|
|
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>Module: StructuredWarnings</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="module">
|
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_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
|
+
<li><a href="./lib/structured_warnings/kernel_rb.html?TB_iframe=true&height=550&width=785"
|
41
|
+
class="thickbox" title="lib/structured_warnings/kernel.rb">lib/structured_warnings/kernel.rb</a></li>
|
42
|
+
|
43
|
+
<li><a href="./lib/structured_warnings/test/assertions_rb.html?TB_iframe=true&height=550&width=785"
|
44
|
+
class="thickbox" title="lib/structured_warnings/test/assertions.rb">lib/structured_warnings/test/assertions.rb</a></li>
|
45
|
+
|
46
|
+
<li><a href="./lib/structured_warnings/test/warner_rb.html?TB_iframe=true&height=550&width=785"
|
47
|
+
class="thickbox" title="lib/structured_warnings/test/warner.rb">lib/structured_warnings/test/warner.rb</a></li>
|
48
|
+
|
49
|
+
<li><a href="./lib/structured_warnings/warner_rb.html?TB_iframe=true&height=550&width=785"
|
50
|
+
class="thickbox" title="lib/structured_warnings/warner.rb">lib/structured_warnings/warner.rb</a></li>
|
51
|
+
|
52
|
+
</ul>
|
53
|
+
</div>
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
</div>
|
58
|
+
|
59
|
+
<div id="class-metadata">
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
<!-- Namespace Contents -->
|
66
|
+
<div id="namespace-list-section" class="section">
|
67
|
+
<h3 class="section-header">Namespace</h3>
|
68
|
+
<ul class="link-list">
|
69
|
+
|
70
|
+
<li><span class="type">MODULE</span> <a href="StructuredWarnings/ClassMethods.html">StructuredWarnings::ClassMethods</a></li>
|
71
|
+
|
72
|
+
<li><span class="type">MODULE</span> <a href="StructuredWarnings/Kernel.html">StructuredWarnings::Kernel</a></li>
|
73
|
+
|
74
|
+
<li><span class="type">MODULE</span> <a href="StructuredWarnings/Test.html">StructuredWarnings::Test</a></li>
|
75
|
+
|
76
|
+
<li><span class="type">CLASS</span> <a href="StructuredWarnings/Warner.html">StructuredWarnings::Warner</a></li>
|
77
|
+
|
78
|
+
</ul>
|
79
|
+
</div>
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
</div>
|
86
|
+
|
87
|
+
<div id="project-metadata">
|
88
|
+
|
89
|
+
|
90
|
+
<div id="fileindex-section" class="section project-section">
|
91
|
+
<h3 class="section-header">Files</h3>
|
92
|
+
<ul>
|
93
|
+
|
94
|
+
<li class="file"><a href="./README_rdoc.html">README.rdoc</a></li>
|
95
|
+
|
96
|
+
</ul>
|
97
|
+
</div>
|
98
|
+
|
99
|
+
|
100
|
+
<div id="classindex-section" class="section project-section">
|
101
|
+
<h3 class="section-header">Class/Module Index
|
102
|
+
<span class="search-toggle"><img src="./images/find.png"
|
103
|
+
height="16" width="16" alt="[+]"
|
104
|
+
title="show/hide quicksearch" /></span></h3>
|
105
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
106
|
+
<fieldset>
|
107
|
+
<legend>Quicksearch</legend>
|
108
|
+
<input type="text" name="quicksearch" value=""
|
109
|
+
class="quicksearch-field" />
|
110
|
+
</fieldset>
|
111
|
+
</form>
|
112
|
+
|
113
|
+
<ul class="link-list">
|
114
|
+
|
115
|
+
<li><a href="./StructuredWarnings.html">StructuredWarnings</a></li>
|
116
|
+
|
117
|
+
<li><a href="./StructuredWarnings/ClassMethods.html">StructuredWarnings::ClassMethods</a></li>
|
118
|
+
|
119
|
+
<li><a href="./StructuredWarnings/Kernel.html">StructuredWarnings::Kernel</a></li>
|
120
|
+
|
121
|
+
<li><a href="./StructuredWarnings/Test.html">StructuredWarnings::Test</a></li>
|
122
|
+
|
123
|
+
<li><a href="./StructuredWarnings/Test/Assertions.html">StructuredWarnings::Test::Assertions</a></li>
|
124
|
+
|
125
|
+
<li><a href="./StructuredWarnings/Test/Warner.html">StructuredWarnings::Test::Warner</a></li>
|
126
|
+
|
127
|
+
<li><a href="./StructuredWarnings/Warner.html">StructuredWarnings::Warner</a></li>
|
128
|
+
|
129
|
+
<li><a href="./Warning.html">Warning</a></li>
|
130
|
+
|
131
|
+
<li><a href="./Warning/ClassMethods.html">Warning::ClassMethods</a></li>
|
132
|
+
|
133
|
+
<li><a href="./DeprecatedMethodWarning.html">DeprecatedMethodWarning</a></li>
|
134
|
+
|
135
|
+
<li><a href="./DeprecatedSignatureWarning.html">DeprecatedSignatureWarning</a></li>
|
136
|
+
|
137
|
+
<li><a href="./DeprecationWarning.html">DeprecationWarning</a></li>
|
138
|
+
|
139
|
+
<li><a href="./Dynamic.html">Dynamic</a></li>
|
140
|
+
|
141
|
+
<li><a href="./Object.html">Object</a></li>
|
142
|
+
|
143
|
+
<li><a href="./StandardWarning.html">StandardWarning</a></li>
|
144
|
+
|
145
|
+
</ul>
|
146
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
147
|
+
</div>
|
148
|
+
|
149
|
+
|
150
|
+
</div>
|
151
|
+
</div>
|
152
|
+
|
153
|
+
<div id="documentation">
|
154
|
+
<h1 class="module">StructuredWarnings</h1>
|
155
|
+
|
156
|
+
<div id="description" class="description">
|
157
|
+
|
158
|
+
</div><!-- description -->
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
<div id="5Buntitled-5D" class="documentation-section">
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
<!-- Methods -->
|
173
|
+
|
174
|
+
</div><!-- 5Buntitled-5D -->
|
175
|
+
|
176
|
+
|
177
|
+
</div><!-- documentation -->
|
178
|
+
|
179
|
+
<div id="validator-badges">
|
180
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
181
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
182
|
+
Rdoc Generator</a> 2</small>.</p>
|
183
|
+
</div>
|
184
|
+
|
185
|
+
</body>
|
186
|
+
</html>
|
187
|
+
|
@@ -0,0 +1,254 @@
|
|
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>Module: StructuredWarnings::ClassMethods</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="module">
|
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_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
|
+
|
44
|
+
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<div id="class-metadata">
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
|
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
|
+
|
67
|
+
|
68
|
+
|
69
|
+
</div>
|
70
|
+
|
71
|
+
<div id="project-metadata">
|
72
|
+
|
73
|
+
|
74
|
+
<div id="fileindex-section" class="section project-section">
|
75
|
+
<h3 class="section-header">Files</h3>
|
76
|
+
<ul>
|
77
|
+
|
78
|
+
<li class="file"><a href="../README_rdoc.html">README.rdoc</a></li>
|
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>
|
132
|
+
|
133
|
+
|
134
|
+
</div>
|
135
|
+
</div>
|
136
|
+
|
137
|
+
<div id="documentation">
|
138
|
+
<h1 class="module">StructuredWarnings::ClassMethods</h1>
|
139
|
+
|
140
|
+
<div id="description" class="description">
|
141
|
+
|
142
|
+
<p>If you <tt>require "test/unit"</tt> after
|
143
|
+
<tt>structured_warnings</tt> you have to <tt>require
|
144
|
+
"structured_warnings/test"</tt> manually, otherwise the test
|
145
|
+
extensions will be added automatically.</p>
|
146
|
+
|
147
|
+
</div><!-- description -->
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
<div id="5Buntitled-5D" class="documentation-section">
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
<!-- Methods -->
|
162
|
+
|
163
|
+
<div id="public-instance-method-details" class="method-section section">
|
164
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
165
|
+
|
166
|
+
|
167
|
+
<div id="warner-method" class="method-detail ">
|
168
|
+
<a name="method-i-warner"></a>
|
169
|
+
|
170
|
+
|
171
|
+
<div class="method-heading">
|
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>
|
176
|
+
|
177
|
+
|
178
|
+
<div class="method-description">
|
179
|
+
|
180
|
+
<p>Gives access to the currently used warner. Default is an instance of <a
|
181
|
+
href="Warner.html">StructuredWarnings::Warner</a></p>
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
<div class="method-source-code" id="warner-source">
|
186
|
+
<pre>
|
187
|
+
<span class="ruby-comment"># File lib/structured_warnings.rb, line 23</span>
|
188
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">warner</span>
|
189
|
+
<span class="ruby-constant">Dynamic</span>[<span class="ruby-value">:warner</span>]
|
190
|
+
<span class="ruby-keyword">end</span></pre>
|
191
|
+
</div><!-- warner-source -->
|
192
|
+
|
193
|
+
</div>
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
</div><!-- warner-method -->
|
199
|
+
|
200
|
+
|
201
|
+
<div id="with_warner-method" class="method-detail ">
|
202
|
+
<a name="method-i-with_warner"></a>
|
203
|
+
|
204
|
+
|
205
|
+
<div class="method-heading">
|
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>
|
210
|
+
|
211
|
+
|
212
|
+
<div class="method-description">
|
213
|
+
|
214
|
+
<p>Executes a block using the given warner. This may be used to suppress
|
215
|
+
warnings to stdout, but fetch them and redirect them to somewhere else.</p>
|
216
|
+
|
217
|
+
<p>This behaviour is used in the StructuredWarnings::Assertions</p>
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
<div class="method-source-code" id="with_warner-source">
|
222
|
+
<pre>
|
223
|
+
<span class="ruby-comment"># File lib/structured_warnings.rb, line 15</span>
|
224
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">with_warner</span>(<span class="ruby-identifier">warner</span>)
|
225
|
+
<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
|
+
<span class="ruby-keyword">yield</span>
|
227
|
+
<span class="ruby-keyword">end</span>
|
228
|
+
<span class="ruby-keyword">end</span></pre>
|
229
|
+
</div><!-- with_warner-source -->
|
230
|
+
|
231
|
+
</div>
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
</div><!-- with_warner-method -->
|
237
|
+
|
238
|
+
|
239
|
+
</div><!-- public-instance-method-details -->
|
240
|
+
|
241
|
+
</div><!-- 5Buntitled-5D -->
|
242
|
+
|
243
|
+
|
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
|
+
|
252
|
+
</body>
|
253
|
+
</html>
|
254
|
+
|
@@ -0,0 +1,274 @@
|
|
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>Module: StructuredWarnings::Kernel</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="module">
|
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/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
|
+
|
44
|
+
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<div id="class-metadata">
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
|
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
|
+
|
65
|
+
|
66
|
+
|
67
|
+
</div>
|
68
|
+
|
69
|
+
<div id="project-metadata">
|
70
|
+
|
71
|
+
|
72
|
+
<div id="fileindex-section" class="section project-section">
|
73
|
+
<h3 class="section-header">Files</h3>
|
74
|
+
<ul>
|
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>
|
130
|
+
|
131
|
+
|
132
|
+
</div>
|
133
|
+
</div>
|
134
|
+
|
135
|
+
<div id="documentation">
|
136
|
+
<h1 class="module">StructuredWarnings::Kernel</h1>
|
137
|
+
|
138
|
+
<div id="description" class="description">
|
139
|
+
|
140
|
+
<p>This module encapsulates the extensions to <a
|
141
|
+
href="../Object.html">Object</a>, that are introduced by this library.</p>
|
142
|
+
|
143
|
+
</div><!-- description -->
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
<div id="5Buntitled-5D" class="documentation-section">
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
<!-- Methods -->
|
158
|
+
|
159
|
+
<div id="public-instance-method-details" class="method-section section">
|
160
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
161
|
+
|
162
|
+
|
163
|
+
<div id="warn-method" class="method-detail ">
|
164
|
+
<a name="method-i-warn"></a>
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
<div class="method-heading">
|
169
|
+
<span class="method-callseq">warn(message = nil)</span>
|
170
|
+
|
171
|
+
<span class="method-click-advice">click to toggle source</span>
|
172
|
+
|
173
|
+
</div>
|
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>
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
<div class="method-description">
|
188
|
+
|
189
|
+
<p>This method provides a <tt>raise</tt>-like interface. It extends the
|
190
|
+
default warn in ::Kernel to allow the use of structured warnings.</p>
|
191
|
+
|
192
|
+
<p>Internally it uses the StructuredWarnings::warner to format a message based
|
193
|
+
on the given warning class, the message and a stack frame. The return value
|
194
|
+
is passed to super, which is likely the implementation in ::Kernel. That
|
195
|
+
way, it is less likely, that structured_warnings interferes with other
|
196
|
+
extensions.</p>
|
197
|
+
|
198
|
+
<p>It the warner return nil or an empty string the underlying warn will not be
|
199
|
+
called. That way, warnings may be transferred to other devices without the
|
200
|
+
need to redefine ::Kernel#warn.</p>
|
201
|
+
|
202
|
+
<p>Just like the original version, this method does not take command line
|
203
|
+
switches or verbosity levels into account. In order to deactivate all
|
204
|
+
warnings use <tt>Warning.disable</tt>.</p>
|
205
|
+
|
206
|
+
<pre>warn "This is an old-style warning" # This will emit a StandardWarning
|
207
|
+
|
208
|
+
class Foo
|
209
|
+
def bar
|
210
|
+
warn DeprecationWarning, "Never use bar again, use beer"
|
211
|
+
end
|
212
|
+
def beer
|
213
|
+
"Ahhh"
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
warn Warning.new("The least specific warning you can get")</pre>
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
<div class="method-source-code" id="warn-source">
|
222
|
+
<pre>
|
223
|
+
<span class="ruby-comment"># File lib/structured_warnings/kernel.rb, line 41</span>
|
224
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">warn</span>(*<span class="ruby-identifier">args</span>)
|
225
|
+
<span class="ruby-identifier">first</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span>
|
226
|
+
<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
|
+
<span class="ruby-identifier">warning</span> = <span class="ruby-identifier">first</span>
|
228
|
+
<span class="ruby-identifier">message</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span>
|
229
|
+
|
230
|
+
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">first</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Warning</span>
|
231
|
+
<span class="ruby-identifier">warning</span> = <span class="ruby-identifier">first</span>.<span class="ruby-identifier">class</span>
|
232
|
+
<span class="ruby-identifier">message</span> = <span class="ruby-identifier">first</span>.<span class="ruby-identifier">message</span>
|
233
|
+
|
234
|
+
<span class="ruby-keyword">else</span>
|
235
|
+
<span class="ruby-identifier">warning</span> = <span class="ruby-constant">StandardWarning</span>
|
236
|
+
<span class="ruby-identifier">message</span> = <span class="ruby-identifier">first</span>.<span class="ruby-identifier">to_s</span>
|
237
|
+
<span class="ruby-keyword">end</span>
|
238
|
+
|
239
|
+
<span class="ruby-keyword">unless</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">empty?</span>
|
240
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>,
|
241
|
+
<span class="ruby-node">"wrong number of arguments (#{args.size + 2} for 2)"</span>
|
242
|
+
<span class="ruby-keyword">end</span>
|
243
|
+
|
244
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">warning</span>.<span class="ruby-identifier">active?</span>
|
245
|
+
<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
|
+
<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
|
+
<span class="ruby-keyword">end</span>
|
248
|
+
<span class="ruby-keyword">end</span></pre>
|
249
|
+
</div><!-- warn-source -->
|
250
|
+
|
251
|
+
</div>
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
</div><!-- warn-method -->
|
257
|
+
|
258
|
+
|
259
|
+
</div><!-- public-instance-method-details -->
|
260
|
+
|
261
|
+
</div><!-- 5Buntitled-5D -->
|
262
|
+
|
263
|
+
|
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
|
+
|
272
|
+
</body>
|
273
|
+
</html>
|
274
|
+
|