structured_warnings 0.1.4 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- 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
data/doc/Object.html
CHANGED
@@ -1,186 +1,117 @@
|
|
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>class Object - 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
|
-
<li><a href="./lib/structured_warnings/test_rb.html?TB_iframe=true&height=550&width=785"
|
41
|
-
class="thickbox" title="lib/structured_warnings/test.rb">lib/structured_warnings/test.rb</a></li>
|
42
|
-
|
43
|
-
</ul>
|
44
|
-
</div>
|
45
|
-
</div>
|
46
|
-
|
47
|
-
|
48
|
-
</div>
|
49
20
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
</div>
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
<!-- Included Modules -->
|
69
|
-
<div id="includes-section" class="section">
|
70
|
-
<h3 class="section-header">Included Modules</h3>
|
71
|
-
<ul class="link-list">
|
72
|
-
|
73
|
-
|
74
|
-
<li><a class="include" href="StructuredWarnings/Kernel.html">StructuredWarnings::Kernel</a></li>
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
<li><a class="include" href="StructuredWarnings/Test/Assertions.html">StructuredWarnings::Test::Assertions</a></li>
|
79
|
-
|
80
|
-
|
81
|
-
</ul>
|
82
|
-
</div>
|
83
|
-
|
84
|
-
</div>
|
21
|
+
<body id="top" role="document" class="class">
|
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>
|
85
28
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
<h3 class="section-header">Class/Module Index
|
101
|
-
<span class="search-toggle"><img src="./images/find.png"
|
102
|
-
height="16" width="16" alt="[+]"
|
103
|
-
title="show/hide quicksearch" /></span></h3>
|
104
|
-
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
105
|
-
<fieldset>
|
106
|
-
<legend>Quicksearch</legend>
|
107
|
-
<input type="text" name="quicksearch" value=""
|
108
|
-
class="quicksearch-field" />
|
109
|
-
</fieldset>
|
110
|
-
</form>
|
111
|
-
|
112
|
-
<ul class="link-list">
|
113
|
-
|
114
|
-
<li><a href="./StructuredWarnings.html">StructuredWarnings</a></li>
|
115
|
-
|
116
|
-
<li><a href="./StructuredWarnings/ClassMethods.html">StructuredWarnings::ClassMethods</a></li>
|
117
|
-
|
118
|
-
<li><a href="./StructuredWarnings/Kernel.html">StructuredWarnings::Kernel</a></li>
|
119
|
-
|
120
|
-
<li><a href="./StructuredWarnings/Test.html">StructuredWarnings::Test</a></li>
|
121
|
-
|
122
|
-
<li><a href="./StructuredWarnings/Test/Assertions.html">StructuredWarnings::Test::Assertions</a></li>
|
123
|
-
|
124
|
-
<li><a href="./StructuredWarnings/Test/Warner.html">StructuredWarnings::Test::Warner</a></li>
|
125
|
-
|
126
|
-
<li><a href="./StructuredWarnings/Warner.html">StructuredWarnings::Warner</a></li>
|
127
|
-
|
128
|
-
<li><a href="./Warning.html">Warning</a></li>
|
129
|
-
|
130
|
-
<li><a href="./Warning/ClassMethods.html">Warning::ClassMethods</a></li>
|
131
|
-
|
132
|
-
<li><a href="./DeprecatedMethodWarning.html">DeprecatedMethodWarning</a></li>
|
133
|
-
|
134
|
-
<li><a href="./DeprecatedSignatureWarning.html">DeprecatedSignatureWarning</a></li>
|
135
|
-
|
136
|
-
<li><a href="./DeprecationWarning.html">DeprecationWarning</a></li>
|
137
|
-
|
138
|
-
<li><a href="./Dynamic.html">Dynamic</a></li>
|
139
|
-
|
140
|
-
<li><a href="./Object.html">Object</a></li>
|
141
|
-
|
142
|
-
<li><a href="./StandardWarning.html">StandardWarning</a></li>
|
143
|
-
|
144
|
-
</ul>
|
145
|
-
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
146
|
-
</div>
|
147
|
-
|
148
|
-
|
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">
|
149
43
|
</div>
|
44
|
+
|
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>
|
50
|
+
|
150
51
|
</div>
|
151
52
|
|
152
|
-
|
153
|
-
<h1 class="class">Object</h1>
|
53
|
+
|
154
54
|
|
155
|
-
|
156
|
-
|
157
|
-
|
55
|
+
<div id="class-metadata">
|
56
|
+
|
57
|
+
<div id="parent-class-section" class="nav-section">
|
58
|
+
<h3>Parent</h3>
|
59
|
+
|
60
|
+
|
61
|
+
<p class="link">BasicObject
|
62
|
+
|
63
|
+
</div>
|
64
|
+
|
65
|
+
<div id="includes-section" class="nav-section">
|
66
|
+
<h3>Included Modules</h3>
|
67
|
+
|
68
|
+
<ul class="link-list">
|
69
|
+
|
70
|
+
|
71
|
+
<li><a class="include" href="StructuredWarnings/Kernel.html">StructuredWarnings::Kernel</a>
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
<li><a class="include" href="StructuredWarnings/Test/Assertions.html">StructuredWarnings::Test::Assertions</a>
|
76
|
+
|
77
|
+
|
78
|
+
</ul>
|
79
|
+
</div>
|
158
80
|
|
159
81
|
|
160
82
|
|
83
|
+
</div>
|
84
|
+
</nav>
|
85
|
+
|
86
|
+
<main role="main" aria-labelledby="class-Object">
|
87
|
+
<h1 id="class-Object" class="class">
|
88
|
+
class Object
|
89
|
+
</h1>
|
90
|
+
|
91
|
+
<section class="description">
|
161
92
|
|
162
|
-
|
163
|
-
|
93
|
+
</section>
|
164
94
|
|
165
|
-
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
99
|
+
|
166
100
|
|
167
|
-
|
101
|
+
|
168
102
|
|
169
|
-
|
103
|
+
|
170
104
|
|
171
|
-
|
172
|
-
|
173
|
-
</div><!-- 5Buntitled-5D -->
|
174
|
-
|
105
|
+
|
175
106
|
|
176
|
-
|
107
|
+
|
108
|
+
</section>
|
109
|
+
</main>
|
177
110
|
|
178
|
-
<div id="validator-badges">
|
179
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
180
|
-
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
181
|
-
Rdoc Generator</a> 2</small>.</p>
|
182
|
-
</div>
|
183
111
|
|
184
|
-
|
185
|
-
</
|
112
|
+
<footer id="validator-badges" role="contentinfo">
|
113
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
114
|
+
<p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.0.
|
115
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
116
|
+
</footer>
|
186
117
|
|
data/doc/README_rdoc.html
CHANGED
@@ -1,166 +1,151 @@
|
|
1
|
-
|
2
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
1
|
+
<!DOCTYPE html>
|
4
2
|
|
5
|
-
<html
|
3
|
+
<html>
|
6
4
|
<head>
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
charset="utf-8"></script>
|
21
|
-
</head>
|
22
|
-
|
23
|
-
<body class="file">
|
24
|
-
<div id="metadata">
|
25
|
-
<div id="home-metadata">
|
26
|
-
<div id="home-section" class="section">
|
27
|
-
<h3 class="section-header">
|
28
|
-
<a href="./index.html">Home</a>
|
29
|
-
<a href="./index.html#classes">Classes</a>
|
30
|
-
<a href="./index.html#methods">Methods</a>
|
31
|
-
</h3>
|
32
|
-
</div>
|
33
|
-
</div>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>README - structured_warnings</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "./";
|
11
|
+
</script>
|
12
|
+
|
13
|
+
<script src="./js/jquery.js"></script>
|
14
|
+
<script src="./js/darkfish.js"></script>
|
15
|
+
|
16
|
+
<link href="./css/fonts.css" rel="stylesheet">
|
17
|
+
<link href="./css/rdoc.css" rel="stylesheet">
|
34
18
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
</form>
|
60
|
-
|
61
|
-
<ul class="link-list">
|
62
|
-
|
63
|
-
<li><a href="./StructuredWarnings.html">StructuredWarnings</a></li>
|
64
|
-
|
65
|
-
<li><a href="./StructuredWarnings/ClassMethods.html">StructuredWarnings::ClassMethods</a></li>
|
66
|
-
|
67
|
-
<li><a href="./StructuredWarnings/Kernel.html">StructuredWarnings::Kernel</a></li>
|
68
|
-
|
69
|
-
<li><a href="./StructuredWarnings/Test.html">StructuredWarnings::Test</a></li>
|
70
|
-
|
71
|
-
<li><a href="./StructuredWarnings/Test/Assertions.html">StructuredWarnings::Test::Assertions</a></li>
|
72
|
-
|
73
|
-
<li><a href="./StructuredWarnings/Test/Warner.html">StructuredWarnings::Test::Warner</a></li>
|
74
|
-
|
75
|
-
<li><a href="./StructuredWarnings/Warner.html">StructuredWarnings::Warner</a></li>
|
76
|
-
|
77
|
-
<li><a href="./Warning.html">Warning</a></li>
|
78
|
-
|
79
|
-
<li><a href="./Warning/ClassMethods.html">Warning::ClassMethods</a></li>
|
80
|
-
|
81
|
-
<li><a href="./DeprecatedMethodWarning.html">DeprecatedMethodWarning</a></li>
|
82
|
-
|
83
|
-
<li><a href="./DeprecatedSignatureWarning.html">DeprecatedSignatureWarning</a></li>
|
84
|
-
|
85
|
-
<li><a href="./DeprecationWarning.html">DeprecationWarning</a></li>
|
86
|
-
|
87
|
-
<li><a href="./Dynamic.html">Dynamic</a></li>
|
88
|
-
|
89
|
-
<li><a href="./Object.html">Object</a></li>
|
90
|
-
|
91
|
-
<li><a href="./StandardWarning.html">StandardWarning</a></li>
|
92
|
-
|
93
|
-
</ul>
|
94
|
-
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
95
|
-
</div>
|
96
|
-
|
97
|
-
|
19
|
+
|
20
|
+
|
21
|
+
<body id="top" role="document" class="file">
|
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>
|
28
|
+
|
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">
|
98
43
|
</div>
|
44
|
+
|
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>
|
50
|
+
|
51
|
+
</div>
|
52
|
+
|
53
|
+
|
54
|
+
<div class="nav-section">
|
55
|
+
<h3>Table of Contents</h3>
|
56
|
+
|
57
|
+
<ul class="link-list" role="directory">
|
58
|
+
<li><a href="#label-Structured+Warnings">Structured Warnings</a>
|
59
|
+
<li><a href="#label-Installation+-26+Compatibility">Installation & Compatibility</a>
|
60
|
+
<li><a href="#label-Example+Usage">Example Usage</a>
|
61
|
+
<li><a href="#label-Detailed+Documentation">Detailed Documentation</a>
|
62
|
+
<li><a href="#label-Resources">Resources</a>
|
63
|
+
<li><a href="#label-How+to+submit+patches">How to submit patches</a>
|
64
|
+
<li><a href="#label-Known+Issues">Known Issues</a>
|
65
|
+
<li><a href="#label-License">License</a>
|
66
|
+
</ul>
|
67
|
+
</div>
|
68
|
+
|
69
|
+
|
70
|
+
<div id="project-metadata">
|
71
|
+
<div id="fileindex-section" class="nav-section">
|
72
|
+
<h3>Pages</h3>
|
73
|
+
|
74
|
+
<ul class="link-list">
|
75
|
+
|
76
|
+
<li><a href="./README_rdoc.html">README</a>
|
77
|
+
|
78
|
+
</ul>
|
79
|
+
</div>
|
80
|
+
|
99
81
|
</div>
|
82
|
+
</nav>
|
100
83
|
|
101
|
-
|
102
|
-
|
103
|
-
<h1>Structured Warnings</h1>
|
84
|
+
<main role="main" aria-label="Page README.rdoc">
|
104
85
|
|
105
|
-
<
|
86
|
+
<h1 id="label-Structured+Warnings">Structured Warnings<span><a href="#label-Structured+Warnings">¶</a> <a href="#top">↑</a></span></h1>
|
87
|
+
|
88
|
+
<p>This is an implementation of Daniel Berger's <a
|
106
89
|
href="http://www.oreillynet.com/ruby/blog/2008/02/structured_warnings_now.html">proposal
|
107
90
|
of structured warnings for Ruby</a>. They provide dynamic suppression and
|
108
91
|
activation, as well as, an inheritance hierarchy to model their relations.
|
109
|
-
This library preserves the old <
|
110
|
-
allows a <
|
92
|
+
This library preserves the old <code>warn</code> signature, but
|
93
|
+
additionally allows a <code>raise</code>-like use.</p>
|
111
94
|
|
112
95
|
<p>For more information on the usage and benefits of this library have a look
|
113
|
-
at the inspiring article at O
|
96
|
+
at the inspiring article at O'Reilly.</p>
|
114
97
|
|
115
98
|
<p><a
|
116
99
|
href="http://www.oreillynet.com/ruby/blog/2008/02/structured_warnings_now.html">www.oreillynet.com/ruby/blog/2008/02/structured_warnings_now.html</a></p>
|
117
100
|
|
118
|
-
<h2>Installation & Compatibility
|
101
|
+
<h2 id="label-Installation+-26+Compatibility">Installation & Compatibility<span><a href="#label-Installation+-26+Compatibility">¶</a> <a href="#top">↑</a></span></h2>
|
119
102
|
|
120
|
-
<pre>gem install structured_warnings</
|
103
|
+
<pre class="ruby"><span class="ruby-identifier">gem</span> <span class="ruby-identifier">install</span> <span class="ruby-identifier">structured_warnings</span>
|
104
|
+
</pre>
|
121
105
|
|
122
106
|
<p>structured_warnings works with all interpreters, it was tested with.</p>
|
123
107
|
<ul><li>
|
124
|
-
<p>Ruby 1.8.
|
108
|
+
<p>Ruby 1.8-2.2</p>
|
125
109
|
</li><li>
|
126
|
-
<p>
|
110
|
+
<p>Rubinius 2.4</p>
|
127
111
|
</li><li>
|
128
|
-
<p>JRuby 1.
|
112
|
+
<p>JRuby 1.7</p>
|
129
113
|
</li></ul>
|
130
114
|
|
131
115
|
<p>Please let me know, of any other compatibilities or file a bug for any
|
132
116
|
incompatibilities.</p>
|
133
117
|
|
134
|
-
<h2>Example Usage
|
118
|
+
<h2 id="label-Example+Usage">Example Usage<span><a href="#label-Example+Usage">¶</a> <a href="#top">↑</a></span></h2>
|
135
119
|
|
136
120
|
<p>To get you started - here is a short example</p>
|
137
121
|
|
138
122
|
<p>In order to use structured_warnings in library code, use the following
|
139
123
|
code.</p>
|
140
124
|
|
141
|
-
<pre># in lib
|
142
|
-
require
|
125
|
+
<pre class="ruby"><span class="ruby-comment"># in lib/...</span>
|
126
|
+
<span class="ruby-identifier">require</span> <span class="ruby-string">'structured_warnings'</span>
|
143
127
|
|
144
|
-
class Foo
|
145
|
-
def old_method
|
146
|
-
warn DeprecatedMethodWarning
|
147
|
-
|
148
|
-
end
|
149
|
-
end
|
128
|
+
<span class="ruby-keyword">class</span> <span class="ruby-constant">Foo</span>
|
129
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">old_method</span>
|
130
|
+
<span class="ruby-identifier">warn</span> <span class="ruby-constant">DeprecatedMethodWarning</span>, <span class="ruby-string">'This method is deprecated. Use new_method instead'</span>
|
131
|
+
<span class="ruby-comment"># Do stuff</span>
|
132
|
+
<span class="ruby-keyword">end</span>
|
133
|
+
<span class="ruby-keyword">end</span>
|
150
134
|
|
151
|
-
|
152
|
-
require
|
153
|
-
require
|
135
|
+
<span class="ruby-comment"># in test/...</span>
|
136
|
+
<span class="ruby-identifier">require</span> <span class="ruby-string">'test/unit'</span>
|
137
|
+
<span class="ruby-identifier">require</span> <span class="ruby-string">'structured_warnings'</span>
|
154
138
|
|
155
|
-
class FooTests
|
156
|
-
def setup
|
157
|
-
|
158
|
-
end
|
139
|
+
<span class="ruby-keyword">class</span> <span class="ruby-constant">FooTests</span> <span class="ruby-operator"><</span> <span class="ruby-constant">Test</span><span class="ruby-operator">::</span><span class="ruby-constant">Unit</span><span class="ruby-operator">::</span><span class="ruby-constant">TestCase</span>
|
140
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">setup</span>
|
141
|
+
<span class="ruby-ivar">@foo</span> = <span class="ruby-constant">Foo</span>.<span class="ruby-identifier">new</span>
|
142
|
+
<span class="ruby-keyword">end</span>
|
159
143
|
|
160
|
-
def test_old_method_emits_deprecation_warning
|
161
|
-
assert_warn(DeprecatedMethodWarning){
|
162
|
-
end
|
163
|
-
end</
|
144
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">test_old_method_emits_deprecation_warning</span>
|
145
|
+
<span class="ruby-identifier">assert_warn</span>(<span class="ruby-constant">DeprecatedMethodWarning</span>){ <span class="ruby-ivar">@foo</span>.<span class="ruby-identifier">old_method</span> }
|
146
|
+
<span class="ruby-keyword">end</span>
|
147
|
+
<span class="ruby-keyword">end</span>
|
148
|
+
</pre>
|
164
149
|
|
165
150
|
<p><a href="DeprecatedMethodWarning.html">DeprecatedMethodWarning</a> is only
|
166
151
|
one of multiple predefined warning types. You may add your own types by
|
@@ -168,36 +153,39 @@ subclassing <a href="Warning.html">Warning</a> if you like.</p>
|
|
168
153
|
|
169
154
|
<p>Client code of your library will look as follows:</p>
|
170
155
|
|
171
|
-
<pre>require
|
156
|
+
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">"foo"</span>
|
172
157
|
|
173
|
-
foo = Foo
|
174
|
-
foo
|
175
|
-
|
158
|
+
<span class="ruby-identifier">foo</span> = <span class="ruby-constant">Foo</span>.<span class="ruby-identifier">new</span>
|
159
|
+
<span class="ruby-identifier">foo</span>.<span class="ruby-identifier">old_method</span> <span class="ruby-comment"># => will print</span>
|
160
|
+
<span class="ruby-comment"># ... `old_method' : This method is deprecated. Use new_method instead (DeprecatedMethodWarning)</span>
|
161
|
+
</pre>
|
176
162
|
|
177
163
|
<p>But the main difference to the standard warning concept shipped with ruby,
|
178
164
|
is that the client is able to selectively disable certain warnings s/he is
|
179
165
|
aware of and not willing to fix.</p>
|
180
166
|
|
181
|
-
<pre>DeprecatedMethodWarning
|
167
|
+
<pre class="ruby"><span class="ruby-constant">DeprecatedMethodWarning</span>.<span class="ruby-identifier">disable</span> <span class="ruby-comment"># Globally disable warnings about deprecated methods!</span>
|
182
168
|
|
183
|
-
foo
|
169
|
+
<span class="ruby-identifier">foo</span>.<span class="ruby-identifier">old_method</span> <span class="ruby-comment"># => will print nothing</span>
|
184
170
|
|
185
|
-
DeprecatedMethodWarning
|
171
|
+
<span class="ruby-constant">DeprecatedMethodWarning</span>.<span class="ruby-identifier">enable</span> <span class="ruby-comment"># Reenable warnings again.</span>
|
172
|
+
</pre>
|
186
173
|
|
187
174
|
<p>And there is an even more powerful option for your clients, the can
|
188
175
|
selectively disable warnings in a dynamic block scope.</p>
|
189
176
|
|
190
|
-
<pre># Don
|
191
|
-
|
192
|
-
|
193
|
-
DeprecatedMethodWarning
|
194
|
-
foo
|
195
|
-
end</
|
177
|
+
<pre class="ruby"><span class="ruby-comment"># Don't bug me about deprecated method warnings within this block, I know</span>
|
178
|
+
<span class="ruby-comment"># what I'm doing.</span>
|
179
|
+
<span class="ruby-comment">#</span>
|
180
|
+
<span class="ruby-constant">DeprecatedMethodWarning</span>.<span class="ruby-identifier">disable</span> <span class="ruby-keyword">do</span>
|
181
|
+
<span class="ruby-identifier">foo</span>.<span class="ruby-identifier">old_method</span>
|
182
|
+
<span class="ruby-keyword">end</span>
|
183
|
+
</pre>
|
196
184
|
|
197
185
|
<p>These settings are scoped to the local thread (and all threads spawned in
|
198
186
|
the block scope) and automatically reset after the block.</p>
|
199
187
|
|
200
|
-
<h2>Detailed Documentation
|
188
|
+
<h2 id="label-Detailed+Documentation">Detailed Documentation<span><a href="#label-Detailed+Documentation">¶</a> <a href="#top">↑</a></span></h2>
|
201
189
|
|
202
190
|
<p>Have closer look at the RDoc of <a
|
203
191
|
href="StructuredWarnings/Kernel.html">StructuredWarnings::Kernel</a>, <a
|
@@ -223,7 +211,7 @@ href="Warning/ClassMethods.html">Warning::ClassMethods</a>.</p>
|
|
223
211
|
href="Warning.html">Warning</a> to give as much feedback to your users as
|
224
212
|
possible.</p>
|
225
213
|
|
226
|
-
<h2>Resources
|
214
|
+
<h2 id="label-Resources">Resources<span><a href="#label-Resources">¶</a> <a href="#top">↑</a></span></h2>
|
227
215
|
<ul><li>
|
228
216
|
<p><a
|
229
217
|
href="http://www.oreillynet.com/ruby/blog/2008/02/structured_warnings_now.html">Inspiring
|
@@ -233,7 +221,7 @@ article</a></p>
|
|
233
221
|
href="http://www.nach-vorne.de/2008/2/22/structured_warnings-highlights">Implementation
|
234
222
|
Highlights</a></p>
|
235
223
|
</li><li>
|
236
|
-
<p><a href="http://github.com/schmidt/structured_warnings/">Project
|
224
|
+
<p><a href="http://github.com/schmidt/structured_warnings/">Project’s
|
237
225
|
website</a></p>
|
238
226
|
</li><li>
|
239
227
|
<p><a href="http://rdoc.info/projects/schmidt/structured_warnings">API doc</a></p>
|
@@ -242,7 +230,7 @@ website</a></p>
|
|
242
230
|
RunCodeRun</a></p>
|
243
231
|
</li></ul>
|
244
232
|
|
245
|
-
<h2>How to submit patches
|
233
|
+
<h2 id="label-How+to+submit+patches">How to submit patches<span><a href="#label-How+to+submit+patches">¶</a> <a href="#top">↑</a></span></h2>
|
246
234
|
|
247
235
|
<p>In order to submit patches, please fork the repository on GitHub, add your
|
248
236
|
patches to your own copy and send a “Pull Request” afterwards. I will then
|
@@ -252,14 +240,14 @@ corresponding tests are always welcome.</p>
|
|
252
240
|
<p>Bug reports or general feature requests should be added using GitHub
|
253
241
|
Issues.</p>
|
254
242
|
|
255
|
-
<h2>Known Issues
|
243
|
+
<h2 id="label-Known+Issues">Known Issues<span><a href="#label-Known+Issues">¶</a> <a href="#top">↑</a></span></h2>
|
256
244
|
|
257
|
-
<p>Although the library transparently coorperates with Ruby
|
258
|
-
<
|
259
|
-
internally to emit “method redefined”, “void context”, and
|
260
|
-
warnings. They may not be manipulated by structured_warnings.</p>
|
245
|
+
<p>Although the library transparently coorperates with Ruby's built-in
|
246
|
+
<code>Kernel#warn</code>, it may not override <code>rb_warn</code> which is
|
247
|
+
used internally to emit “method redefined”, “void context”, and
|
248
|
+
“parenthesis” warnings. They may not be manipulated by structured_warnings.</p>
|
261
249
|
|
262
|
-
<h2>License
|
250
|
+
<h2 id="label-License">License<span><a href="#label-License">¶</a> <a href="#top">↑</a></span></h2>
|
263
251
|
|
264
252
|
<p>This code is free to use under the terms of the MIT license.</p>
|
265
253
|
|
@@ -283,14 +271,13 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
283
271
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
284
272
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
285
273
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</pre>
|
274
|
+
</main>
|
286
275
|
|
287
|
-
</div>
|
288
276
|
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
</
|
294
|
-
</
|
295
|
-
</html>
|
277
|
+
|
278
|
+
<footer id="validator-badges" role="contentinfo">
|
279
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
280
|
+
<p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.0.
|
281
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
282
|
+
</footer>
|
296
283
|
|