mbrao 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +6 -0
- data/.travis-gemfile +13 -0
- data/.travis.yml +8 -0
- data/.yardopts +1 -0
- data/Gemfile +21 -0
- data/README.md +60 -0
- data/Rakefile +11 -0
- data/doc/ActionView/Template/Handlers/MbraoTemplate.html +568 -0
- data/doc/ActionView/Template/Handlers.html +125 -0
- data/doc/HTML/Pipeline/KramdownFilter.html +354 -0
- data/doc/HTML/Pipeline.html +140 -0
- data/doc/HTML.html +125 -0
- data/doc/Mbrao/Author.html +1402 -0
- data/doc/Mbrao/Content.html +4779 -0
- data/doc/Mbrao/ContentPublicInterface.html +658 -0
- data/doc/Mbrao/Exceptions/InvalidDate.html +133 -0
- data/doc/Mbrao/Exceptions/InvalidMetadata.html +133 -0
- data/doc/Mbrao/Exceptions/Parsing.html +133 -0
- data/doc/Mbrao/Exceptions/Rendering.html +133 -0
- data/doc/Mbrao/Exceptions/UnavailableLocalization.html +133 -0
- data/doc/Mbrao/Exceptions/Unimplemented.html +133 -0
- data/doc/Mbrao/Exceptions/UnknownEngine.html +133 -0
- data/doc/Mbrao/Exceptions.html +125 -0
- data/doc/Mbrao/Parser.html +418 -0
- data/doc/Mbrao/ParsingEngines/Base.html +658 -0
- data/doc/Mbrao/ParsingEngines/PlainText.html +571 -0
- data/doc/Mbrao/ParsingEngines.html +127 -0
- data/doc/Mbrao/PublicInterface/ClassMethods.html +1727 -0
- data/doc/Mbrao/PublicInterface.html +134 -0
- data/doc/Mbrao/RenderingEngines/Base.html +280 -0
- data/doc/Mbrao/RenderingEngines/HtmlPipeline.html +873 -0
- data/doc/Mbrao/RenderingEngines.html +127 -0
- data/doc/Mbrao/Validations/ClassMethods.html +692 -0
- data/doc/Mbrao/Validations.html +134 -0
- data/doc/Mbrao/Version.html +189 -0
- data/doc/Mbrao.html +130 -0
- data/doc/_index.html +395 -0
- data/doc/class_list.html +53 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +338 -0
- data/doc/file.README.html +135 -0
- data/doc/file_list.html +55 -0
- data/doc/frames.html +28 -0
- data/doc/index.html +135 -0
- data/doc/js/app.js +214 -0
- data/doc/js/full_list.js +173 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +516 -0
- data/doc/top-level-namespace.html +112 -0
- data/lib/mbrao/author.rb +61 -0
- data/lib/mbrao/content.rb +300 -0
- data/lib/mbrao/exceptions.rb +38 -0
- data/lib/mbrao/integrations/rails.rb +51 -0
- data/lib/mbrao/parser.rb +276 -0
- data/lib/mbrao/parsing_engines/base.rb +51 -0
- data/lib/mbrao/parsing_engines/plain_text.rb +187 -0
- data/lib/mbrao/rendering_engines/base.rb +22 -0
- data/lib/mbrao/rendering_engines/html_pipeline.rb +147 -0
- data/lib/mbrao/version.rb +25 -0
- data/lib/mbrao.rb +24 -0
- data/mbrao.gemspec +31 -0
- data/spec/coverage_helper.rb +17 -0
- data/spec/mbrao/author_spec.rb +62 -0
- data/spec/mbrao/content_spec.rb +280 -0
- data/spec/mbrao/integrations/rails_spec.rb +92 -0
- data/spec/mbrao/parser_spec.rb +269 -0
- data/spec/mbrao/parsing_engines/base_spec.rb +52 -0
- data/spec/mbrao/parsing_engines/plain_text_spec.rb +141 -0
- data/spec/mbrao/rendering_engines/base_spec.rb +17 -0
- data/spec/mbrao/rendering_engines/html_pipeline_spec.rb +128 -0
- data/spec/spec_helper.rb +15 -0
- metadata +195 -0
@@ -0,0 +1,658 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Class: Mbrao::ParsingEngines::Base
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.5.2
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../../';
|
20
|
+
framesUrl = "../../frames.html#!" + escape(window.location.href);
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../../_index.html">Index (B)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../../Mbrao.html" title="Mbrao (module)">Mbrao</a></span></span> » <span class='title'><span class='object_link'><a href="../ParsingEngines.html" title="Mbrao::ParsingEngines (module)">ParsingEngines</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">Base</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Class: Mbrao::ParsingEngines::Base
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
<dt class="r1">Inherits:</dt>
|
75
|
+
<dd class="r1">
|
76
|
+
<span class="inheritName">Object</span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next">Mbrao::ParsingEngines::Base</li>
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
85
|
+
|
86
|
+
</dd>
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
<dt class="r2 last">Defined in:</dt>
|
97
|
+
<dd class="r2 last">lib/mbrao/parsing_engines/base.rb</dd>
|
98
|
+
|
99
|
+
</dl>
|
100
|
+
<div class="clear"></div>
|
101
|
+
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
<p>A base class for all parsers.</p>
|
105
|
+
|
106
|
+
|
107
|
+
</div>
|
108
|
+
</div>
|
109
|
+
<div class="tags">
|
110
|
+
|
111
|
+
|
112
|
+
</div><div id="subclasses">
|
113
|
+
<h2>Direct Known Subclasses</h2>
|
114
|
+
<p class="children"><span class='object_link'><a href="PlainText.html" title="Mbrao::ParsingEngines::PlainText (class)">PlainText</a></span></p>
|
115
|
+
</div>
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
<h2>
|
125
|
+
Instance Method Summary
|
126
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
127
|
+
</h2>
|
128
|
+
|
129
|
+
<ul class="summary">
|
130
|
+
|
131
|
+
<li class="public ">
|
132
|
+
<span class="summary_signature">
|
133
|
+
|
134
|
+
<a href="#filter_content-instance_method" title="#filter_content (instance method)">- (String|HashWithIndifferentAccess) <strong>filter_content</strong>(content, locales = [], options = {}) </a>
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
</span>
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
<span class="summary_desc"><div class='inline'><p>Filters content of a post by locale.</p>
|
149
|
+
</div></span>
|
150
|
+
|
151
|
+
</li>
|
152
|
+
|
153
|
+
|
154
|
+
<li class="public ">
|
155
|
+
<span class="summary_signature">
|
156
|
+
|
157
|
+
<a href="#parse-instance_method" title="#parse (instance method)">- (Object) <strong>parse</strong>(content, options = {}) </a>
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
</span>
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
<span class="summary_desc"><div class='inline'><p>Parses a content and return a <span class='object_link'><a href="../Content.html" title="Mbrao::Content (class)">Content</a></span> object.</p>
|
172
|
+
</div></span>
|
173
|
+
|
174
|
+
</li>
|
175
|
+
|
176
|
+
|
177
|
+
<li class="public ">
|
178
|
+
<span class="summary_signature">
|
179
|
+
|
180
|
+
<a href="#parse_metadata-instance_method" title="#parse_metadata (instance method)">- (Hash) <strong>parse_metadata</strong>(content, options = {}) </a>
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
</span>
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
<span class="summary_desc"><div class='inline'><p>Parses metadata part and returns all valid metadata.</p>
|
195
|
+
</div></span>
|
196
|
+
|
197
|
+
</li>
|
198
|
+
|
199
|
+
|
200
|
+
<li class="public ">
|
201
|
+
<span class="summary_signature">
|
202
|
+
|
203
|
+
<a href="#separate_components-instance_method" title="#separate_components (instance method)">- (Array) <strong>separate_components</strong>(content, options = {}) </a>
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
</span>
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
<span class="summary_desc"><div class='inline'><p>Parses a whole post content and return its metadata and content parts.</p>
|
218
|
+
</div></span>
|
219
|
+
|
220
|
+
</li>
|
221
|
+
|
222
|
+
|
223
|
+
</ul>
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
<div id="instance_method_details" class="method_details_list">
|
229
|
+
<h2>Instance Method Details</h2>
|
230
|
+
|
231
|
+
|
232
|
+
<div class="method_details first">
|
233
|
+
<h3 class="signature first" id="filter_content-instance_method">
|
234
|
+
|
235
|
+
- (<tt>String|HashWithIndifferentAccess</tt>) <strong>filter_content</strong>(content, locales = [], options = {})
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
</h3><div class="docstring">
|
242
|
+
<div class="discussion">
|
243
|
+
<p>Filters content of a post by locale.</p>
|
244
|
+
|
245
|
+
|
246
|
+
</div>
|
247
|
+
</div>
|
248
|
+
<div class="tags">
|
249
|
+
<p class="tag_title">Parameters:</p>
|
250
|
+
<ul class="param">
|
251
|
+
|
252
|
+
<li>
|
253
|
+
|
254
|
+
<span class='name'>content</span>
|
255
|
+
|
256
|
+
|
257
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Content.html" title="Mbrao::Content (class)">Content</a></span></tt>)</span>
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
—
|
262
|
+
<div class='inline'><p>The content to filter.</p>
|
263
|
+
</div>
|
264
|
+
|
265
|
+
</li>
|
266
|
+
|
267
|
+
<li>
|
268
|
+
|
269
|
+
<span class='name'>locales</span>
|
270
|
+
|
271
|
+
|
272
|
+
<span class='type'>(<tt>String|Array</tt>)</span>
|
273
|
+
|
274
|
+
|
275
|
+
<em class="default">(defaults to: <tt>[]</tt>)</em>
|
276
|
+
|
277
|
+
|
278
|
+
—
|
279
|
+
<div class='inline'><p>The desired locales. Can include <code>*</code> to match all.</p>
|
280
|
+
</div>
|
281
|
+
|
282
|
+
</li>
|
283
|
+
|
284
|
+
<li>
|
285
|
+
|
286
|
+
<span class='name'>options</span>
|
287
|
+
|
288
|
+
|
289
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
290
|
+
|
291
|
+
|
292
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
293
|
+
|
294
|
+
|
295
|
+
—
|
296
|
+
<div class='inline'><p>Options to customize parsing.</p>
|
297
|
+
</div>
|
298
|
+
|
299
|
+
</li>
|
300
|
+
|
301
|
+
</ul>
|
302
|
+
|
303
|
+
<p class="tag_title">Returns:</p>
|
304
|
+
<ul class="return">
|
305
|
+
|
306
|
+
<li>
|
307
|
+
|
308
|
+
|
309
|
+
<span class='type'>(<tt>String|HashWithIndifferentAccess</tt>)</span>
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
—
|
314
|
+
<div class='inline'><p>Return the filtered content in the desired locales. If only one locale is required, then a <code>String</code> is returned, else a <code>HashWithIndifferentAccess</code> with locales as keys.</p>
|
315
|
+
</div>
|
316
|
+
|
317
|
+
</li>
|
318
|
+
|
319
|
+
</ul>
|
320
|
+
<p class="tag_title">Raises:</p>
|
321
|
+
<ul class="raise">
|
322
|
+
|
323
|
+
<li>
|
324
|
+
|
325
|
+
|
326
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Exceptions/Unimplemented.html" title="Mbrao::Exceptions::Unimplemented (class)">Mbrao::Exceptions::Unimplemented</a></span></tt>)</span>
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
</li>
|
331
|
+
|
332
|
+
</ul>
|
333
|
+
|
334
|
+
</div><table class="source_code">
|
335
|
+
<tr>
|
336
|
+
<td>
|
337
|
+
<pre class="lines">
|
338
|
+
|
339
|
+
|
340
|
+
36
|
341
|
+
37
|
342
|
+
38</pre>
|
343
|
+
</td>
|
344
|
+
<td>
|
345
|
+
<pre class="code"><span class="info file"># File 'lib/mbrao/parsing_engines/base.rb', line 36</span>
|
346
|
+
|
347
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_filter_content'>filter_content</span><span class='lparen'>(</span><span class='id identifier rubyid_content'>content</span><span class='comma'>,</span> <span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
348
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>Unimplemented</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
349
|
+
<span class='kw'>end</span></pre>
|
350
|
+
</td>
|
351
|
+
</tr>
|
352
|
+
</table>
|
353
|
+
</div>
|
354
|
+
|
355
|
+
<div class="method_details ">
|
356
|
+
<h3 class="signature " id="parse-instance_method">
|
357
|
+
|
358
|
+
- (<tt>Object</tt>) <strong>parse</strong>(content, options = {})
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
|
364
|
+
</h3><div class="docstring">
|
365
|
+
<div class="discussion">
|
366
|
+
<p>Parses a content and return a <span class='object_link'><a href="../Content.html" title="Mbrao::Content (class)">Content</a></span> object.</p>
|
367
|
+
|
368
|
+
|
369
|
+
</div>
|
370
|
+
</div>
|
371
|
+
<div class="tags">
|
372
|
+
<p class="tag_title">Parameters:</p>
|
373
|
+
<ul class="param">
|
374
|
+
|
375
|
+
<li>
|
376
|
+
|
377
|
+
<span class='name'>content</span>
|
378
|
+
|
379
|
+
|
380
|
+
<span class='type'>(<tt>Object</tt>)</span>
|
381
|
+
|
382
|
+
|
383
|
+
|
384
|
+
—
|
385
|
+
<div class='inline'><p>The content to parse.</p>
|
386
|
+
</div>
|
387
|
+
|
388
|
+
</li>
|
389
|
+
|
390
|
+
<li>
|
391
|
+
|
392
|
+
<span class='name'>options</span>
|
393
|
+
|
394
|
+
|
395
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
396
|
+
|
397
|
+
|
398
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
399
|
+
|
400
|
+
|
401
|
+
—
|
402
|
+
<div class='inline'><p>Options to customize parsing.</p>
|
403
|
+
</div>
|
404
|
+
|
405
|
+
</li>
|
406
|
+
|
407
|
+
</ul>
|
408
|
+
|
409
|
+
|
410
|
+
</div><table class="source_code">
|
411
|
+
<tr>
|
412
|
+
<td>
|
413
|
+
<pre class="lines">
|
414
|
+
|
415
|
+
|
416
|
+
44
|
417
|
+
45
|
418
|
+
46
|
419
|
+
47
|
420
|
+
48</pre>
|
421
|
+
</td>
|
422
|
+
<td>
|
423
|
+
<pre class="code"><span class="info file"># File 'lib/mbrao/parsing_engines/base.rb', line 44</span>
|
424
|
+
|
425
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_content'>content</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
426
|
+
<span class='id identifier rubyid_metadata'>metadata</span><span class='comma'>,</span> <span class='id identifier rubyid_body'>body</span> <span class='op'>=</span> <span class='id identifier rubyid_separate_components'>separate_components</span><span class='lparen'>(</span><span class='id identifier rubyid_content'>content</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
427
|
+
<span class='id identifier rubyid_metadata'>metadata</span> <span class='op'>=</span> <span class='id identifier rubyid_parse_metadata'>parse_metadata</span><span class='lparen'>(</span><span class='id identifier rubyid_metadata'>metadata</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
428
|
+
<span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Content</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_metadata'>metadata</span><span class='comma'>,</span> <span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span>
|
429
|
+
<span class='kw'>end</span></pre>
|
430
|
+
</td>
|
431
|
+
</tr>
|
432
|
+
</table>
|
433
|
+
</div>
|
434
|
+
|
435
|
+
<div class="method_details ">
|
436
|
+
<h3 class="signature " id="parse_metadata-instance_method">
|
437
|
+
|
438
|
+
- (<tt>Hash</tt>) <strong>parse_metadata</strong>(content, options = {})
|
439
|
+
|
440
|
+
|
441
|
+
|
442
|
+
|
443
|
+
|
444
|
+
</h3><div class="docstring">
|
445
|
+
<div class="discussion">
|
446
|
+
<p>Parses metadata part and returns all valid metadata.</p>
|
447
|
+
|
448
|
+
|
449
|
+
</div>
|
450
|
+
</div>
|
451
|
+
<div class="tags">
|
452
|
+
<p class="tag_title">Parameters:</p>
|
453
|
+
<ul class="param">
|
454
|
+
|
455
|
+
<li>
|
456
|
+
|
457
|
+
<span class='name'>content</span>
|
458
|
+
|
459
|
+
|
460
|
+
<span class='type'>(<tt>Object</tt>)</span>
|
461
|
+
|
462
|
+
|
463
|
+
|
464
|
+
—
|
465
|
+
<div class='inline'><p>The content to parse.</p>
|
466
|
+
</div>
|
467
|
+
|
468
|
+
</li>
|
469
|
+
|
470
|
+
<li>
|
471
|
+
|
472
|
+
<span class='name'>options</span>
|
473
|
+
|
474
|
+
|
475
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
476
|
+
|
477
|
+
|
478
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
479
|
+
|
480
|
+
|
481
|
+
—
|
482
|
+
<div class='inline'><p>Options to customize parsing.</p>
|
483
|
+
</div>
|
484
|
+
|
485
|
+
</li>
|
486
|
+
|
487
|
+
</ul>
|
488
|
+
|
489
|
+
<p class="tag_title">Returns:</p>
|
490
|
+
<ul class="return">
|
491
|
+
|
492
|
+
<li>
|
493
|
+
|
494
|
+
|
495
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
496
|
+
|
497
|
+
|
498
|
+
|
499
|
+
—
|
500
|
+
<div class='inline'><p>All valid metadata for the content.</p>
|
501
|
+
</div>
|
502
|
+
|
503
|
+
</li>
|
504
|
+
|
505
|
+
</ul>
|
506
|
+
<p class="tag_title">Raises:</p>
|
507
|
+
<ul class="raise">
|
508
|
+
|
509
|
+
<li>
|
510
|
+
|
511
|
+
|
512
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Exceptions/Unimplemented.html" title="Mbrao::Exceptions::Unimplemented (class)">Mbrao::Exceptions::Unimplemented</a></span></tt>)</span>
|
513
|
+
|
514
|
+
|
515
|
+
|
516
|
+
</li>
|
517
|
+
|
518
|
+
</ul>
|
519
|
+
|
520
|
+
</div><table class="source_code">
|
521
|
+
<tr>
|
522
|
+
<td>
|
523
|
+
<pre class="lines">
|
524
|
+
|
525
|
+
|
526
|
+
26
|
527
|
+
27
|
528
|
+
28</pre>
|
529
|
+
</td>
|
530
|
+
<td>
|
531
|
+
<pre class="code"><span class="info file"># File 'lib/mbrao/parsing_engines/base.rb', line 26</span>
|
532
|
+
|
533
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_parse_metadata'>parse_metadata</span><span class='lparen'>(</span><span class='id identifier rubyid_content'>content</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
534
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>Unimplemented</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
535
|
+
<span class='kw'>end</span></pre>
|
536
|
+
</td>
|
537
|
+
</tr>
|
538
|
+
</table>
|
539
|
+
</div>
|
540
|
+
|
541
|
+
<div class="method_details ">
|
542
|
+
<h3 class="signature " id="separate_components-instance_method">
|
543
|
+
|
544
|
+
- (<tt>Array</tt>) <strong>separate_components</strong>(content, options = {})
|
545
|
+
|
546
|
+
|
547
|
+
|
548
|
+
|
549
|
+
|
550
|
+
</h3><div class="docstring">
|
551
|
+
<div class="discussion">
|
552
|
+
<p>Parses a whole post content and return its metadata and content parts.</p>
|
553
|
+
|
554
|
+
|
555
|
+
</div>
|
556
|
+
</div>
|
557
|
+
<div class="tags">
|
558
|
+
<p class="tag_title">Parameters:</p>
|
559
|
+
<ul class="param">
|
560
|
+
|
561
|
+
<li>
|
562
|
+
|
563
|
+
<span class='name'>content</span>
|
564
|
+
|
565
|
+
|
566
|
+
<span class='type'>(<tt>Object</tt>)</span>
|
567
|
+
|
568
|
+
|
569
|
+
|
570
|
+
—
|
571
|
+
<div class='inline'><p>The content to parse.</p>
|
572
|
+
</div>
|
573
|
+
|
574
|
+
</li>
|
575
|
+
|
576
|
+
<li>
|
577
|
+
|
578
|
+
<span class='name'>options</span>
|
579
|
+
|
580
|
+
|
581
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
582
|
+
|
583
|
+
|
584
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
585
|
+
|
586
|
+
|
587
|
+
—
|
588
|
+
<div class='inline'><p>Options to customize parsing.</p>
|
589
|
+
</div>
|
590
|
+
|
591
|
+
</li>
|
592
|
+
|
593
|
+
</ul>
|
594
|
+
|
595
|
+
<p class="tag_title">Returns:</p>
|
596
|
+
<ul class="return">
|
597
|
+
|
598
|
+
<li>
|
599
|
+
|
600
|
+
|
601
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
602
|
+
|
603
|
+
|
604
|
+
|
605
|
+
—
|
606
|
+
<div class='inline'><p>An array of metadata and contents parts.</p>
|
607
|
+
</div>
|
608
|
+
|
609
|
+
</li>
|
610
|
+
|
611
|
+
</ul>
|
612
|
+
<p class="tag_title">Raises:</p>
|
613
|
+
<ul class="raise">
|
614
|
+
|
615
|
+
<li>
|
616
|
+
|
617
|
+
|
618
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Exceptions/Unimplemented.html" title="Mbrao::Exceptions::Unimplemented (class)">Mbrao::Exceptions::Unimplemented</a></span></tt>)</span>
|
619
|
+
|
620
|
+
|
621
|
+
|
622
|
+
</li>
|
623
|
+
|
624
|
+
</ul>
|
625
|
+
|
626
|
+
</div><table class="source_code">
|
627
|
+
<tr>
|
628
|
+
<td>
|
629
|
+
<pre class="lines">
|
630
|
+
|
631
|
+
|
632
|
+
17
|
633
|
+
18
|
634
|
+
19</pre>
|
635
|
+
</td>
|
636
|
+
<td>
|
637
|
+
<pre class="code"><span class="info file"># File 'lib/mbrao/parsing_engines/base.rb', line 17</span>
|
638
|
+
|
639
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_separate_components'>separate_components</span><span class='lparen'>(</span><span class='id identifier rubyid_content'>content</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
640
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>Unimplemented</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
641
|
+
<span class='kw'>end</span></pre>
|
642
|
+
</td>
|
643
|
+
</tr>
|
644
|
+
</table>
|
645
|
+
</div>
|
646
|
+
|
647
|
+
</div>
|
648
|
+
|
649
|
+
</div>
|
650
|
+
|
651
|
+
<div id="footer">
|
652
|
+
Generated on Fri Mar 1 09:13:32 2013 by
|
653
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
654
|
+
0.8.5.2 (ruby-1.9.3).
|
655
|
+
</div>
|
656
|
+
|
657
|
+
</body>
|
658
|
+
</html>
|