wwwjdic 15.0.0 → 16.0.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/CHANGELOG +13 -0
- data/Gemfile +4 -0
- data/README.md +6 -7
- data/Rakefile +4 -0
- data/examples/basics.rb +4 -0
- data/examples/translate.rb +26 -0
- data/examples/uri.rb +16 -0
- data/html/CHANGELOG.html +37 -30
- data/html/COPYING_md.html +22 -30
- data/html/Gemfile.html +25 -31
- data/html/Object.html +825 -63
- data/html/README_md.html +27 -33
- data/html/Rakefile.html +25 -31
- data/html/WWWJDic.html +42 -124
- data/html/WWWJDic/ParsableDuckType.html +35 -57
- data/html/WWWJDic/Parser.html +48 -90
- data/html/WWWJDic/Parsers.html +28 -36
- data/html/WWWJDic/Parsers/Dict.html +47 -73
- data/html/WWWJDic/Parsers/Display.html +42 -68
- data/html/WWWJDic/Parsers/Key.html +42 -68
- data/html/WWWJDic/Parsers/Search.html +38 -61
- data/html/WWWJDic/Parsers/Server.html +42 -68
- data/html/WWWJDic/Splitter.html +76 -173
- data/html/WWWJDic/Utils.html +28 -36
- data/html/WWWJDic/Utils/Downloader.html +28 -36
- data/html/WWWJDic/Utils/Downloader/Downloader.html +41 -80
- data/html/WWWJDic/Utils/Raisers.html +42 -96
- data/html/WWWJDic/WWWJDic.html +160 -342
- data/html/copyright_md.html +22 -30
- data/html/created.rid +32 -54
- data/html/css/rdoc.css +1 -1
- data/html/index.html +26 -51
- data/html/js/darkfish.js +84 -84
- data/html/js/navigation.js.gz +0 -0
- data/html/js/search.js +110 -110
- data/html/js/search_index.js +1 -1
- data/html/js/search_index.js.gz +0 -0
- data/html/js/searcher.js +229 -229
- data/html/js/searcher.js.gz +0 -0
- data/html/table_of_contents.html +153 -161
- data/lib/wwwjdic.rb +7 -4
- data/lib/wwwjdic/application.rb +52 -25
- data/lib/wwwjdic/constants.rb +33 -3
- data/lib/wwwjdic/locales/de.yml +2 -0
- data/lib/wwwjdic/locales/en.yml +2 -0
- data/lib/wwwjdic/locales/es.yml +2 -0
- data/lib/wwwjdic/locales/fr.yml +2 -0
- data/lib/wwwjdic/locales/hu.yml +2 -0
- data/lib/wwwjdic/locales/it.yml +2 -0
- data/lib/wwwjdic/locales/ja.yml +3 -1
- data/lib/wwwjdic/locales/nl.yml +2 -0
- data/lib/wwwjdic/locales/ru.yml +2 -0
- data/lib/wwwjdic/locales/sl.yml +2 -0
- data/lib/wwwjdic/locales/sv.yml +2 -0
- data/lib/wwwjdic/parser.rb +7 -4
- data/lib/wwwjdic/parsers/dict.rb +4 -1
- data/lib/wwwjdic/parsers/display.rb +4 -1
- data/lib/wwwjdic/parsers/key.rb +4 -1
- data/lib/wwwjdic/parsers/search.rb +4 -0
- data/lib/wwwjdic/parsers/server.rb +4 -1
- data/lib/wwwjdic/utils/downloader.rb +7 -8
- data/lib/wwwjdic/utils/raisers.rb +7 -13
- data/lib/wwwjdic/utils/splitter.rb +18 -9
- data/lib/wwwjdic/version.rb +5 -1
- data/test/test_helper.rb +4 -0
- data/test/test_wwwjdic.rb +4 -0
- data/test/wwwjdic/locales/de.yml +2 -0
- data/test/wwwjdic/locales/en.yml +2 -0
- data/test/wwwjdic/locales/es.yml +2 -0
- data/test/wwwjdic/locales/fr.yml +2 -0
- data/test/wwwjdic/locales/hu.yml +2 -0
- data/test/wwwjdic/locales/it.yml +2 -0
- data/test/wwwjdic/locales/ja.yml +2 -0
- data/test/wwwjdic/locales/nl.yml +2 -0
- data/test/wwwjdic/locales/ru.yml +2 -0
- data/test/wwwjdic/locales/sl.yml +2 -0
- data/test/wwwjdic/locales/sv.yml +2 -0
- data/test/wwwjdic/locales/test_locales.rb +35 -19
- data/test/wwwjdic/parsers/test_dict.rb +62 -36
- data/test/wwwjdic/parsers/test_display.rb +4 -0
- data/test/wwwjdic/parsers/test_key.rb +4 -0
- data/test/wwwjdic/parsers/test_server.rb +4 -0
- data/test/wwwjdic/test_application.rb +196 -148
- data/test/wwwjdic/test_parsable_duck_type.rb +4 -3
- data/test/wwwjdic/utils/test_downloader.rb +4 -0
- data/test/wwwjdic/utils/test_raisers.rb +42 -27
- data/wwwjdic.gemspec +14 -11
- metadata +19 -33
@@ -4,29 +4,27 @@
|
|
4
4
|
<head>
|
5
5
|
<meta charset="UTF-8">
|
6
6
|
|
7
|
-
<title>module WWWJDic::Utils::Downloader - wwwjdic
|
7
|
+
<title>module WWWJDic::Utils::Downloader - wwwjdic 16.0.0</title>
|
8
8
|
|
9
9
|
<script type="text/javascript">
|
10
10
|
var rdoc_rel_prefix = "../../";
|
11
11
|
var index_rel_prefix = "../../";
|
12
12
|
</script>
|
13
13
|
|
14
|
-
<script
|
15
|
-
<script
|
16
|
-
<script
|
17
|
-
<script
|
18
|
-
<script
|
14
|
+
<script src="../../js/navigation.js" defer></script>
|
15
|
+
<script src="../../js/search.js" defer></script>
|
16
|
+
<script src="../../js/search_index.js" defer></script>
|
17
|
+
<script src="../../js/searcher.js" defer></script>
|
18
|
+
<script src="../../js/darkfish.js" defer></script>
|
19
19
|
|
20
20
|
<link href="../../css/fonts.css" rel="stylesheet">
|
21
21
|
<link href="../../css/rdoc.css" rel="stylesheet">
|
22
22
|
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
<body class="module" id="top" role="document">
|
24
|
+
<body id="top" role="document" class="module">
|
27
25
|
<nav role="navigation">
|
28
26
|
<div id="project-navigation">
|
29
|
-
<div
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
30
28
|
<h2>
|
31
29
|
<a href="../../index.html" rel="home">Home</a>
|
32
30
|
</h2>
|
@@ -38,41 +36,41 @@
|
|
38
36
|
</div>
|
39
37
|
</div>
|
40
38
|
|
41
|
-
<div
|
42
|
-
<form
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
43
41
|
<div id="search-field-wrapper">
|
44
|
-
<input
|
45
|
-
|
46
|
-
|
47
|
-
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
48
46
|
</div>
|
49
47
|
|
50
|
-
<ul
|
51
|
-
aria-
|
52
|
-
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
53
51
|
</form>
|
54
52
|
</div>
|
55
53
|
|
56
54
|
</div>
|
57
55
|
|
58
|
-
|
56
|
+
|
59
57
|
|
60
58
|
<div id="class-metadata">
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
66
64
|
</div>
|
67
65
|
</nav>
|
68
66
|
|
69
|
-
<main aria-labelledby="module-WWWJDic::Utils::Downloader"
|
70
|
-
<h1
|
67
|
+
<main role="main" aria-labelledby="module-WWWJDic::Utils::Downloader">
|
68
|
+
<h1 id="module-WWWJDic::Utils::Downloader" class="module">
|
71
69
|
module WWWJDic::Utils::Downloader
|
72
70
|
</h1>
|
73
71
|
|
74
72
|
<section class="description">
|
75
|
-
|
73
|
+
|
76
74
|
<p>This module is a simple wrapper container for Peter R. Marreck's gist.</p>
|
77
75
|
<dl class="rdoc-list note-list"><dt>Author
|
78
76
|
<dd>
|
@@ -87,25 +85,19 @@
|
|
87
85
|
|
88
86
|
</section>
|
89
87
|
|
90
|
-
|
91
|
-
<section class="documentation-section" id="5Buntitled-5D">
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
88
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
96
89
|
|
97
90
|
|
98
91
|
|
99
92
|
|
100
93
|
|
101
94
|
</section>
|
102
|
-
|
103
95
|
</main>
|
104
96
|
|
105
97
|
|
106
98
|
<footer id="validator-badges" role="contentinfo">
|
107
99
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
108
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.
|
100
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.0.
|
109
101
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
110
102
|
</footer>
|
111
103
|
|
@@ -4,29 +4,27 @@
|
|
4
4
|
<head>
|
5
5
|
<meta charset="UTF-8">
|
6
6
|
|
7
|
-
<title>class WWWJDic::Utils::Downloader::Downloader - wwwjdic
|
7
|
+
<title>class WWWJDic::Utils::Downloader::Downloader - wwwjdic 16.0.0</title>
|
8
8
|
|
9
9
|
<script type="text/javascript">
|
10
10
|
var rdoc_rel_prefix = "../../../";
|
11
11
|
var index_rel_prefix = "../../../";
|
12
12
|
</script>
|
13
13
|
|
14
|
-
<script
|
15
|
-
<script
|
16
|
-
<script
|
17
|
-
<script
|
18
|
-
<script
|
14
|
+
<script src="../../../js/navigation.js" defer></script>
|
15
|
+
<script src="../../../js/search.js" defer></script>
|
16
|
+
<script src="../../../js/search_index.js" defer></script>
|
17
|
+
<script src="../../../js/searcher.js" defer></script>
|
18
|
+
<script src="../../../js/darkfish.js" defer></script>
|
19
19
|
|
20
20
|
<link href="../../../css/fonts.css" rel="stylesheet">
|
21
21
|
<link href="../../../css/rdoc.css" rel="stylesheet">
|
22
22
|
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
<body class="class" id="top" role="document">
|
24
|
+
<body id="top" role="document" class="class">
|
27
25
|
<nav role="navigation">
|
28
26
|
<div id="project-navigation">
|
29
|
-
<div
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
30
28
|
<h2>
|
31
29
|
<a href="../../../index.html" rel="home">Home</a>
|
32
30
|
</h2>
|
@@ -38,58 +36,56 @@
|
|
38
36
|
</div>
|
39
37
|
</div>
|
40
38
|
|
41
|
-
<div
|
42
|
-
<form
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
43
41
|
<div id="search-field-wrapper">
|
44
|
-
<input
|
45
|
-
|
46
|
-
|
47
|
-
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
48
46
|
</div>
|
49
47
|
|
50
|
-
<ul
|
51
|
-
aria-
|
52
|
-
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
53
51
|
</form>
|
54
52
|
</div>
|
55
53
|
|
56
54
|
</div>
|
57
55
|
|
58
|
-
|
56
|
+
|
59
57
|
|
60
58
|
<div id="class-metadata">
|
61
|
-
|
62
|
-
|
59
|
+
|
60
|
+
|
61
|
+
<div id="parent-class-section" class="nav-section">
|
63
62
|
<h3>Parent</h3>
|
64
63
|
|
65
|
-
|
66
64
|
<p class="link"><a href="../../../Object.html">Object</a>
|
67
|
-
|
68
65
|
</div>
|
69
66
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
<!-- Method Quickref -->
|
71
|
+
<div id="method-list-section" class="nav-section">
|
74
72
|
<h3>Methods</h3>
|
75
73
|
|
76
74
|
<ul class="link-list" role="directory">
|
77
|
-
|
78
75
|
<li ><a href="#method-c-download_file">::download_file</a>
|
79
|
-
|
80
76
|
</ul>
|
81
77
|
</div>
|
82
78
|
|
83
79
|
</div>
|
84
80
|
</nav>
|
85
81
|
|
86
|
-
<main aria-labelledby="class-WWWJDic::Utils::Downloader::Downloader"
|
87
|
-
<h1
|
82
|
+
<main role="main" aria-labelledby="class-WWWJDic::Utils::Downloader::Downloader">
|
83
|
+
<h1 id="class-WWWJDic::Utils::Downloader::Downloader" class="class">
|
88
84
|
class WWWJDic::Utils::Downloader::Downloader
|
89
85
|
</h1>
|
90
86
|
|
91
87
|
<section class="description">
|
92
|
-
|
88
|
+
|
93
89
|
<p>An HTTP/HTTPS/FTP file downloader library/CLI based upon MiniPortile's HTTP implementation.</p>
|
94
90
|
<dl class="rdoc-list note-list"><dt>Author
|
95
91
|
<dd>
|
@@ -104,11 +100,7 @@
|
|
104
100
|
|
105
101
|
</section>
|
106
102
|
|
107
|
-
|
108
|
-
<section class="documentation-section" id="5Buntitled-5D">
|
109
|
-
|
110
|
-
|
111
|
-
|
103
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
112
104
|
|
113
105
|
|
114
106
|
<section class="constants-list">
|
@@ -116,117 +108,86 @@
|
|
116
108
|
<h3>Constants</h3>
|
117
109
|
</header>
|
118
110
|
<dl>
|
119
|
-
|
120
111
|
<dt id="VERSION">VERSION
|
121
|
-
|
122
112
|
<dd>
|
123
|
-
|
124
|
-
|
125
113
|
</dl>
|
126
114
|
</section>
|
127
115
|
|
128
|
-
|
129
|
-
|
130
116
|
<section class="attribute-method-details" class="method-section">
|
131
117
|
<header>
|
132
118
|
<h3>Attributes</h3>
|
133
119
|
</header>
|
134
120
|
|
135
|
-
|
136
|
-
<div class="method-detail" id="attribute-c-ftp_data_chunk_size">
|
121
|
+
<div id="attribute-c-ftp_data_chunk_size" class="method-detail">
|
137
122
|
<div class="method-heading attribute-method-heading">
|
138
123
|
<span class="method-name">ftp_data_chunk_size</span><span
|
139
124
|
class="attribute-access-type">[RW]</span>
|
140
125
|
</div>
|
141
126
|
|
142
127
|
<div class="method-description">
|
143
|
-
|
144
|
-
|
145
|
-
|
128
|
+
|
146
129
|
</div>
|
147
130
|
</div>
|
148
|
-
|
149
|
-
<div class="method-detail" id="attribute-c-logger">
|
131
|
+
<div id="attribute-c-logger" class="method-detail">
|
150
132
|
<div class="method-heading attribute-method-heading">
|
151
133
|
<span class="method-name">logger</span><span
|
152
134
|
class="attribute-access-type">[RW]</span>
|
153
135
|
</div>
|
154
136
|
|
155
137
|
<div class="method-description">
|
156
|
-
|
157
|
-
|
158
|
-
|
138
|
+
|
159
139
|
</div>
|
160
140
|
</div>
|
161
|
-
|
162
|
-
<div class="method-detail" id="attribute-c-max_ca_verify_depth">
|
141
|
+
<div id="attribute-c-max_ca_verify_depth" class="method-detail">
|
163
142
|
<div class="method-heading attribute-method-heading">
|
164
143
|
<span class="method-name">max_ca_verify_depth</span><span
|
165
144
|
class="attribute-access-type">[RW]</span>
|
166
145
|
</div>
|
167
146
|
|
168
147
|
<div class="method-description">
|
169
|
-
|
170
|
-
|
171
|
-
|
148
|
+
|
172
149
|
</div>
|
173
150
|
</div>
|
174
|
-
|
175
151
|
</section>
|
176
152
|
|
177
153
|
|
178
|
-
|
179
|
-
<section class="method-section" id="public-class-5Buntitled-5D-method-details">
|
154
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
180
155
|
<header>
|
181
156
|
<h3>Public Class Methods</h3>
|
182
157
|
</header>
|
183
158
|
|
184
|
-
|
185
|
-
<div class="method-detail " id="method-c-download_file">
|
186
|
-
|
159
|
+
<div id="method-c-download_file" class="method-detail ">
|
187
160
|
<div class="method-heading">
|
188
161
|
<span class="method-name">download_file</span><span
|
189
162
|
class="method-args">(url, full_path, count = 3)</span>
|
190
|
-
|
191
163
|
<span class="method-click-advice">click to toggle source</span>
|
192
|
-
|
193
164
|
</div>
|
194
165
|
|
195
|
-
|
196
166
|
<div class="method-description">
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
167
|
+
|
202
168
|
|
203
169
|
<div class="method-source-code" id="download_file-source">
|
204
170
|
<pre> <span class="ruby-comment"># File lib/wwwjdic/utils/downloader.rb</span>
|
205
171
|
<span class="line-num">61</span> <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">download_file</span>(<span class="ruby-identifier">url</span>, <span class="ruby-identifier">full_path</span>, <span class="ruby-identifier">count</span> = <span class="ruby-value">3</span>)
|
206
172
|
<span class="line-num">62</span> <span class="ruby-identifier">raise</span> <span class="ruby-constant">I18n</span>.<span class="ruby-identifier">t</span>(<span class="ruby-string">'error.nil'</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">url</span>.<span class="ruby-identifier">nil?</span>
|
207
|
-
<span class="line-num">63</span>
|
173
|
+
<span class="line-num">63</span>
|
208
174
|
<span class="line-num">64</span> <span class="ruby-identifier">http_download</span>(<span class="ruby-identifier">url</span>, <span class="ruby-identifier">full_path</span>, <span class="ruby-identifier">count</span>)
|
209
175
|
<span class="line-num">65</span> <span class="ruby-keyword">end</span></pre>
|
210
176
|
</div>
|
211
|
-
|
212
177
|
</div>
|
213
178
|
|
214
179
|
|
215
|
-
|
216
|
-
|
217
180
|
</div>
|
218
181
|
|
219
|
-
|
220
182
|
</section>
|
221
183
|
|
222
184
|
</section>
|
223
|
-
|
224
185
|
</main>
|
225
186
|
|
226
187
|
|
227
188
|
<footer id="validator-badges" role="contentinfo">
|
228
189
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
229
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.
|
190
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.0.
|
230
191
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
231
192
|
</footer>
|
232
193
|
|
@@ -4,29 +4,27 @@
|
|
4
4
|
<head>
|
5
5
|
<meta charset="UTF-8">
|
6
6
|
|
7
|
-
<title>module WWWJDic::Utils::Raisers - wwwjdic
|
7
|
+
<title>module WWWJDic::Utils::Raisers - wwwjdic 16.0.0</title>
|
8
8
|
|
9
9
|
<script type="text/javascript">
|
10
10
|
var rdoc_rel_prefix = "../../";
|
11
11
|
var index_rel_prefix = "../../";
|
12
12
|
</script>
|
13
13
|
|
14
|
-
<script
|
15
|
-
<script
|
16
|
-
<script
|
17
|
-
<script
|
18
|
-
<script
|
14
|
+
<script src="../../js/navigation.js" defer></script>
|
15
|
+
<script src="../../js/search.js" defer></script>
|
16
|
+
<script src="../../js/search_index.js" defer></script>
|
17
|
+
<script src="../../js/searcher.js" defer></script>
|
18
|
+
<script src="../../js/darkfish.js" defer></script>
|
19
19
|
|
20
20
|
<link href="../../css/fonts.css" rel="stylesheet">
|
21
21
|
<link href="../../css/rdoc.css" rel="stylesheet">
|
22
22
|
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
<body class="module" id="top" role="document">
|
24
|
+
<body id="top" role="document" class="module">
|
27
25
|
<nav role="navigation">
|
28
26
|
<div id="project-navigation">
|
29
|
-
<div
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
30
28
|
<h2>
|
31
29
|
<a href="../../index.html" rel="home">Home</a>
|
32
30
|
</h2>
|
@@ -38,55 +36,52 @@
|
|
38
36
|
</div>
|
39
37
|
</div>
|
40
38
|
|
41
|
-
<div
|
42
|
-
<form
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
43
41
|
<div id="search-field-wrapper">
|
44
|
-
<input
|
45
|
-
|
46
|
-
|
47
|
-
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
48
46
|
</div>
|
49
47
|
|
50
|
-
<ul
|
51
|
-
aria-
|
52
|
-
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
53
51
|
</form>
|
54
52
|
</div>
|
55
53
|
|
56
54
|
</div>
|
57
55
|
|
58
|
-
|
56
|
+
|
59
57
|
|
60
58
|
<div id="class-metadata">
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
<!-- Method Quickref -->
|
65
|
+
<div id="method-list-section" class="nav-section">
|
67
66
|
<h3>Methods</h3>
|
68
67
|
|
69
68
|
<ul class="link-list" role="directory">
|
70
|
-
|
71
69
|
<li ><a href="#method-i-raiser_array">#raiser_array</a>
|
72
|
-
|
73
70
|
<li ><a href="#method-i-raiser_downcase">#raiser_downcase</a>
|
74
|
-
|
75
71
|
<li ><a href="#method-i-raiser_to_i">#raiser_to_i</a>
|
76
|
-
|
77
72
|
</ul>
|
78
73
|
</div>
|
79
74
|
|
80
75
|
</div>
|
81
76
|
</nav>
|
82
77
|
|
83
|
-
<main aria-labelledby="module-WWWJDic::Utils::Raisers"
|
84
|
-
<h1
|
78
|
+
<main role="main" aria-labelledby="module-WWWJDic::Utils::Raisers">
|
79
|
+
<h1 id="module-WWWJDic::Utils::Raisers" class="module">
|
85
80
|
module WWWJDic::Utils::Raisers
|
86
81
|
</h1>
|
87
82
|
|
88
83
|
<section class="description">
|
89
|
-
|
84
|
+
|
90
85
|
<p>This module contains some utility method to raise errors according to (possibly) common conditions.</p>
|
91
86
|
<dl class="rdoc-list note-list"><dt>Author
|
92
87
|
<dd>
|
@@ -101,138 +96,89 @@
|
|
101
96
|
|
102
97
|
</section>
|
103
98
|
|
104
|
-
|
105
|
-
<section class="documentation-section" id="5Buntitled-5D">
|
106
|
-
|
99
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
107
100
|
|
108
101
|
|
109
102
|
|
110
103
|
|
111
104
|
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
<section class="method-section" id="public-instance-5Buntitled-5D-method-details">
|
105
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
116
106
|
<header>
|
117
107
|
<h3>Public Instance Methods</h3>
|
118
108
|
</header>
|
119
109
|
|
120
|
-
|
121
|
-
<div class="method-detail " id="method-i-raiser_array">
|
122
|
-
|
110
|
+
<div id="method-i-raiser_array" class="method-detail ">
|
123
111
|
<div class="method-heading">
|
124
112
|
<span class="method-name">raiser_array</span><span
|
125
113
|
class="method-args">(name = 'error.value', value = nil, array = nil)</span>
|
126
|
-
|
127
114
|
<span class="method-click-advice">click to toggle source</span>
|
128
|
-
|
129
115
|
</div>
|
130
116
|
|
131
|
-
|
132
117
|
<div class="method-description">
|
133
|
-
|
134
118
|
<p>Raises an <code>ArgumentError</code> according to parameters, unless the <code>array</code> contains the exact <code>value</code>.</p>
|
135
119
|
|
136
|
-
|
137
|
-
|
138
|
-
|
139
120
|
<div class="method-source-code" id="raiser_array-source">
|
140
121
|
<pre> <span class="ruby-comment"># File lib/wwwjdic/utils/raisers.rb</span>
|
141
122
|
<span class="line-num">49</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">raiser_array</span>(<span class="ruby-identifier">name</span> = <span class="ruby-string">'error.value'</span>, <span class="ruby-identifier">value</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">array</span> = <span class="ruby-keyword">nil</span>)
|
142
|
-
<span class="line-num">50</span> <span class="ruby-keyword">
|
143
|
-
<span class="line-num">51</span>
|
144
|
-
<span class="line-num">52</span> <span class="ruby-keyword">end</span>
|
145
|
-
<span class="line-num">53</span> <span class="ruby-keyword">end</span></pre>
|
123
|
+
<span class="line-num">50</span> <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-constant">I18n</span>.<span class="ruby-identifier">t</span>(<span class="ruby-identifier">name</span>, <span class="ruby-value">value:</span> <span class="ruby-identifier">value</span>) <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span>(<span class="ruby-identifier">array</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">value</span>)
|
124
|
+
<span class="line-num">51</span> <span class="ruby-keyword">end</span></pre>
|
146
125
|
</div>
|
147
|
-
|
148
126
|
</div>
|
149
127
|
|
150
128
|
|
151
|
-
|
152
|
-
|
153
129
|
</div>
|
154
130
|
|
155
|
-
|
156
|
-
<div class="method-detail " id="method-i-raiser_downcase">
|
157
|
-
|
131
|
+
<div id="method-i-raiser_downcase" class="method-detail ">
|
158
132
|
<div class="method-heading">
|
159
133
|
<span class="method-name">raiser_downcase</span><span
|
160
134
|
class="method-args">(name = 'error.value', value = nil, array = nil)</span>
|
161
|
-
|
162
135
|
<span class="method-click-advice">click to toggle source</span>
|
163
|
-
|
164
136
|
</div>
|
165
137
|
|
166
|
-
|
167
138
|
<div class="method-description">
|
168
|
-
|
169
139
|
<p>Raises an <code>ArgumentError</code> according to parameters, unless the <code>array</code> contains a downcased <code>value</code>.</p>
|
170
140
|
|
171
|
-
|
172
|
-
|
173
|
-
|
174
141
|
<div class="method-source-code" id="raiser_downcase-source">
|
175
142
|
<pre> <span class="ruby-comment"># File lib/wwwjdic/utils/raisers.rb</span>
|
176
|
-
<span class="line-num">
|
177
|
-
<span class="line-num">
|
178
|
-
<span class="line-num">
|
179
|
-
<span class="line-num">60</span> <span class="ruby-keyword">end</span>
|
180
|
-
<span class="line-num">61</span> <span class="ruby-keyword">end</span></pre>
|
143
|
+
<span class="line-num">55</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">raiser_downcase</span>(<span class="ruby-identifier">name</span> = <span class="ruby-string">'error.value'</span>, <span class="ruby-identifier">value</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">array</span> = <span class="ruby-keyword">nil</span>)
|
144
|
+
<span class="line-num">56</span> <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-constant">I18n</span>.<span class="ruby-identifier">t</span>(<span class="ruby-identifier">name</span>, <span class="ruby-value">value:</span> <span class="ruby-identifier">value</span>) <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span>(<span class="ruby-identifier">array</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">downcase</span>)
|
145
|
+
<span class="line-num">57</span> <span class="ruby-keyword">end</span></pre>
|
181
146
|
</div>
|
182
|
-
|
183
147
|
</div>
|
184
148
|
|
185
149
|
|
186
|
-
|
187
|
-
|
188
150
|
</div>
|
189
151
|
|
190
|
-
|
191
|
-
<div class="method-detail " id="method-i-raiser_to_i">
|
192
|
-
|
152
|
+
<div id="method-i-raiser_to_i" class="method-detail ">
|
193
153
|
<div class="method-heading">
|
194
154
|
<span class="method-name">raiser_to_i</span><span
|
195
155
|
class="method-args">(name = 'error.value', value = nil, array = nil)</span>
|
196
|
-
|
197
156
|
<span class="method-click-advice">click to toggle source</span>
|
198
|
-
|
199
157
|
</div>
|
200
158
|
|
201
|
-
|
202
159
|
<div class="method-description">
|
203
|
-
|
204
160
|
<p>Raises an <code>ArgumentError</code> according to parameters, unless the <code>array</code> contains the number of the <code>value</code>.</p>
|
205
161
|
|
206
|
-
|
207
|
-
|
208
|
-
|
209
162
|
<div class="method-source-code" id="raiser_to_i-source">
|
210
163
|
<pre> <span class="ruby-comment"># File lib/wwwjdic/utils/raisers.rb</span>
|
211
|
-
<span class="line-num">
|
212
|
-
<span class="line-num">
|
213
|
-
<span class="line-num">
|
214
|
-
<span class="line-num">68</span> <span class="ruby-keyword">end</span>
|
215
|
-
<span class="line-num">69</span> <span class="ruby-keyword">end</span></pre>
|
164
|
+
<span class="line-num">61</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">raiser_to_i</span>(<span class="ruby-identifier">name</span> = <span class="ruby-string">'error.value'</span>, <span class="ruby-identifier">value</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">array</span> = <span class="ruby-keyword">nil</span>)
|
165
|
+
<span class="line-num">62</span> <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-constant">I18n</span>.<span class="ruby-identifier">t</span>(<span class="ruby-identifier">name</span>, <span class="ruby-value">value:</span> <span class="ruby-identifier">value</span>) <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span>(<span class="ruby-identifier">array</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">to_i</span>)
|
166
|
+
<span class="line-num">63</span> <span class="ruby-keyword">end</span></pre>
|
216
167
|
</div>
|
217
|
-
|
218
168
|
</div>
|
219
169
|
|
220
170
|
|
221
|
-
|
222
|
-
|
223
171
|
</div>
|
224
172
|
|
225
|
-
|
226
173
|
</section>
|
227
174
|
|
228
175
|
</section>
|
229
|
-
|
230
176
|
</main>
|
231
177
|
|
232
178
|
|
233
179
|
<footer id="validator-badges" role="contentinfo">
|
234
180
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
235
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.
|
181
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.0.
|
236
182
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
237
183
|
</footer>
|
238
184
|
|