html2rss 0.4.1 → 0.5.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/.rubocop.yml +3 -0
- data/CHANGELOG.md +10 -1
- data/Gemfile.lock +3 -1
- data/README.md +35 -2
- data/html2rss.gemspec +1 -0
- data/lib/html2rss/attribute_post_processors/sanitize_html.rb +1 -3
- data/lib/html2rss/config.rb +4 -0
- data/lib/html2rss/item.rb +7 -4
- data/lib/html2rss/utils.rb +8 -0
- data/lib/html2rss/version.rb +1 -1
- metadata +15 -35
- data/docs/Html2rss.html +0 -353
- data/docs/Html2rss/AttributePostProcessors.html +0 -203
- data/docs/Html2rss/AttributePostProcessors/HtmlToMarkdown.html +0 -325
- data/docs/Html2rss/AttributePostProcessors/ParseTime.html +0 -326
- data/docs/Html2rss/AttributePostProcessors/ParseUri.html +0 -314
- data/docs/Html2rss/AttributePostProcessors/SanitizeHtml.html +0 -367
- data/docs/Html2rss/AttributePostProcessors/Substring.html +0 -321
- data/docs/Html2rss/AttributePostProcessors/Template.html +0 -336
- data/docs/Html2rss/Config.html +0 -847
- data/docs/Html2rss/FeedBuilder.html +0 -295
- data/docs/Html2rss/Item.html +0 -660
- data/docs/Html2rss/ItemExtractors.html +0 -297
- data/docs/Html2rss/ItemExtractors/Attribute.html +0 -317
- data/docs/Html2rss/ItemExtractors/CurrentTime.html +0 -297
- data/docs/Html2rss/ItemExtractors/Href.html +0 -319
- data/docs/Html2rss/ItemExtractors/Html.html +0 -314
- data/docs/Html2rss/ItemExtractors/Static.html +0 -301
- data/docs/Html2rss/ItemExtractors/Text.html +0 -312
- data/docs/Html2rss/Utils.html +0 -200
- data/docs/Html2rss/Utils/IndifferentAccessHash.html +0 -142
- data/docs/_index.html +0 -307
- data/docs/class_list.html +0 -51
- data/docs/css/common.css +0 -1
- data/docs/css/full_list.css +0 -58
- data/docs/css/style.css +0 -496
- data/docs/file.README.html +0 -135
- data/docs/file_list.html +0 -56
- data/docs/frames.html +0 -17
- data/docs/index.html +0 -135
- data/docs/js/app.js +0 -303
- data/docs/js/full_list.js +0 -216
- data/docs/js/jquery.js +0 -4
- data/docs/method_list.html +0 -467
- data/docs/top-level-namespace.html +0 -110
@@ -1,367 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta charset="utf-8">
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
-
<title>
|
7
|
-
Class: Html2rss::AttributePostProcessors::SanitizeHtml
|
8
|
-
|
9
|
-
— Documentation by YARD 0.9.20
|
10
|
-
|
11
|
-
</title>
|
12
|
-
|
13
|
-
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
14
|
-
|
15
|
-
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
16
|
-
|
17
|
-
<script type="text/javascript" charset="utf-8">
|
18
|
-
pathId = "Html2rss::AttributePostProcessors::SanitizeHtml";
|
19
|
-
relpath = '../../';
|
20
|
-
</script>
|
21
|
-
|
22
|
-
|
23
|
-
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
24
|
-
|
25
|
-
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
26
|
-
|
27
|
-
|
28
|
-
</head>
|
29
|
-
<body>
|
30
|
-
<div class="nav_wrap">
|
31
|
-
<iframe id="nav" src="../../class_list.html?1"></iframe>
|
32
|
-
<div id="resizer"></div>
|
33
|
-
</div>
|
34
|
-
|
35
|
-
<div id="main" tabindex="-1">
|
36
|
-
<div id="header">
|
37
|
-
<div id="menu">
|
38
|
-
|
39
|
-
<a href="../../_index.html">Index (S)</a> »
|
40
|
-
<span class='title'><span class='object_link'><a href="../../Html2rss.html" title="Html2rss (module)">Html2rss</a></span></span> » <span class='title'><span class='object_link'><a href="../AttributePostProcessors.html" title="Html2rss::AttributePostProcessors (module)">AttributePostProcessors</a></span></span>
|
41
|
-
»
|
42
|
-
<span class="title">SanitizeHtml</span>
|
43
|
-
|
44
|
-
</div>
|
45
|
-
|
46
|
-
<div id="search">
|
47
|
-
|
48
|
-
<a class="full_list_link" id="class_list_link"
|
49
|
-
href="../../class_list.html">
|
50
|
-
|
51
|
-
<svg width="24" height="24">
|
52
|
-
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
-
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
-
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
-
</svg>
|
56
|
-
</a>
|
57
|
-
|
58
|
-
</div>
|
59
|
-
<div class="clear"></div>
|
60
|
-
</div>
|
61
|
-
|
62
|
-
<div id="content"><h1>Class: Html2rss::AttributePostProcessors::SanitizeHtml
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
</h1>
|
67
|
-
<div class="box_info">
|
68
|
-
|
69
|
-
<dl>
|
70
|
-
<dt>Inherits:</dt>
|
71
|
-
<dd>
|
72
|
-
<span class="inheritName">Object</span>
|
73
|
-
|
74
|
-
<ul class="fullTree">
|
75
|
-
<li>Object</li>
|
76
|
-
|
77
|
-
<li class="next">Html2rss::AttributePostProcessors::SanitizeHtml</li>
|
78
|
-
|
79
|
-
</ul>
|
80
|
-
<a href="#" class="inheritanceTree">show all</a>
|
81
|
-
|
82
|
-
</dd>
|
83
|
-
</dl>
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
<dl>
|
96
|
-
<dt>Defined in:</dt>
|
97
|
-
<dd>lib/html2rss/attribute_post_processors/sanitize_html.rb</dd>
|
98
|
-
</dl>
|
99
|
-
|
100
|
-
</div>
|
101
|
-
|
102
|
-
<h2>Overview</h2><div class="docstring">
|
103
|
-
<div class="discussion">
|
104
|
-
|
105
|
-
<p>Returns sanitized HTML code as String. Adds</p>
|
106
|
-
<ul><li>
|
107
|
-
<p>rel=“nofollow noopener noreferrer” to a elements</p>
|
108
|
-
</li><li>
|
109
|
-
<p>referrer-policy='no-referrer' to img elements</p>
|
110
|
-
</li></ul>
|
111
|
-
|
112
|
-
<p>Imagine this HTML structure:</p>
|
113
|
-
|
114
|
-
<pre class="code ruby"><code class="ruby"><section>
|
115
|
-
Lorem <b>ipsum</b> dolor...
|
116
|
-
<iframe src="https://evil.corp/miner"></iframe>
|
117
|
-
<script>alert();</script>
|
118
|
-
</section>
|
119
|
-
</code></pre>
|
120
|
-
|
121
|
-
<p>YAML usage example:</p>
|
122
|
-
|
123
|
-
<pre class="code ruby"><code class="ruby">selectors:
|
124
|
-
description:
|
125
|
-
selector: section
|
126
|
-
extractor: html
|
127
|
-
post_process:
|
128
|
-
name: sanitize_html
|
129
|
-
</code></pre>
|
130
|
-
|
131
|
-
<p>Would return:</p>
|
132
|
-
|
133
|
-
<pre class="code ruby"><code class="ruby"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'><p>Lorem <b>ipsum</b> dolor ...</p></span><span class='tstring_end'>'</span></span>
|
134
|
-
</code></pre>
|
135
|
-
|
136
|
-
|
137
|
-
</div>
|
138
|
-
</div>
|
139
|
-
<div class="tags">
|
140
|
-
|
141
|
-
|
142
|
-
</div>
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
<h2>
|
151
|
-
Instance Method Summary
|
152
|
-
<small><a href="#" class="summary_toggle">collapse</a></small>
|
153
|
-
</h2>
|
154
|
-
|
155
|
-
<ul class="summary">
|
156
|
-
|
157
|
-
<li class="public ">
|
158
|
-
<span class="summary_signature">
|
159
|
-
|
160
|
-
<a href="#get-instance_method" title="#get (instance method)">#<strong>get</strong> ⇒ String </a>
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
</span>
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
<span class="summary_desc"><div class='inline'><ul><li>
|
175
|
-
<p>uses the <a href="https://github.com/rgrove/sanitize" target="_parent" title="sanitize gem">sanitize gem</a> - uses the config <a href="https://github.com/rgrove/sanitize#sanitizeconfigrelaxed" target="_parent" title="Sanitize::Config::RELAXED">Sanitize::Config::RELAXED</a> - adds rel=“nofollow noopener noreferrer” to a elements - adds target=“_blank” to a elements.</p>
|
176
|
-
</li></ul>
|
177
|
-
</div></span>
|
178
|
-
|
179
|
-
</li>
|
180
|
-
|
181
|
-
|
182
|
-
<li class="public ">
|
183
|
-
<span class="summary_signature">
|
184
|
-
|
185
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(value, env) ⇒ SanitizeHtml </a>
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
</span>
|
190
|
-
|
191
|
-
|
192
|
-
<span class="note title constructor">constructor</span>
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
<span class="summary_desc"><div class='inline'>
|
202
|
-
<p>A new instance of SanitizeHtml.</p>
|
203
|
-
</div></span>
|
204
|
-
|
205
|
-
</li>
|
206
|
-
|
207
|
-
|
208
|
-
</ul>
|
209
|
-
|
210
|
-
|
211
|
-
<div id="constructor_details" class="method_details_list">
|
212
|
-
<h2>Constructor Details</h2>
|
213
|
-
|
214
|
-
<div class="method_details first">
|
215
|
-
<h3 class="signature first" id="initialize-instance_method">
|
216
|
-
|
217
|
-
#<strong>initialize</strong>(value, env) ⇒ <tt><span class='object_link'><a href="" title="Html2rss::AttributePostProcessors::SanitizeHtml (class)">SanitizeHtml</a></span></tt>
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
</h3><div class="docstring">
|
224
|
-
<div class="discussion">
|
225
|
-
|
226
|
-
<p>Returns a new instance of SanitizeHtml</p>
|
227
|
-
|
228
|
-
|
229
|
-
</div>
|
230
|
-
</div>
|
231
|
-
<div class="tags">
|
232
|
-
|
233
|
-
|
234
|
-
</div><table class="source_code">
|
235
|
-
<tr>
|
236
|
-
<td>
|
237
|
-
<pre class="lines">
|
238
|
-
|
239
|
-
|
240
|
-
32
|
241
|
-
33
|
242
|
-
34
|
243
|
-
35</pre>
|
244
|
-
</td>
|
245
|
-
<td>
|
246
|
-
<pre class="code"><span class="info file"># File 'lib/html2rss/attribute_post_processors/sanitize_html.rb', line 32</span>
|
247
|
-
|
248
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_env'>env</span><span class='rparen'>)</span>
|
249
|
-
<span class='ivar'>@value</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
|
250
|
-
<span class='ivar'>@channel_url</span> <span class='op'>=</span> <span class='id identifier rubyid_env'>env</span><span class='lbracket'>[</span><span class='symbol'>:config</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_url'>url</span>
|
251
|
-
<span class='kw'>end</span></pre>
|
252
|
-
</td>
|
253
|
-
</tr>
|
254
|
-
</table>
|
255
|
-
</div>
|
256
|
-
|
257
|
-
</div>
|
258
|
-
|
259
|
-
|
260
|
-
<div id="instance_method_details" class="method_details_list">
|
261
|
-
<h2>Instance Method Details</h2>
|
262
|
-
|
263
|
-
|
264
|
-
<div class="method_details first">
|
265
|
-
<h3 class="signature first" id="get-instance_method">
|
266
|
-
|
267
|
-
#<strong>get</strong> ⇒ <tt>String</tt>
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
</h3><div class="docstring">
|
274
|
-
<div class="discussion">
|
275
|
-
<ul><li>
|
276
|
-
<p>uses the <a href="https://github.com/rgrove/sanitize" target="_parent" title="sanitize gem">sanitize gem</a></p>
|
277
|
-
</li><li>
|
278
|
-
<p>uses the config <a href="https://github.com/rgrove/sanitize#sanitizeconfigrelaxed" target="_parent" title="Sanitize::Config::RELAXED">Sanitize::Config::RELAXED</a></p>
|
279
|
-
</li><li>
|
280
|
-
<p>adds rel=“nofollow noopener noreferrer” to a elements</p>
|
281
|
-
</li><li>
|
282
|
-
<p>adds target=“_blank” to a elements</p>
|
283
|
-
</li></ul>
|
284
|
-
|
285
|
-
|
286
|
-
</div>
|
287
|
-
</div>
|
288
|
-
<div class="tags">
|
289
|
-
|
290
|
-
<p class="tag_title">Returns:</p>
|
291
|
-
<ul class="return">
|
292
|
-
|
293
|
-
<li>
|
294
|
-
|
295
|
-
|
296
|
-
<span class='type'>(<tt>String</tt>)</span>
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
</li>
|
301
|
-
|
302
|
-
</ul>
|
303
|
-
|
304
|
-
</div><table class="source_code">
|
305
|
-
<tr>
|
306
|
-
<td>
|
307
|
-
<pre class="lines">
|
308
|
-
|
309
|
-
|
310
|
-
43
|
311
|
-
44
|
312
|
-
45
|
313
|
-
46
|
314
|
-
47
|
315
|
-
48
|
316
|
-
49
|
317
|
-
50
|
318
|
-
51
|
319
|
-
52
|
320
|
-
53
|
321
|
-
54
|
322
|
-
55
|
323
|
-
56
|
324
|
-
57
|
325
|
-
58
|
326
|
-
59
|
327
|
-
60</pre>
|
328
|
-
</td>
|
329
|
-
<td>
|
330
|
-
<pre class="code"><span class="info file"># File 'lib/html2rss/attribute_post_processors/sanitize_html.rb', line 43</span>
|
331
|
-
|
332
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_get'>get</span>
|
333
|
-
<span class='const'>Sanitize</span><span class='period'>.</span><span class='id identifier rubyid_fragment'>fragment</span><span class='lparen'>(</span><span class='ivar'>@value</span><span class='comma'>,</span> <span class='const'>Sanitize</span><span class='op'>::</span><span class='const'>Config</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span>
|
334
|
-
<span class='const'>Sanitize</span><span class='op'>::</span><span class='const'>Config</span><span class='op'>::</span><span class='const'>RELAXED</span><span class='comma'>,</span>
|
335
|
-
<span class='label'>attributes:</span> <span class='lbrace'>{</span>
|
336
|
-
<span class='label'>all:</span> <span class='qwords_beg'>%w[</span><span class='tstring_content'>dir</span><span class='words_sep'> </span><span class='tstring_content'>lang</span><span class='words_sep'> </span><span class='tstring_content'>alt</span><span class='words_sep'> </span><span class='tstring_content'>title</span><span class='words_sep'> </span><span class='tstring_content'>translate</span><span class='tstring_end'>]</span></span>
|
337
|
-
<span class='rbrace'>}</span><span class='comma'>,</span>
|
338
|
-
<span class='label'>add_attributes:</span> <span class='lbrace'>{</span>
|
339
|
-
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>a</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
|
340
|
-
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>rel</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>nofollow noopener noreferrer</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
341
|
-
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>target</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>_blank</span><span class='tstring_end'>'</span></span>
|
342
|
-
<span class='rbrace'>}</span><span class='comma'>,</span>
|
343
|
-
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>img</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
|
344
|
-
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>referrer-policy</span><span class='tstring_end'>'</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>no-referrer</span><span class='tstring_end'>'</span></span>
|
345
|
-
<span class='rbrace'>}</span>
|
346
|
-
<span class='rbrace'>}</span><span class='comma'>,</span>
|
347
|
-
<span class='label'>transformers:</span> <span class='lbracket'>[</span><span class='id identifier rubyid_transform_urls_to_absolute_ones'>transform_urls_to_absolute_ones</span><span class='rbracket'>]</span>
|
348
|
-
<span class='rparen'>)</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> </span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
349
|
-
<span class='kw'>end</span></pre>
|
350
|
-
</td>
|
351
|
-
</tr>
|
352
|
-
</table>
|
353
|
-
</div>
|
354
|
-
|
355
|
-
</div>
|
356
|
-
|
357
|
-
</div>
|
358
|
-
|
359
|
-
<div id="footer">
|
360
|
-
Generated on Wed Sep 18 12:52:17 2019 by
|
361
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
362
|
-
0.9.20 (ruby-2.6.3).
|
363
|
-
</div>
|
364
|
-
|
365
|
-
</div>
|
366
|
-
</body>
|
367
|
-
</html>
|
@@ -1,321 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta charset="utf-8">
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
-
<title>
|
7
|
-
Class: Html2rss::AttributePostProcessors::Substring
|
8
|
-
|
9
|
-
— Documentation by YARD 0.9.20
|
10
|
-
|
11
|
-
</title>
|
12
|
-
|
13
|
-
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
14
|
-
|
15
|
-
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
16
|
-
|
17
|
-
<script type="text/javascript" charset="utf-8">
|
18
|
-
pathId = "Html2rss::AttributePostProcessors::Substring";
|
19
|
-
relpath = '../../';
|
20
|
-
</script>
|
21
|
-
|
22
|
-
|
23
|
-
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
24
|
-
|
25
|
-
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
26
|
-
|
27
|
-
|
28
|
-
</head>
|
29
|
-
<body>
|
30
|
-
<div class="nav_wrap">
|
31
|
-
<iframe id="nav" src="../../class_list.html?1"></iframe>
|
32
|
-
<div id="resizer"></div>
|
33
|
-
</div>
|
34
|
-
|
35
|
-
<div id="main" tabindex="-1">
|
36
|
-
<div id="header">
|
37
|
-
<div id="menu">
|
38
|
-
|
39
|
-
<a href="../../_index.html">Index (S)</a> »
|
40
|
-
<span class='title'><span class='object_link'><a href="../../Html2rss.html" title="Html2rss (module)">Html2rss</a></span></span> » <span class='title'><span class='object_link'><a href="../AttributePostProcessors.html" title="Html2rss::AttributePostProcessors (module)">AttributePostProcessors</a></span></span>
|
41
|
-
»
|
42
|
-
<span class="title">Substring</span>
|
43
|
-
|
44
|
-
</div>
|
45
|
-
|
46
|
-
<div id="search">
|
47
|
-
|
48
|
-
<a class="full_list_link" id="class_list_link"
|
49
|
-
href="../../class_list.html">
|
50
|
-
|
51
|
-
<svg width="24" height="24">
|
52
|
-
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
-
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
-
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
-
</svg>
|
56
|
-
</a>
|
57
|
-
|
58
|
-
</div>
|
59
|
-
<div class="clear"></div>
|
60
|
-
</div>
|
61
|
-
|
62
|
-
<div id="content"><h1>Class: Html2rss::AttributePostProcessors::Substring
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
</h1>
|
67
|
-
<div class="box_info">
|
68
|
-
|
69
|
-
<dl>
|
70
|
-
<dt>Inherits:</dt>
|
71
|
-
<dd>
|
72
|
-
<span class="inheritName">Object</span>
|
73
|
-
|
74
|
-
<ul class="fullTree">
|
75
|
-
<li>Object</li>
|
76
|
-
|
77
|
-
<li class="next">Html2rss::AttributePostProcessors::Substring</li>
|
78
|
-
|
79
|
-
</ul>
|
80
|
-
<a href="#" class="inheritanceTree">show all</a>
|
81
|
-
|
82
|
-
</dd>
|
83
|
-
</dl>
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
<dl>
|
96
|
-
<dt>Defined in:</dt>
|
97
|
-
<dd>lib/html2rss/attribute_post_processors/substring.rb</dd>
|
98
|
-
</dl>
|
99
|
-
|
100
|
-
</div>
|
101
|
-
|
102
|
-
<h2>Overview</h2><div class="docstring">
|
103
|
-
<div class="discussion">
|
104
|
-
|
105
|
-
<p>Returns a defined part of a String.</p>
|
106
|
-
|
107
|
-
<p>The <code>end</code> parameter can be omitted, in that case it will not cut the String at the end.</p>
|
108
|
-
|
109
|
-
<p>Imagine this HTML:</p>
|
110
|
-
|
111
|
-
<pre class="code ruby"><code class="ruby"><h1>Foo bar and baz<h1>
|
112
|
-
</code></pre>
|
113
|
-
|
114
|
-
<p>YAML usage example:</p>
|
115
|
-
|
116
|
-
<pre class="code ruby"><code class="ruby">selectors:
|
117
|
-
title:
|
118
|
-
selector: h1
|
119
|
-
post_process:
|
120
|
-
name: substring
|
121
|
-
start: 4
|
122
|
-
end: 6
|
123
|
-
</code></pre>
|
124
|
-
|
125
|
-
<p>Would return:</p>
|
126
|
-
|
127
|
-
<pre class="code ruby"><code class="ruby"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>bar</span><span class='tstring_end'>'</span></span>
|
128
|
-
</code></pre>
|
129
|
-
|
130
|
-
|
131
|
-
</div>
|
132
|
-
</div>
|
133
|
-
<div class="tags">
|
134
|
-
|
135
|
-
|
136
|
-
</div>
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
<h2>
|
145
|
-
Instance Method Summary
|
146
|
-
<small><a href="#" class="summary_toggle">collapse</a></small>
|
147
|
-
</h2>
|
148
|
-
|
149
|
-
<ul class="summary">
|
150
|
-
|
151
|
-
<li class="public ">
|
152
|
-
<span class="summary_signature">
|
153
|
-
|
154
|
-
<a href="#get-instance_method" title="#get (instance method)">#<strong>get</strong> ⇒ String </a>
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
</span>
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
169
|
-
|
170
|
-
</li>
|
171
|
-
|
172
|
-
|
173
|
-
<li class="public ">
|
174
|
-
<span class="summary_signature">
|
175
|
-
|
176
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(value, env) ⇒ Substring </a>
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
</span>
|
181
|
-
|
182
|
-
|
183
|
-
<span class="note title constructor">constructor</span>
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
<span class="summary_desc"><div class='inline'>
|
193
|
-
<p>A new instance of Substring.</p>
|
194
|
-
</div></span>
|
195
|
-
|
196
|
-
</li>
|
197
|
-
|
198
|
-
|
199
|
-
</ul>
|
200
|
-
|
201
|
-
|
202
|
-
<div id="constructor_details" class="method_details_list">
|
203
|
-
<h2>Constructor Details</h2>
|
204
|
-
|
205
|
-
<div class="method_details first">
|
206
|
-
<h3 class="signature first" id="initialize-instance_method">
|
207
|
-
|
208
|
-
#<strong>initialize</strong>(value, env) ⇒ <tt><span class='object_link'><a href="" title="Html2rss::AttributePostProcessors::Substring (class)">Substring</a></span></tt>
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
</h3><div class="docstring">
|
215
|
-
<div class="discussion">
|
216
|
-
|
217
|
-
<p>Returns a new instance of Substring</p>
|
218
|
-
|
219
|
-
|
220
|
-
</div>
|
221
|
-
</div>
|
222
|
-
<div class="tags">
|
223
|
-
|
224
|
-
|
225
|
-
</div><table class="source_code">
|
226
|
-
<tr>
|
227
|
-
<td>
|
228
|
-
<pre class="lines">
|
229
|
-
|
230
|
-
|
231
|
-
23
|
232
|
-
24
|
233
|
-
25
|
234
|
-
26</pre>
|
235
|
-
</td>
|
236
|
-
<td>
|
237
|
-
<pre class="code"><span class="info file"># File 'lib/html2rss/attribute_post_processors/substring.rb', line 23</span>
|
238
|
-
|
239
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_env'>env</span><span class='rparen'>)</span>
|
240
|
-
<span class='ivar'>@value</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
|
241
|
-
<span class='ivar'>@options</span> <span class='op'>=</span> <span class='id identifier rubyid_env'>env</span><span class='lbracket'>[</span><span class='symbol'>:options</span><span class='rbracket'>]</span>
|
242
|
-
<span class='kw'>end</span></pre>
|
243
|
-
</td>
|
244
|
-
</tr>
|
245
|
-
</table>
|
246
|
-
</div>
|
247
|
-
|
248
|
-
</div>
|
249
|
-
|
250
|
-
|
251
|
-
<div id="instance_method_details" class="method_details_list">
|
252
|
-
<h2>Instance Method Details</h2>
|
253
|
-
|
254
|
-
|
255
|
-
<div class="method_details first">
|
256
|
-
<h3 class="signature first" id="get-instance_method">
|
257
|
-
|
258
|
-
#<strong>get</strong> ⇒ <tt>String</tt>
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
</h3><div class="docstring">
|
265
|
-
<div class="discussion">
|
266
|
-
|
267
|
-
|
268
|
-
</div>
|
269
|
-
</div>
|
270
|
-
<div class="tags">
|
271
|
-
|
272
|
-
<p class="tag_title">Returns:</p>
|
273
|
-
<ul class="return">
|
274
|
-
|
275
|
-
<li>
|
276
|
-
|
277
|
-
|
278
|
-
<span class='type'>(<tt>String</tt>)</span>
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
</li>
|
283
|
-
|
284
|
-
</ul>
|
285
|
-
|
286
|
-
</div><table class="source_code">
|
287
|
-
<tr>
|
288
|
-
<td>
|
289
|
-
<pre class="lines">
|
290
|
-
|
291
|
-
|
292
|
-
30
|
293
|
-
31
|
294
|
-
32
|
295
|
-
33</pre>
|
296
|
-
</td>
|
297
|
-
<td>
|
298
|
-
<pre class="code"><span class="info file"># File 'lib/html2rss/attribute_post_processors/substring.rb', line 30</span>
|
299
|
-
|
300
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_get'>get</span>
|
301
|
-
<span class='id identifier rubyid_ending'>ending</span> <span class='op'>=</span> <span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>end</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='ivar'>@value</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
|
302
|
-
<span class='ivar'>@value</span><span class='lbracket'>[</span><span class='ivar'>@options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>start</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='op'>..</span><span class='id identifier rubyid_ending'>ending</span><span class='rbracket'>]</span>
|
303
|
-
<span class='kw'>end</span></pre>
|
304
|
-
</td>
|
305
|
-
</tr>
|
306
|
-
</table>
|
307
|
-
</div>
|
308
|
-
|
309
|
-
</div>
|
310
|
-
|
311
|
-
</div>
|
312
|
-
|
313
|
-
<div id="footer">
|
314
|
-
Generated on Wed Sep 18 12:52:16 2019 by
|
315
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
316
|
-
0.9.20 (ruby-2.6.3).
|
317
|
-
</div>
|
318
|
-
|
319
|
-
</div>
|
320
|
-
</body>
|
321
|
-
</html>
|