wwwjdic 13.0.1 → 16.1.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 +60 -1
- data/Gemfile +7 -1
- data/README.md +500 -225
- data/Rakefile +10 -3
- data/copyright.md +17 -29
- data/examples/basics.rb +53 -45
- data/examples/translate.rb +159 -86
- data/examples/uri.rb +46 -78
- data/html/CHANGELOG.html +90 -35
- data/html/COPYING_md.html +26 -38
- data/html/Gemfile.html +25 -35
- data/html/Object.html +838 -74
- data/html/README_md.html +322 -175
- data/html/Rakefile.html +28 -38
- data/html/WWWJDic.html +63 -104
- data/html/WWWJDic/ParsableDuckType.html +38 -58
- data/html/WWWJDic/Parser.html +52 -92
- data/html/WWWJDic/Parsers.html +29 -35
- data/html/WWWJDic/Parsers/Dict.html +50 -76
- data/html/WWWJDic/Parsers/Display.html +45 -69
- data/html/WWWJDic/Parsers/Key.html +46 -70
- data/html/WWWJDic/Parsers/Search.html +41 -61
- data/html/WWWJDic/Parsers/Server.html +45 -69
- data/html/WWWJDic/Splitter.html +81 -175
- data/html/WWWJDic/Utils.html +30 -36
- data/html/WWWJDic/Utils/Downloader.html +41 -41
- data/html/WWWJDic/Utils/Downloader/Downloader.html +65 -92
- data/html/WWWJDic/Utils/Raisers.html +46 -98
- data/html/WWWJDic/WWWJDic.html +166 -348
- data/html/copyright_md.html +219 -239
- data/html/created.rid +33 -58
- data/html/css/rdoc.css +638 -590
- data/html/index.html +313 -182
- data/html/js/darkfish.js +84 -161
- data/html/js/navigation.js +4 -40
- data/html/js/navigation.js.gz +0 -0
- data/html/js/search.js +109 -109
- data/html/js/search_index.js +1 -1
- data/html/js/search_index.js.gz +0 -0
- data/html/js/searcher.js +228 -229
- data/html/js/searcher.js.gz +0 -0
- data/html/table_of_contents.html +161 -200
- data/lib/wwwjdic.rb +14 -15
- data/lib/wwwjdic/application.rb +68 -36
- data/lib/wwwjdic/constants.rb +56 -12
- data/lib/wwwjdic/locales/de.yml +9 -4
- data/lib/wwwjdic/locales/en.yml +9 -4
- data/lib/wwwjdic/locales/es.yml +9 -4
- data/lib/wwwjdic/locales/fr.yml +9 -4
- data/lib/wwwjdic/locales/hu.yml +9 -4
- data/lib/wwwjdic/locales/it.yml +9 -4
- data/lib/wwwjdic/locales/ja.yml +11 -5
- data/lib/wwwjdic/locales/nl.yml +9 -4
- data/lib/wwwjdic/locales/ru.yml +9 -4
- data/lib/wwwjdic/locales/sl.yml +9 -4
- data/lib/wwwjdic/locales/sv.yml +9 -4
- data/lib/wwwjdic/parser.rb +13 -8
- data/lib/wwwjdic/parsers/dict.rb +11 -8
- data/lib/wwwjdic/parsers/display.rb +8 -3
- data/lib/wwwjdic/parsers/key.rb +9 -3
- data/lib/wwwjdic/parsers/search.rb +10 -3
- data/lib/wwwjdic/parsers/server.rb +8 -3
- data/lib/wwwjdic/utils/downloader.rb +37 -34
- data/lib/wwwjdic/utils/raisers.rb +12 -15
- data/lib/wwwjdic/utils/splitter.rb +32 -18
- data/lib/wwwjdic/version.rb +22 -8
- data/test/test_helper.rb +10 -1
- data/test/test_wwwjdic.rb +10 -4
- data/test/wwwjdic/locales/de.yml +9 -1
- data/test/wwwjdic/locales/en.yml +9 -1
- data/test/wwwjdic/locales/es.yml +9 -1
- data/test/wwwjdic/locales/fr.yml +9 -1
- data/test/wwwjdic/locales/hu.yml +9 -1
- data/test/wwwjdic/locales/it.yml +10 -1
- data/test/wwwjdic/locales/ja.yml +11 -2
- data/test/wwwjdic/locales/nl.yml +9 -1
- data/test/wwwjdic/locales/ru.yml +9 -1
- data/test/wwwjdic/locales/sl.yml +9 -1
- data/test/wwwjdic/locales/sv.yml +9 -1
- data/test/wwwjdic/locales/test_locales.rb +41 -24
- data/test/wwwjdic/parsers/test_dict.rb +65 -37
- data/test/wwwjdic/parsers/test_display.rb +11 -5
- data/test/wwwjdic/parsers/test_key.rb +10 -4
- data/test/wwwjdic/parsers/test_server.rb +11 -5
- data/test/wwwjdic/test_application.rb +199 -149
- data/test/wwwjdic/test_parsable_duck_type.rb +9 -5
- data/test/wwwjdic/utils/test_downloader.rb +7 -1
- data/test/wwwjdic/utils/test_raisers.rb +46 -29
- data/wwwjdic.gemspec +44 -26
- metadata +55 -43
- data/acknowledgements.md +0 -55
- data/authors.md +0 -67
- data/html/acknowledgements_md.html +0 -149
- data/html/authors_md.html +0 -181
- data/html/js/jquery.js +0 -4
- data/html/wwwjdic_gemspec.html +0 -161
@@ -4,26 +4,27 @@
|
|
4
4
|
<head>
|
5
5
|
<meta charset="UTF-8">
|
6
6
|
|
7
|
-
<title>class WWWJDic::Parsers::Server - wwwjdic
|
7
|
+
<title>class WWWJDic::Parsers::Server - wwwjdic 16.1.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 src="../../js/
|
15
|
-
<script src="../../js/
|
14
|
+
<script defer src="../../js/navigation.js"></script>
|
15
|
+
<script defer src="../../js/search.js"></script>
|
16
|
+
<script defer src="../../js/search_index.js"></script>
|
17
|
+
<script defer src="../../js/searcher.js"></script>
|
18
|
+
<script defer src="../../js/darkfish.js"></script>
|
16
19
|
|
17
20
|
<link href="../../css/fonts.css" rel="stylesheet">
|
18
21
|
<link href="../../css/rdoc.css" rel="stylesheet">
|
19
22
|
|
20
23
|
|
21
|
-
|
22
|
-
|
23
|
-
<body id="top" role="document" class="class">
|
24
|
+
<body class="class" id="top" role="document">
|
24
25
|
<nav role="navigation">
|
25
26
|
<div id="project-navigation">
|
26
|
-
<div id="home-section" role="region" title="Quick navigation"
|
27
|
+
<div class="nav-section" id="home-section" role="region" title="Quick navigation">
|
27
28
|
<h2>
|
28
29
|
<a href="../../index.html" rel="home">Home</a>
|
29
30
|
</h2>
|
@@ -35,76 +36,71 @@
|
|
35
36
|
</div>
|
36
37
|
</div>
|
37
38
|
|
38
|
-
<div
|
39
|
-
<form action="#" method="get"
|
39
|
+
<div class="project-section initially-hidden" id="search-section" role="search">
|
40
|
+
<form accept-charset="utf-8" action="#" method="get">
|
40
41
|
<div id="search-field-wrapper">
|
41
|
-
<input
|
42
|
-
|
43
|
-
|
44
|
-
|
42
|
+
<input aria-autocomplete="list" aria-controls="search-results" aria-label="Search"
|
43
|
+
id="search-field" name="search"
|
44
|
+
placeholder="Search" role="combobox" spellcheck="false" title="Type to search, Up and Down to navigate, Enter to load"
|
45
|
+
type="text">
|
45
46
|
</div>
|
46
47
|
|
47
|
-
<ul
|
48
|
-
aria-
|
49
|
-
|
48
|
+
<ul aria-atomic="false" aria-busy="false"
|
49
|
+
aria-expanded="false" aria-label="Search Results"
|
50
|
+
class="initially-hidden" id="search-results"></ul>
|
50
51
|
</form>
|
51
52
|
</div>
|
52
53
|
|
53
54
|
</div>
|
54
55
|
|
55
|
-
|
56
|
+
|
56
57
|
|
57
58
|
<div id="class-metadata">
|
58
|
-
|
59
|
-
|
59
|
+
|
60
|
+
|
61
|
+
<div class="nav-section" id="parent-class-section">
|
60
62
|
<h3>Parent</h3>
|
61
63
|
|
62
|
-
|
63
64
|
<p class="link"><a href="../../Object.html">Object</a>
|
64
|
-
|
65
65
|
</div>
|
66
66
|
|
67
|
-
|
67
|
+
|
68
|
+
<div class="nav-section" id="includes-section">
|
68
69
|
<h3>Included Modules</h3>
|
69
70
|
|
70
71
|
<ul class="link-list">
|
71
|
-
|
72
|
-
|
73
72
|
<li><a class="include" href="../Utils/Raisers.html">WWWJDic::Utils::Raisers</a>
|
74
|
-
|
75
|
-
|
76
73
|
</ul>
|
77
74
|
</div>
|
78
75
|
|
79
|
-
|
80
|
-
|
81
|
-
|
76
|
+
|
77
|
+
|
78
|
+
<!-- Method Quickref -->
|
79
|
+
<div class="nav-section" id="method-list-section">
|
82
80
|
<h3>Methods</h3>
|
83
81
|
|
84
82
|
<ul class="link-list" role="directory">
|
85
|
-
|
86
83
|
<li ><a href="#method-i-parse">#parse</a>
|
87
|
-
|
88
84
|
</ul>
|
89
85
|
</div>
|
90
86
|
|
91
87
|
</div>
|
92
88
|
</nav>
|
93
89
|
|
94
|
-
<main
|
95
|
-
<h1 id="class-WWWJDic::Parsers::Server"
|
90
|
+
<main aria-labelledby="class-WWWJDic::Parsers::Server" role="main">
|
91
|
+
<h1 class="class" id="class-WWWJDic::Parsers::Server">
|
96
92
|
class WWWJDic::Parsers::Server
|
97
93
|
</h1>
|
98
94
|
|
99
95
|
<section class="description">
|
100
|
-
|
96
|
+
|
101
97
|
<p>This class is an implementation of the Parsable duck type that checks the display type. The only needed parameter is a boolean, with <code>true</code> for regular.</p>
|
102
98
|
<dl class="rdoc-list note-list"><dt>Author
|
103
99
|
<dd>
|
104
100
|
<p><a href="mailto:marcobresciani_1974@libero.it">Marco Bresciani</a></p>
|
105
101
|
</dd><dt>Copyright
|
106
102
|
<dd>
|
107
|
-
<p
|
103
|
+
<p>© 2014-2021 Marco Bresciani</p>
|
108
104
|
</dd><dt>License
|
109
105
|
<dd>
|
110
106
|
<p>GNU General Public License version 3</p>
|
@@ -112,71 +108,51 @@
|
|
112
108
|
|
113
109
|
</section>
|
114
110
|
|
115
|
-
|
116
|
-
|
117
|
-
|
111
|
+
<section class="documentation-section" id="5Buntitled-5D">
|
112
|
+
|
118
113
|
|
119
|
-
|
120
114
|
|
121
|
-
|
122
115
|
|
123
|
-
|
124
116
|
|
125
|
-
|
126
|
-
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
117
|
+
<section class="method-section" id="public-instance-5Buntitled-5D-method-details">
|
127
118
|
<header>
|
128
119
|
<h3>Public Instance Methods</h3>
|
129
120
|
</header>
|
130
121
|
|
131
|
-
|
132
|
-
<div id="method-i-parse" class="method-detail ">
|
133
|
-
|
122
|
+
<div class="method-detail " id="method-i-parse">
|
134
123
|
<div class="method-heading">
|
135
124
|
<span class="method-name">parse</span><span
|
136
125
|
class="method-args">(value = :edrdg)</span>
|
137
|
-
|
138
126
|
<span class="method-click-advice">click to toggle source</span>
|
139
|
-
|
140
127
|
</div>
|
141
|
-
|
142
128
|
|
143
129
|
<div class="method-description">
|
144
|
-
|
145
130
|
<p>The parsable duck type interface to every parser usage.</p>
|
146
|
-
|
147
|
-
|
148
131
|
|
149
|
-
|
150
132
|
<div class="method-source-code" id="parse-source">
|
151
133
|
<pre> <span class="ruby-comment"># File lib/wwwjdic/parsers/server.rb</span>
|
152
|
-
<span class="line-num">
|
153
|
-
<span class="line-num">
|
154
|
-
<span class="line-num">
|
155
|
-
<span class="line-num">
|
156
|
-
<span class="line-num">
|
157
|
-
<span class="line-num">
|
158
|
-
<span class="line-num">
|
159
|
-
<span class="line-num">
|
134
|
+
<span class="line-num">42</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">parse</span>(<span class="ruby-identifier">value</span> = <span class="ruby-value">:edrdg</span>)
|
135
|
+
<span class="line-num">43</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-string">'error.nil'</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span>
|
136
|
+
<span class="line-num">44</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-string">'error.param'</span>, <span class="ruby-value">value:</span> <span class="ruby-identifier">value</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Symbol</span>
|
137
|
+
<span class="line-num">45</span>
|
138
|
+
<span class="line-num">46</span> <span class="ruby-identifier">raiser_array</span>(<span class="ruby-string">'error.param'</span>, <span class="ruby-identifier">value</span>, <span class="ruby-constant">URIS</span>.<span class="ruby-identifier">keys</span>)
|
139
|
+
<span class="line-num">47</span>
|
140
|
+
<span class="line-num">48</span> <span class="ruby-identifier">value</span>
|
141
|
+
<span class="line-num">49</span> <span class="ruby-keyword">end</span></pre>
|
160
142
|
</div>
|
161
|
-
|
162
143
|
</div>
|
163
144
|
|
164
|
-
|
165
145
|
|
166
|
-
|
167
146
|
</div>
|
168
147
|
|
169
|
-
|
170
148
|
</section>
|
171
|
-
|
172
|
-
</section>
|
173
149
|
|
150
|
+
</section>
|
174
151
|
</main>
|
175
152
|
|
176
153
|
|
177
154
|
<footer id="validator-badges" role="contentinfo">
|
178
155
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
179
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.
|
156
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.2.
|
180
157
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
181
158
|
</footer>
|
182
|
-
|
data/html/WWWJDic/Splitter.html
CHANGED
@@ -4,26 +4,27 @@
|
|
4
4
|
<head>
|
5
5
|
<meta charset="UTF-8">
|
6
6
|
|
7
|
-
<title>class WWWJDic::Splitter - wwwjdic
|
7
|
+
<title>class WWWJDic::Splitter - wwwjdic 16.1.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 src="../js/
|
15
|
-
<script src="../js/
|
14
|
+
<script defer src="../js/navigation.js"></script>
|
15
|
+
<script defer src="../js/search.js"></script>
|
16
|
+
<script defer src="../js/search_index.js"></script>
|
17
|
+
<script defer src="../js/searcher.js"></script>
|
18
|
+
<script defer src="../js/darkfish.js"></script>
|
16
19
|
|
17
20
|
<link href="../css/fonts.css" rel="stylesheet">
|
18
21
|
<link href="../css/rdoc.css" rel="stylesheet">
|
19
22
|
|
20
23
|
|
21
|
-
|
22
|
-
|
23
|
-
<body id="top" role="document" class="class">
|
24
|
+
<body class="class" id="top" role="document">
|
24
25
|
<nav role="navigation">
|
25
26
|
<div id="project-navigation">
|
26
|
-
<div id="home-section" role="region" title="Quick navigation"
|
27
|
+
<div class="nav-section" id="home-section" role="region" title="Quick navigation">
|
27
28
|
<h2>
|
28
29
|
<a href="../index.html" rel="home">Home</a>
|
29
30
|
</h2>
|
@@ -35,75 +36,68 @@
|
|
35
36
|
</div>
|
36
37
|
</div>
|
37
38
|
|
38
|
-
<div
|
39
|
-
<form action="#" method="get"
|
39
|
+
<div class="project-section initially-hidden" id="search-section" role="search">
|
40
|
+
<form accept-charset="utf-8" action="#" method="get">
|
40
41
|
<div id="search-field-wrapper">
|
41
|
-
<input
|
42
|
-
|
43
|
-
|
44
|
-
|
42
|
+
<input aria-autocomplete="list" aria-controls="search-results" aria-label="Search"
|
43
|
+
id="search-field" name="search"
|
44
|
+
placeholder="Search" role="combobox" spellcheck="false" title="Type to search, Up and Down to navigate, Enter to load"
|
45
|
+
type="text">
|
45
46
|
</div>
|
46
47
|
|
47
|
-
<ul
|
48
|
-
aria-
|
49
|
-
|
48
|
+
<ul aria-atomic="false" aria-busy="false"
|
49
|
+
aria-expanded="false" aria-label="Search Results"
|
50
|
+
class="initially-hidden" id="search-results"></ul>
|
50
51
|
</form>
|
51
52
|
</div>
|
52
53
|
|
53
54
|
</div>
|
54
55
|
|
55
|
-
|
56
|
+
|
56
57
|
|
57
58
|
<div id="class-metadata">
|
58
|
-
|
59
|
-
|
59
|
+
|
60
|
+
|
61
|
+
<div class="nav-section" id="parent-class-section">
|
60
62
|
<h3>Parent</h3>
|
61
63
|
|
62
|
-
|
63
64
|
<p class="link"><a href="../Object.html">Object</a>
|
64
|
-
|
65
65
|
</div>
|
66
66
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
<!-- Method Quickref -->
|
71
|
+
<div class="nav-section" id="method-list-section">
|
71
72
|
<h3>Methods</h3>
|
72
73
|
|
73
74
|
<ul class="link-list" role="directory">
|
74
|
-
|
75
75
|
<li ><a href="#method-c-new">::new</a>
|
76
|
-
|
77
76
|
<li ><a href="#method-i-content">#content</a>
|
78
|
-
|
79
77
|
<li ><a href="#method-i-lines">#lines</a>
|
80
|
-
|
81
78
|
<li ><a href="#method-i-message">#message</a>
|
82
|
-
|
83
79
|
<li ><a href="#method-i-title">#title</a>
|
84
|
-
|
85
80
|
<li ><a href="#method-i-translation">#translation</a>
|
86
|
-
|
87
81
|
</ul>
|
88
82
|
</div>
|
89
83
|
|
90
84
|
</div>
|
91
85
|
</nav>
|
92
86
|
|
93
|
-
<main
|
94
|
-
<h1 id="class-WWWJDic::Splitter"
|
87
|
+
<main aria-labelledby="class-WWWJDic::Splitter" role="main">
|
88
|
+
<h1 class="class" id="class-WWWJDic::Splitter">
|
95
89
|
class WWWJDic::Splitter
|
96
90
|
</h1>
|
97
91
|
|
98
92
|
<section class="description">
|
99
|
-
|
93
|
+
|
100
94
|
<p>This class is a simple API to interact with <a href="WWWJDic.html"><code>WWWJDic</code></a> Backboor Entry/API.</p>
|
101
95
|
<dl class="rdoc-list note-list"><dt>Author
|
102
96
|
<dd>
|
103
97
|
<p><a href="mailto:marcobresciani_1974@libero.it">Marco Bresciani</a></p>
|
104
98
|
</dd><dt>Copyright
|
105
99
|
<dd>
|
106
|
-
<p
|
100
|
+
<p>© 2014-2021 Marco Bresciani</p>
|
107
101
|
</dd><dt>License
|
108
102
|
<dd>
|
109
103
|
<p>GNU General Public License version 3</p>
|
@@ -111,36 +105,25 @@
|
|
111
105
|
|
112
106
|
</section>
|
113
107
|
|
114
|
-
|
115
|
-
<section id="5Buntitled-5D" class="documentation-section">
|
116
|
-
|
108
|
+
<section class="documentation-section" id="5Buntitled-5D">
|
117
109
|
|
118
|
-
|
119
110
|
|
120
|
-
|
121
111
|
|
122
|
-
|
123
112
|
|
124
|
-
|
125
|
-
<section id="public-class-5Buntitled-5D-method-details"
|
113
|
+
|
114
|
+
<section class="method-section" id="public-class-5Buntitled-5D-method-details">
|
126
115
|
<header>
|
127
116
|
<h3>Public Class Methods</h3>
|
128
117
|
</header>
|
129
118
|
|
130
|
-
|
131
|
-
<div id="method-c-new" class="method-detail ">
|
132
|
-
|
119
|
+
<div class="method-detail " id="method-c-new">
|
133
120
|
<div class="method-heading">
|
134
121
|
<span class="method-name">new</span><span
|
135
122
|
class="method-args">(translation)</span>
|
136
|
-
|
137
123
|
<span class="method-click-advice">click to toggle source</span>
|
138
|
-
|
139
124
|
</div>
|
140
|
-
|
141
125
|
|
142
126
|
<div class="method-description">
|
143
|
-
|
144
127
|
<p>Creates a <code>Splitter</code> object.</p>
|
145
128
|
<dl class="rdoc-list note-list"><dt>Usage
|
146
129
|
<dd>
|
@@ -149,230 +132,153 @@
|
|
149
132
|
<dd>
|
150
133
|
<p>a <code>Splitter</code> object.</p>
|
151
134
|
</dd></dl>
|
152
|
-
|
153
|
-
|
154
135
|
|
155
|
-
|
156
136
|
<div class="method-source-code" id="new-source">
|
157
137
|
<pre> <span class="ruby-comment"># File lib/wwwjdic/utils/splitter.rb</span>
|
158
|
-
<span class="line-num">
|
159
|
-
<span class="line-num">
|
160
|
-
<span class="line-num">
|
138
|
+
<span class="line-num">44</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">translation</span>)
|
139
|
+
<span class="line-num">45</span> <span class="ruby-ivar">@translation</span> = <span class="ruby-identifier">translation</span>.<span class="ruby-identifier">force_encoding</span>(<span class="ruby-string">'UTF-8'</span>)
|
140
|
+
<span class="line-num">46</span> <span class="ruby-keyword">end</span></pre>
|
161
141
|
</div>
|
162
|
-
|
163
142
|
</div>
|
164
143
|
|
165
|
-
|
166
144
|
|
167
|
-
|
168
145
|
</div>
|
169
146
|
|
170
|
-
|
171
147
|
</section>
|
172
|
-
|
173
|
-
<section id="public-instance-5Buntitled-5D-method-details"
|
148
|
+
|
149
|
+
<section class="method-section" id="public-instance-5Buntitled-5D-method-details">
|
174
150
|
<header>
|
175
151
|
<h3>Public Instance Methods</h3>
|
176
152
|
</header>
|
177
153
|
|
178
|
-
|
179
|
-
<div id="method-i-content" class="method-detail ">
|
180
|
-
|
154
|
+
<div class="method-detail " id="method-i-content">
|
181
155
|
<div class="method-heading">
|
182
156
|
<span class="method-name">content</span><span
|
183
157
|
class="method-args">()</span>
|
184
|
-
|
185
158
|
<span class="method-click-advice">click to toggle source</span>
|
186
|
-
|
187
159
|
</div>
|
188
|
-
|
189
160
|
|
190
161
|
<div class="method-description">
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
162
|
+
<p>@return [Array] the arrays of elements containing the answer</p>
|
195
163
|
|
196
|
-
|
197
164
|
<div class="method-source-code" id="content-source">
|
198
165
|
<pre> <span class="ruby-comment"># File lib/wwwjdic/utils/splitter.rb</span>
|
199
|
-
<span class="line-num">
|
200
|
-
<span class="line-num">
|
201
|
-
<span class="line-num">
|
202
|
-
<span class="line-num">
|
203
|
-
<span class="line-num">
|
204
|
-
<span class="line-num">
|
205
|
-
<span class="line-num">
|
206
|
-
<span class="line-num">
|
207
|
-
<span class="line-num">
|
208
|
-
<span class="line-num">
|
209
|
-
<span class="line-num">
|
210
|
-
<span class="line-num">74</span> <span class="ruby-identifier">inner</span>[<span class="ruby-value">:text</span>] = <span class="ruby-node">$1</span>.<span class="ruby-identifier">strip</span> <span class="ruby-keyword">if</span> <span class="ruby-regexp">/\/(.*)\//m</span>.<span class="ruby-identifier">match</span> <span class="ruby-identifier">a_line</span>
|
211
|
-
<span class="line-num">75</span> <span class="ruby-keyword">end</span>
|
212
|
-
<span class="line-num">76</span> <span class="ruby-identifier">inner</span>[<span class="ruby-value">:meanings</span>] = <span class="ruby-identifier">inner</span>[<span class="ruby-value">:text</span>].<span class="ruby-identifier">split</span>(<span class="ruby-string">'/'</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">inner</span>[<span class="ruby-value">:text</span>].<span class="ruby-identifier">include?</span> <span class="ruby-string">'/'</span>
|
213
|
-
<span class="line-num">77</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">push</span> <span class="ruby-identifier">inner</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">inner</span>.<span class="ruby-identifier">empty?</span>
|
214
|
-
<span class="line-num">78</span> <span class="ruby-keyword">end</span>
|
215
|
-
<span class="line-num">79</span>
|
216
|
-
<span class="line-num">80</span> <span class="ruby-identifier">result</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">empty?</span>
|
217
|
-
<span class="line-num">81</span> <span class="ruby-keyword">end</span></pre>
|
166
|
+
<span class="line-num">72</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">content</span>
|
167
|
+
<span class="line-num">73</span> <span class="ruby-identifier">result</span> = []
|
168
|
+
<span class="line-num">74</span> <span class="ruby-identifier">lines</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">a_line</span><span class="ruby-operator">|</span>
|
169
|
+
<span class="line-num">75</span> <span class="ruby-identifier">inner</span> = {}
|
170
|
+
<span class="line-num">76</span> <span class="ruby-identifier">fill_inner_data</span>(<span class="ruby-identifier">a_line</span>, <span class="ruby-identifier">inner</span>)
|
171
|
+
<span class="line-num">77</span> <span class="ruby-identifier">inner</span>[<span class="ruby-value">:meanings</span>] = <span class="ruby-identifier">inner</span>[<span class="ruby-value">:text</span>].<span class="ruby-identifier">split</span>(<span class="ruby-string">'/'</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">inner</span>[<span class="ruby-value">:text</span>].<span class="ruby-identifier">include?</span> <span class="ruby-string">'/'</span>
|
172
|
+
<span class="line-num">78</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">push</span> <span class="ruby-identifier">inner</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">inner</span>.<span class="ruby-identifier">empty?</span>
|
173
|
+
<span class="line-num">79</span> <span class="ruby-keyword">end</span>
|
174
|
+
<span class="line-num">80</span>
|
175
|
+
<span class="line-num">81</span> <span class="ruby-identifier">result</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">empty?</span>
|
176
|
+
<span class="line-num">82</span> <span class="ruby-keyword">end</span></pre>
|
218
177
|
</div>
|
219
|
-
|
220
178
|
</div>
|
221
179
|
|
222
|
-
|
223
180
|
|
224
|
-
|
225
181
|
</div>
|
226
182
|
|
227
|
-
|
228
|
-
<div id="method-i-lines" class="method-detail ">
|
229
|
-
|
183
|
+
<div class="method-detail " id="method-i-lines">
|
230
184
|
<div class="method-heading">
|
231
185
|
<span class="method-name">lines</span><span
|
232
186
|
class="method-args">()</span>
|
233
|
-
|
234
187
|
<span class="method-click-advice">click to toggle source</span>
|
235
|
-
|
236
188
|
</div>
|
237
|
-
|
238
189
|
|
239
190
|
<div class="method-description">
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
191
|
|
245
|
-
|
192
|
+
|
246
193
|
<div class="method-source-code" id="lines-source">
|
247
194
|
<pre> <span class="ruby-comment"># File lib/wwwjdic/utils/splitter.rb</span>
|
248
|
-
<span class="line-num">
|
249
|
-
<span class="line-num">
|
250
|
-
<span class="line-num">
|
251
|
-
<span class="line-num">
|
252
|
-
<span class="line-num">
|
253
|
-
<span class="line-num">
|
254
|
-
<span class="line-num">
|
255
|
-
<span class="line-num">
|
195
|
+
<span class="line-num">62</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">lines</span>
|
196
|
+
<span class="line-num">63</span> <span class="ruby-identifier">result</span> = []
|
197
|
+
<span class="line-num">64</span> <span class="ruby-identifier">translation</span>.<span class="ruby-identifier">each_line</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">a_line</span><span class="ruby-operator">|</span>
|
198
|
+
<span class="line-num">65</span> <span class="ruby-identifier">stripped_line</span> = <span class="ruby-identifier">a_line</span>.<span class="ruby-identifier">strip</span>
|
199
|
+
<span class="line-num">66</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">push</span> <span class="ruby-identifier">stripped_line</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">stripped_line</span>.<span class="ruby-identifier">empty?</span>
|
200
|
+
<span class="line-num">67</span> <span class="ruby-keyword">end</span>
|
201
|
+
<span class="line-num">68</span> <span class="ruby-identifier">result</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">empty?</span>
|
202
|
+
<span class="line-num">69</span> <span class="ruby-keyword">end</span></pre>
|
256
203
|
</div>
|
257
|
-
|
258
204
|
</div>
|
259
205
|
|
260
|
-
|
261
206
|
|
262
|
-
|
263
207
|
</div>
|
264
208
|
|
265
|
-
|
266
|
-
<div id="method-i-message" class="method-detail ">
|
267
|
-
|
209
|
+
<div class="method-detail " id="method-i-message">
|
268
210
|
<div class="method-heading">
|
269
211
|
<span class="method-name">message</span><span
|
270
212
|
class="method-args">()</span>
|
271
|
-
|
272
213
|
<span class="method-click-advice">click to toggle source</span>
|
273
|
-
|
274
214
|
</div>
|
275
|
-
|
276
215
|
|
277
216
|
<div class="method-description">
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
217
|
|
283
|
-
|
218
|
+
|
284
219
|
<div class="method-source-code" id="message-source">
|
285
220
|
<pre> <span class="ruby-comment"># File lib/wwwjdic/utils/splitter.rb</span>
|
286
|
-
<span class="line-num">
|
287
|
-
<span class="line-num">
|
288
|
-
<span class="line-num">
|
289
|
-
<span class="line-num">
|
221
|
+
<span class="line-num">56</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">message</span>
|
222
|
+
<span class="line-num">57</span> <span class="ruby-keyword">return</span> <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">last_match</span>(<span class="ruby-value">1</span>).<span class="ruby-identifier">strip</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@translation</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-operator">!</span><span class="ruby-regexp">/<p>(.*)<p>/m</span>.<span class="ruby-identifier">match</span>(<span class="ruby-ivar">@translation</span>)
|
223
|
+
<span class="line-num">58</span>
|
224
|
+
<span class="line-num">59</span> <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">last_match</span>(<span class="ruby-value">1</span>) <span class="ruby-keyword">if</span> <span class="ruby-ivar">@translation</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&&</span> <span class="ruby-regexp">/<p>(.*)<pre>/m</span>.<span class="ruby-identifier">match</span>(<span class="ruby-ivar">@translation</span>)
|
225
|
+
<span class="line-num">60</span> <span class="ruby-keyword">end</span></pre>
|
290
226
|
</div>
|
291
|
-
|
292
227
|
</div>
|
293
228
|
|
294
|
-
|
295
229
|
|
296
|
-
|
297
230
|
</div>
|
298
231
|
|
299
|
-
|
300
|
-
<div id="method-i-title" class="method-detail ">
|
301
|
-
|
232
|
+
<div class="method-detail " id="method-i-title">
|
302
233
|
<div class="method-heading">
|
303
234
|
<span class="method-name">title</span><span
|
304
235
|
class="method-args">()</span>
|
305
|
-
|
306
236
|
<span class="method-click-advice">click to toggle source</span>
|
307
|
-
|
308
237
|
</div>
|
309
|
-
|
310
238
|
|
311
239
|
<div class="method-description">
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
240
|
|
317
|
-
|
241
|
+
|
318
242
|
<div class="method-source-code" id="title-source">
|
319
243
|
<pre> <span class="ruby-comment"># File lib/wwwjdic/utils/splitter.rb</span>
|
320
|
-
<span class="line-num">
|
321
|
-
<span class="line-num">
|
322
|
-
<span class="line-num">
|
244
|
+
<span class="line-num">48</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">title</span>
|
245
|
+
<span class="line-num">49</span> <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">last_match</span>(<span class="ruby-value">1</span>) <span class="ruby-keyword">if</span> <span class="ruby-regexp">%r{<TITLE>(.*)</TITLE>}</span>.<span class="ruby-identifier">match</span> <span class="ruby-ivar">@translation</span>
|
246
|
+
<span class="line-num">50</span> <span class="ruby-keyword">end</span></pre>
|
323
247
|
</div>
|
324
|
-
|
325
248
|
</div>
|
326
249
|
|
327
|
-
|
328
250
|
|
329
|
-
|
330
251
|
</div>
|
331
252
|
|
332
|
-
|
333
|
-
<div id="method-i-translation" class="method-detail ">
|
334
|
-
|
253
|
+
<div class="method-detail " id="method-i-translation">
|
335
254
|
<div class="method-heading">
|
336
255
|
<span class="method-name">translation</span><span
|
337
256
|
class="method-args">()</span>
|
338
|
-
|
339
257
|
<span class="method-click-advice">click to toggle source</span>
|
340
|
-
|
341
258
|
</div>
|
342
|
-
|
343
259
|
|
344
260
|
<div class="method-description">
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
261
|
|
350
|
-
|
262
|
+
|
351
263
|
<div class="method-source-code" id="translation-source">
|
352
264
|
<pre> <span class="ruby-comment"># File lib/wwwjdic/utils/splitter.rb</span>
|
353
|
-
<span class="line-num">
|
354
|
-
<span class="line-num">
|
355
|
-
<span class="line-num">
|
265
|
+
<span class="line-num">52</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">translation</span>
|
266
|
+
<span class="line-num">53</span> <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">last_match</span>(<span class="ruby-value">1</span>).<span class="ruby-identifier">strip</span> <span class="ruby-keyword">if</span> <span class="ruby-regexp">%r{<pre>(.*)</pre>}m</span>.<span class="ruby-identifier">match</span> <span class="ruby-ivar">@translation</span>
|
267
|
+
<span class="line-num">54</span> <span class="ruby-keyword">end</span></pre>
|
356
268
|
</div>
|
357
|
-
|
358
269
|
</div>
|
359
270
|
|
360
|
-
|
361
271
|
|
362
|
-
|
363
272
|
</div>
|
364
273
|
|
365
|
-
|
366
274
|
</section>
|
367
|
-
|
368
|
-
</section>
|
369
275
|
|
276
|
+
</section>
|
370
277
|
</main>
|
371
278
|
|
372
279
|
|
373
280
|
<footer id="validator-badges" role="contentinfo">
|
374
281
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
375
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.
|
282
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.2.
|
376
283
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
377
284
|
</footer>
|
378
|
-
|