structured_warnings 0.2.0 → 0.3.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 +4 -4
- data/README.md +200 -0
- data/lib/{structured_warnings/dynamic.rb → dynamic.rb} +0 -0
- data/lib/structured_warnings.rb +19 -9
- data/lib/structured_warnings/base.rb +132 -0
- data/lib/structured_warnings/kernel.rb +5 -65
- data/lib/structured_warnings/minitest.rb +5 -0
- data/lib/structured_warnings/test.rb +3 -5
- data/lib/structured_warnings/test/assertions.rb +93 -98
- data/lib/structured_warnings/test/warner.rb +32 -35
- data/lib/structured_warnings/test_unit.rb +5 -0
- data/lib/structured_warnings/version.rb +3 -0
- data/lib/structured_warnings/warner.rb +13 -11
- data/lib/structured_warnings/warning.rb +61 -119
- data/lib/warning.rb +9 -0
- metadata +53 -92
- data/Gemfile +0 -3
- data/Gemfile.lock +0 -21
- data/History.txt +0 -36
- data/License.txt +0 -20
- data/README.rdoc +0 -137
- data/Rakefile +0 -55
- data/doc/DeprecatedMethodWarning.html +0 -105
- data/doc/DeprecatedSignatureWarning.html +0 -106
- data/doc/DeprecationWarning.html +0 -106
- data/doc/Dynamic.html +0 -125
- data/doc/Object.html +0 -117
- data/doc/README_rdoc.html +0 -283
- data/doc/StandardWarning.html +0 -104
- data/doc/StructuredWarnings.html +0 -125
- data/doc/StructuredWarnings/ClassMethods.html +0 -192
- data/doc/StructuredWarnings/Kernel.html +0 -222
- data/doc/StructuredWarnings/Test.html +0 -97
- data/doc/StructuredWarnings/Test/Assertions.html +0 -272
- data/doc/StructuredWarnings/Test/Warner.html +0 -208
- data/doc/StructuredWarnings/Warner.html +0 -162
- data/doc/Test.html +0 -95
- data/doc/Test/Unit.html +0 -95
- data/doc/Warning.html +0 -398
- data/doc/Warning/ClassMethods.html +0 -278
- data/doc/created.rid +0 -10
- data/doc/css/fonts.css +0 -167
- data/doc/css/rdoc.css +0 -590
- 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/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/delete.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_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.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 +0 -121
- data/doc/js/darkfish.js +0 -161
- data/doc/js/jquery.js +0 -4
- data/doc/js/navigation.js +0 -142
- data/doc/js/navigation.js.gz +0 -0
- data/doc/js/search.js +0 -109
- data/doc/js/search_index.js +0 -1
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/searcher.js +0 -228
- data/doc/js/searcher.js.gz +0 -0
- data/doc/table_of_contents.html +0 -200
- data/structured_warnings.gemspec +0 -24
- data/test/structured_warnings_test.rb +0 -187
@@ -1,162 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<meta charset="UTF-8">
|
6
|
-
|
7
|
-
<title>class StructuredWarnings::Warner - 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">
|
18
|
-
|
19
|
-
|
20
|
-
|
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>
|
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">
|
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
|
-
|
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"><a href="../Object.html">Object</a>
|
62
|
-
|
63
|
-
</div>
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
<!-- Method Quickref -->
|
68
|
-
<div id="method-list-section" class="nav-section">
|
69
|
-
<h3>Methods</h3>
|
70
|
-
|
71
|
-
<ul class="link-list" role="directory">
|
72
|
-
|
73
|
-
<li ><a href="#method-i-format">#format</a>
|
74
|
-
|
75
|
-
</ul>
|
76
|
-
</div>
|
77
|
-
|
78
|
-
</div>
|
79
|
-
</nav>
|
80
|
-
|
81
|
-
<main role="main" aria-labelledby="class-StructuredWarnings::Warner">
|
82
|
-
<h1 id="class-StructuredWarnings::Warner" class="class">
|
83
|
-
class StructuredWarnings::Warner
|
84
|
-
</h1>
|
85
|
-
|
86
|
-
<section class="description">
|
87
|
-
|
88
|
-
<p>The <a href="Warner.html">Warner</a> class implements a very simple
|
89
|
-
interface. It simply formats a warning, so it is more than just the message
|
90
|
-
itself. This default warner uses a format comparable to warnings emitted by
|
91
|
-
rb_warn including the place where the “thing that caused the warning”
|
92
|
-
resides.</p>
|
93
|
-
|
94
|
-
</section>
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
<section id="5Buntitled-5D" class="documentation-section">
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
110
|
-
<header>
|
111
|
-
<h3>Public Instance Methods</h3>
|
112
|
-
</header>
|
113
|
-
|
114
|
-
|
115
|
-
<div id="method-i-format" class="method-detail ">
|
116
|
-
|
117
|
-
<div class="method-heading">
|
118
|
-
<span class="method-name">format</span><span
|
119
|
-
class="method-args">(warning, message, stack)</span>
|
120
|
-
|
121
|
-
<span class="method-click-advice">click to toggle source</span>
|
122
|
-
|
123
|
-
</div>
|
124
|
-
|
125
|
-
|
126
|
-
<div class="method-description">
|
127
|
-
|
128
|
-
<p>Warner.new.format(DeprecationWarning, “more info..”, caller)</p>
|
129
|
-
|
130
|
-
<pre class="ruby"><span class="ruby-comment"># => "demo.rb:5 : more info.. (DeprecationWarning)"</span>
|
131
|
-
</pre>
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
<div class="method-source-code" id="format-source">
|
137
|
-
<pre><span class="ruby-comment"># File lib/structured_warnings/warner.rb, line 9</span>
|
138
|
-
<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>)
|
139
|
-
<span class="ruby-node">"#{stack.shift} : #{message} (#{warning})"</span>
|
140
|
-
<span class="ruby-keyword">end</span></pre>
|
141
|
-
</div>
|
142
|
-
|
143
|
-
</div>
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
</div>
|
149
|
-
|
150
|
-
|
151
|
-
</section>
|
152
|
-
|
153
|
-
</section>
|
154
|
-
</main>
|
155
|
-
|
156
|
-
|
157
|
-
<footer id="validator-badges" role="contentinfo">
|
158
|
-
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
159
|
-
<p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.0.
|
160
|
-
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
161
|
-
</footer>
|
162
|
-
|
data/doc/Test.html
DELETED
@@ -1,95 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<meta charset="UTF-8">
|
6
|
-
|
7
|
-
<title>module Test - 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">
|
18
|
-
|
19
|
-
|
20
|
-
|
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>
|
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">
|
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
|
-
|
55
|
-
<div id="class-metadata">
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
</div>
|
62
|
-
</nav>
|
63
|
-
|
64
|
-
<main role="main" aria-labelledby="module-Test">
|
65
|
-
<h1 id="module-Test" class="module">
|
66
|
-
module Test
|
67
|
-
</h1>
|
68
|
-
|
69
|
-
<section class="description">
|
70
|
-
|
71
|
-
</section>
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
<section id="5Buntitled-5D" class="documentation-section">
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
</section>
|
87
|
-
</main>
|
88
|
-
|
89
|
-
|
90
|
-
<footer id="validator-badges" role="contentinfo">
|
91
|
-
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
92
|
-
<p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.0.
|
93
|
-
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
94
|
-
</footer>
|
95
|
-
|
data/doc/Test/Unit.html
DELETED
@@ -1,95 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<meta charset="UTF-8">
|
6
|
-
|
7
|
-
<title>module Test::Unit - 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">
|
18
|
-
|
19
|
-
|
20
|
-
|
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>
|
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">
|
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
|
-
|
55
|
-
<div id="class-metadata">
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
</div>
|
62
|
-
</nav>
|
63
|
-
|
64
|
-
<main role="main" aria-labelledby="module-Test::Unit">
|
65
|
-
<h1 id="module-Test::Unit" class="module">
|
66
|
-
module Test::Unit
|
67
|
-
</h1>
|
68
|
-
|
69
|
-
<section class="description">
|
70
|
-
|
71
|
-
</section>
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
<section id="5Buntitled-5D" class="documentation-section">
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
</section>
|
87
|
-
</main>
|
88
|
-
|
89
|
-
|
90
|
-
<footer id="validator-badges" role="contentinfo">
|
91
|
-
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
92
|
-
<p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.0.
|
93
|
-
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
94
|
-
</footer>
|
95
|
-
|
data/doc/Warning.html
DELETED
@@ -1,398 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<meta charset="UTF-8">
|
6
|
-
|
7
|
-
<title>class Warning - 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">
|
18
|
-
|
19
|
-
|
20
|
-
|
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>
|
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">
|
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
|
-
|
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"><a href="Object.html">Object</a>
|
62
|
-
|
63
|
-
</div>
|
64
|
-
|
65
|
-
|
66
|
-
<div id="extends-section" class="nav-section">
|
67
|
-
<h3>Extended With Modules</h3>
|
68
|
-
|
69
|
-
<ul class="link-list">
|
70
|
-
|
71
|
-
|
72
|
-
<li><a class="extend" href="Warning/ClassMethods.html">Warning::ClassMethods</a>
|
73
|
-
|
74
|
-
|
75
|
-
</ul>
|
76
|
-
</div>
|
77
|
-
|
78
|
-
<!-- Method Quickref -->
|
79
|
-
<div id="method-list-section" class="nav-section">
|
80
|
-
<h3>Methods</h3>
|
81
|
-
|
82
|
-
<ul class="link-list" role="directory">
|
83
|
-
|
84
|
-
<li ><a href="#method-c-new">::new</a>
|
85
|
-
|
86
|
-
<li ><a href="#method-i-backtrace">#backtrace</a>
|
87
|
-
|
88
|
-
<li ><a href="#method-i-inspect">#inspect</a>
|
89
|
-
|
90
|
-
<li ><a href="#method-i-message">#message</a>
|
91
|
-
|
92
|
-
<li ><a href="#method-i-set_backtrace">#set_backtrace</a>
|
93
|
-
|
94
|
-
<li ><a href="#method-i-to_s">#to_s</a>
|
95
|
-
|
96
|
-
<li ><a href="#method-i-to_str">#to_str</a>
|
97
|
-
|
98
|
-
</ul>
|
99
|
-
</div>
|
100
|
-
|
101
|
-
</div>
|
102
|
-
</nav>
|
103
|
-
|
104
|
-
<main role="main" aria-labelledby="class-Warning">
|
105
|
-
<h1 id="class-Warning" class="class">
|
106
|
-
class Warning
|
107
|
-
</h1>
|
108
|
-
|
109
|
-
<section class="description">
|
110
|
-
|
111
|
-
<p>Descendents of class <a href="Warning.html">Warning</a> are used to raise
|
112
|
-
structured warnings. They programmers to explicitly supress certain kinds
|
113
|
-
of warnings and provide additional information in contrast to the plain
|
114
|
-
warn method. They implement an Exception-like interface and carry
|
115
|
-
information about the warning – its type (the warning's class name), an
|
116
|
-
optional descriptive string, and optional traceback information. Programs
|
117
|
-
may subclass <a href="Warning.html">Warning</a> to add additional
|
118
|
-
information.</p>
|
119
|
-
|
120
|
-
<p>Large portions of this class's documentation are taken from the
|
121
|
-
Exception RDoc.</p>
|
122
|
-
|
123
|
-
</section>
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
<section id="5Buntitled-5D" class="documentation-section">
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
139
|
-
<header>
|
140
|
-
<h3>Public Class Methods</h3>
|
141
|
-
</header>
|
142
|
-
|
143
|
-
|
144
|
-
<div id="method-c-new" class="method-detail ">
|
145
|
-
|
146
|
-
<div class="method-heading">
|
147
|
-
<span class="method-name">new</span><span
|
148
|
-
class="method-args">(message = nil)</span>
|
149
|
-
|
150
|
-
<span class="method-click-advice">click to toggle source</span>
|
151
|
-
|
152
|
-
</div>
|
153
|
-
|
154
|
-
|
155
|
-
<div class="method-description">
|
156
|
-
|
157
|
-
<p>Construct a new <a href="Warning.html">Warning</a> object, optionally
|
158
|
-
passing in a message.</p>
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
<div class="method-source-code" id="new-source">
|
164
|
-
<pre><span class="ruby-comment"># File lib/structured_warnings/warning.rb, line 13</span>
|
165
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">message</span> = <span class="ruby-keyword">nil</span>)
|
166
|
-
<span class="ruby-ivar">@message</span> = <span class="ruby-identifier">message</span>
|
167
|
-
<span class="ruby-ivar">@backtrace</span> = <span class="ruby-identifier">caller</span>(<span class="ruby-value">1</span>)
|
168
|
-
<span class="ruby-keyword">end</span></pre>
|
169
|
-
</div>
|
170
|
-
|
171
|
-
</div>
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
</div>
|
177
|
-
|
178
|
-
|
179
|
-
</section>
|
180
|
-
|
181
|
-
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
182
|
-
<header>
|
183
|
-
<h3>Public Instance Methods</h3>
|
184
|
-
</header>
|
185
|
-
|
186
|
-
|
187
|
-
<div id="method-i-backtrace" class="method-detail ">
|
188
|
-
|
189
|
-
|
190
|
-
<div class="method-heading">
|
191
|
-
<span class="method-callseq">
|
192
|
-
backtrace → array
|
193
|
-
</span>
|
194
|
-
|
195
|
-
<span class="method-click-advice">click to toggle source</span>
|
196
|
-
|
197
|
-
</div>
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
<div class="method-description">
|
202
|
-
|
203
|
-
<p>Returns any backtrace associated with the warning. The backtrace is an
|
204
|
-
array of strings, each containing either “filename:lineNo: in
|
205
|
-
`method''' or “filename:lineNo.''</p>
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
<div class="method-source-code" id="backtrace-source">
|
211
|
-
<pre><span class="ruby-comment"># File lib/structured_warnings/warning.rb, line 25</span>
|
212
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">backtrace</span>
|
213
|
-
<span class="ruby-ivar">@backtrace</span>
|
214
|
-
<span class="ruby-keyword">end</span></pre>
|
215
|
-
</div>
|
216
|
-
|
217
|
-
</div>
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
</div>
|
223
|
-
|
224
|
-
|
225
|
-
<div id="method-i-inspect" class="method-detail ">
|
226
|
-
|
227
|
-
<div class="method-heading">
|
228
|
-
<span class="method-name">inspect</span><span
|
229
|
-
class="method-args">()</span>
|
230
|
-
|
231
|
-
<span class="method-click-advice">click to toggle source</span>
|
232
|
-
|
233
|
-
</div>
|
234
|
-
|
235
|
-
|
236
|
-
<div class="method-description">
|
237
|
-
|
238
|
-
<p>Return this warning's class name and message</p>
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
<div class="method-source-code" id="inspect-source">
|
244
|
-
<pre><span class="ruby-comment"># File lib/structured_warnings/warning.rb, line 44</span>
|
245
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">inspect</span>
|
246
|
-
<span class="ruby-node">"#<#{self.class}: #{self}>"</span>
|
247
|
-
<span class="ruby-keyword">end</span></pre>
|
248
|
-
</div>
|
249
|
-
|
250
|
-
</div>
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
</div>
|
256
|
-
|
257
|
-
|
258
|
-
<div id="method-i-message" class="method-detail method-alias">
|
259
|
-
|
260
|
-
<div class="method-heading">
|
261
|
-
<span class="method-name">message</span><span
|
262
|
-
class="method-args">()</span>
|
263
|
-
|
264
|
-
</div>
|
265
|
-
|
266
|
-
|
267
|
-
<div class="method-description">
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
</div>
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
<div class="aliases">
|
280
|
-
Alias for: <a href="Warning.html#method-i-to_s">to_s</a>
|
281
|
-
</div>
|
282
|
-
|
283
|
-
</div>
|
284
|
-
|
285
|
-
|
286
|
-
<div id="method-i-set_backtrace" class="method-detail ">
|
287
|
-
|
288
|
-
<div class="method-heading">
|
289
|
-
<span class="method-name">set_backtrace</span><span
|
290
|
-
class="method-args">(backtrace)</span>
|
291
|
-
|
292
|
-
<span class="method-click-advice">click to toggle source</span>
|
293
|
-
|
294
|
-
</div>
|
295
|
-
|
296
|
-
|
297
|
-
<div class="method-description">
|
298
|
-
|
299
|
-
<p>Sets the backtrace information associated with warning. The argument must
|
300
|
-
be an array of String objects in the format described in
|
301
|
-
Exception#backtrace.</p>
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
<div class="method-source-code" id="set_backtrace-source">
|
307
|
-
<pre><span class="ruby-comment"># File lib/structured_warnings/warning.rb, line 32</span>
|
308
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">set_backtrace</span>(<span class="ruby-identifier">backtrace</span>)
|
309
|
-
<span class="ruby-ivar">@backtrace</span> = <span class="ruby-identifier">backtrace</span>
|
310
|
-
<span class="ruby-keyword">end</span></pre>
|
311
|
-
</div>
|
312
|
-
|
313
|
-
</div>
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
</div>
|
319
|
-
|
320
|
-
|
321
|
-
<div id="method-i-to_s" class="method-detail ">
|
322
|
-
|
323
|
-
<div class="method-heading">
|
324
|
-
<span class="method-name">to_s</span><span
|
325
|
-
class="method-args">()</span>
|
326
|
-
|
327
|
-
<span class="method-click-advice">click to toggle source</span>
|
328
|
-
|
329
|
-
</div>
|
330
|
-
|
331
|
-
|
332
|
-
<div class="method-description">
|
333
|
-
|
334
|
-
<p>Returns warning's message (or the name of the warning if no message is
|
335
|
-
set).</p>
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
<div class="method-source-code" id="to_s-source">
|
341
|
-
<pre><span class="ruby-comment"># File lib/structured_warnings/warning.rb, line 37</span>
|
342
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
|
343
|
-
<span class="ruby-ivar">@message</span> <span class="ruby-operator">||</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">name</span>
|
344
|
-
<span class="ruby-keyword">end</span></pre>
|
345
|
-
</div>
|
346
|
-
|
347
|
-
</div>
|
348
|
-
|
349
|
-
|
350
|
-
<div class="aliases">
|
351
|
-
Also aliased as: <a href="Warning.html#method-i-to_str">to_str</a>, <a href="Warning.html#method-i-message">message</a>
|
352
|
-
</div>
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
</div>
|
357
|
-
|
358
|
-
|
359
|
-
<div id="method-i-to_str" class="method-detail method-alias">
|
360
|
-
|
361
|
-
<div class="method-heading">
|
362
|
-
<span class="method-name">to_str</span><span
|
363
|
-
class="method-args">()</span>
|
364
|
-
|
365
|
-
</div>
|
366
|
-
|
367
|
-
|
368
|
-
<div class="method-description">
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
</div>
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
<div class="aliases">
|
381
|
-
Alias for: <a href="Warning.html#method-i-to_s">to_s</a>
|
382
|
-
</div>
|
383
|
-
|
384
|
-
</div>
|
385
|
-
|
386
|
-
|
387
|
-
</section>
|
388
|
-
|
389
|
-
</section>
|
390
|
-
</main>
|
391
|
-
|
392
|
-
|
393
|
-
<footer id="validator-badges" role="contentinfo">
|
394
|
-
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
395
|
-
<p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.0.
|
396
|
-
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
397
|
-
</footer>
|
398
|
-
|