mbrao 1.2.3 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/CHANGELOG.md +5 -0
- data/doc/ActionView/Template/Handlers/MbraoTemplate.html +87 -20
- data/doc/ActionView/Template/Handlers.html +1 -1
- data/doc/HTML/Pipeline/KramdownFilter.html +1 -1
- data/doc/HTML/Pipeline.html +1 -1
- data/doc/HTML.html +1 -1
- data/doc/Mbrao/Author.html +337 -67
- data/doc/Mbrao/Content.html +1268 -444
- data/doc/Mbrao/ContentPublicInterface.html +24 -20
- data/doc/Mbrao/Exceptions/InvalidDate.html +1 -1
- data/doc/Mbrao/Exceptions/InvalidMetadata.html +1 -1
- data/doc/Mbrao/Exceptions/Parsing.html +1 -1
- data/doc/Mbrao/Exceptions/Rendering.html +1 -1
- data/doc/Mbrao/Exceptions/UnavailableLocalization.html +1 -1
- data/doc/Mbrao/Exceptions/Unimplemented.html +1 -1
- data/doc/Mbrao/Exceptions/UnknownEngine.html +1 -1
- data/doc/Mbrao/Exceptions.html +1 -1
- data/doc/Mbrao/Parser.html +11 -11
- data/doc/Mbrao/ParsingEngines/Base.html +25 -24
- data/doc/Mbrao/ParsingEngines/PlainText.html +17 -16
- data/doc/Mbrao/ParsingEngines.html +1 -1
- data/doc/Mbrao/PublicInterface/ClassMethods.html +312 -19
- data/doc/Mbrao/PublicInterface.html +1 -1
- data/doc/Mbrao/RenderingEngines/Base.html +7 -7
- data/doc/Mbrao/RenderingEngines/HtmlPipeline.html +27 -15
- data/doc/Mbrao/RenderingEngines.html +1 -1
- data/doc/Mbrao/Validations/ClassMethods.html +21 -21
- data/doc/Mbrao/Validations.html +1 -1
- data/doc/Mbrao/Version.html +3 -3
- data/doc/Mbrao.html +1 -1
- data/doc/_index.html +1 -1
- data/doc/file.README.html +1 -1
- data/doc/index.html +1 -1
- data/doc/method_list.html +86 -62
- data/doc/top-level-namespace.html +1 -1
- data/lib/mbrao/author.rb +18 -4
- data/lib/mbrao/content.rb +93 -44
- data/lib/mbrao/integrations/rails.rb +12 -5
- data/lib/mbrao/parser.rb +23 -0
- data/lib/mbrao/parsing_engines/base.rb +12 -11
- data/lib/mbrao/parsing_engines/plain_text.rb +29 -23
- data/lib/mbrao/rendering_engines/base.rb +4 -4
- data/lib/mbrao/rendering_engines/html_pipeline.rb +7 -2
- data/lib/mbrao/version.rb +2 -2
- data/spec/mbrao/author_spec.rb +32 -16
- data/spec/mbrao/content_spec.rb +144 -85
- data/spec/mbrao/integrations/rails_spec.rb +14 -0
- data/spec/mbrao/parser_spec.rb +19 -19
- data/spec/mbrao/parsing_engines/base_spec.rb +12 -12
- data/spec/mbrao/parsing_engines/plain_text_spec.rb +21 -21
- data/spec/mbrao/rendering_engines/base_spec.rb +2 -2
- data/spec/mbrao/rendering_engines/html_pipeline_spec.rb +31 -31
- metadata +2 -2
@@ -382,7 +382,8 @@
|
|
382
382
|
|
383
383
|
|
384
384
|
—
|
385
|
-
<div class='inline'><p>Return the body of the content in the desired locales. If only one locale is required, then a <code>String</code>
|
385
|
+
<div class='inline'><p>Return the body of the content in the desired locales. If only one locale is required, then a <code>String</code>
|
386
|
+
is returned, else a <code>HashWithIndifferentAccess</code> with locales as keys.</p>
|
386
387
|
</div>
|
387
388
|
|
388
389
|
</li>
|
@@ -395,12 +396,12 @@
|
|
395
396
|
<pre class="lines">
|
396
397
|
|
397
398
|
|
398
|
-
|
399
|
-
|
400
|
-
|
399
|
+
34
|
400
|
+
35
|
401
|
+
36</pre>
|
401
402
|
</td>
|
402
403
|
<td>
|
403
|
-
<pre class="code"><span class="info file"># File 'lib/mbrao/content.rb', line
|
404
|
+
<pre class="code"><span class="info file"># File 'lib/mbrao/content.rb', line 34</span>
|
404
405
|
|
405
406
|
<span class='kw'>def</span> <span class='id identifier rubyid_get_body'>get_body</span><span class='lparen'>(</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_engine'>engine</span> <span class='op'>=</span> <span class='symbol'>:plain_text</span><span class='rparen'>)</span>
|
406
407
|
<span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_create_engine'>create_engine</span><span class='lparen'>(</span><span class='id identifier rubyid_engine'>engine</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_filter_content'>filter_content</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span>
|
@@ -460,7 +461,8 @@
|
|
460
461
|
|
461
462
|
|
462
463
|
—
|
463
|
-
<div class='inline'><p>Return the label of the “more link” of the content in the desired locales. If only one locale is required,
|
464
|
+
<div class='inline'><p>Return the label of the “more link” of the content in the desired locales. If only one locale is required,
|
465
|
+
then a <code>String</code> is returned, else a <code>HashWithIndifferentAccess</code> with locales as keys.</p>
|
464
466
|
</div>
|
465
467
|
|
466
468
|
</li>
|
@@ -473,12 +475,12 @@
|
|
473
475
|
<pre class="lines">
|
474
476
|
|
475
477
|
|
476
|
-
|
477
|
-
|
478
|
-
|
478
|
+
52
|
479
|
+
53
|
480
|
+
54</pre>
|
479
481
|
</td>
|
480
482
|
<td>
|
481
|
-
<pre class="code"><span class="info file"># File 'lib/mbrao/content.rb', line
|
483
|
+
<pre class="code"><span class="info file"># File 'lib/mbrao/content.rb', line 52</span>
|
482
484
|
|
483
485
|
<span class='kw'>def</span> <span class='id identifier rubyid_get_more'>get_more</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
484
486
|
<span class='id identifier rubyid_filter_attribute_for_locales'>filter_attribute_for_locales</span><span class='lparen'>(</span><span class='ivar'>@more</span><span class='comma'>,</span> <span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span>
|
@@ -538,7 +540,8 @@
|
|
538
540
|
|
539
541
|
|
540
542
|
—
|
541
|
-
<div class='inline'><p>Return the title of the content in the desired locales. If only one locale is required, then a <code>Array</code>
|
543
|
+
<div class='inline'><p>Return the title of the content in the desired locales. If only one locale is required, then a <code>Array</code>
|
544
|
+
is returned, else a <code>HashWithIndifferentAccess</code> with locales as keys.</p>
|
542
545
|
</div>
|
543
546
|
|
544
547
|
</li>
|
@@ -551,12 +554,12 @@
|
|
551
554
|
<pre class="lines">
|
552
555
|
|
553
556
|
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
+
43
|
558
|
+
44
|
559
|
+
45</pre>
|
557
560
|
</td>
|
558
561
|
<td>
|
559
|
-
<pre class="code"><span class="info file"># File 'lib/mbrao/content.rb', line
|
562
|
+
<pre class="code"><span class="info file"># File 'lib/mbrao/content.rb', line 43</span>
|
560
563
|
|
561
564
|
<span class='kw'>def</span> <span class='id identifier rubyid_get_tags'>get_tags</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
562
565
|
<span class='id identifier rubyid_filter_attribute_for_locales'>filter_attribute_for_locales</span><span class='lparen'>(</span><span class='ivar'>@tags</span><span class='comma'>,</span> <span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span>
|
@@ -616,7 +619,8 @@
|
|
616
619
|
|
617
620
|
|
618
621
|
—
|
619
|
-
<div class='inline'><p>Return the title of the content in the desired locales. If only one locale is required, then a <code>String</code>
|
622
|
+
<div class='inline'><p>Return the title of the content in the desired locales. If only one locale is required, then a <code>String</code>
|
623
|
+
is returned, else a <code>HashWithIndifferentAccess</code> with locales as keys.</p>
|
620
624
|
</div>
|
621
625
|
|
622
626
|
</li>
|
@@ -629,12 +633,12 @@
|
|
629
633
|
<pre class="lines">
|
630
634
|
|
631
635
|
|
632
|
-
23
|
633
636
|
24
|
634
|
-
25
|
637
|
+
25
|
638
|
+
26</pre>
|
635
639
|
</td>
|
636
640
|
<td>
|
637
|
-
<pre class="code"><span class="info file"># File 'lib/mbrao/content.rb', line
|
641
|
+
<pre class="code"><span class="info file"># File 'lib/mbrao/content.rb', line 24</span>
|
638
642
|
|
639
643
|
<span class='kw'>def</span> <span class='id identifier rubyid_get_title'>get_title</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
640
644
|
<span class='id identifier rubyid_filter_attribute_for_locales'>filter_attribute_for_locales</span><span class='lparen'>(</span><span class='ivar'>@title</span><span class='comma'>,</span> <span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span>
|
@@ -649,7 +653,7 @@
|
|
649
653
|
</div>
|
650
654
|
|
651
655
|
<div id="footer">
|
652
|
-
Generated on
|
656
|
+
Generated on Sun Nov 24 14:07:03 2013 by
|
653
657
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
654
658
|
0.8.7.3 (ruby-2.0.0).
|
655
659
|
</div>
|
@@ -124,7 +124,7 @@
|
|
124
124
|
</div>
|
125
125
|
|
126
126
|
<div id="footer">
|
127
|
-
Generated on
|
127
|
+
Generated on Sun Nov 24 14:07:04 2013 by
|
128
128
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
129
129
|
0.8.7.3 (ruby-2.0.0).
|
130
130
|
</div>
|
@@ -124,7 +124,7 @@
|
|
124
124
|
</div>
|
125
125
|
|
126
126
|
<div id="footer">
|
127
|
-
Generated on
|
127
|
+
Generated on Sun Nov 24 14:07:04 2013 by
|
128
128
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
129
129
|
0.8.7.3 (ruby-2.0.0).
|
130
130
|
</div>
|
@@ -124,7 +124,7 @@
|
|
124
124
|
</div>
|
125
125
|
|
126
126
|
<div id="footer">
|
127
|
-
Generated on
|
127
|
+
Generated on Sun Nov 24 14:07:04 2013 by
|
128
128
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
129
129
|
0.8.7.3 (ruby-2.0.0).
|
130
130
|
</div>
|
@@ -124,7 +124,7 @@
|
|
124
124
|
</div>
|
125
125
|
|
126
126
|
<div id="footer">
|
127
|
-
Generated on
|
127
|
+
Generated on Sun Nov 24 14:07:04 2013 by
|
128
128
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
129
129
|
0.8.7.3 (ruby-2.0.0).
|
130
130
|
</div>
|
@@ -124,7 +124,7 @@
|
|
124
124
|
</div>
|
125
125
|
|
126
126
|
<div id="footer">
|
127
|
-
Generated on
|
127
|
+
Generated on Sun Nov 24 14:07:04 2013 by
|
128
128
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
129
129
|
0.8.7.3 (ruby-2.0.0).
|
130
130
|
</div>
|
@@ -124,7 +124,7 @@
|
|
124
124
|
</div>
|
125
125
|
|
126
126
|
<div id="footer">
|
127
|
-
Generated on
|
127
|
+
Generated on Sun Nov 24 14:07:04 2013 by
|
128
128
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
129
129
|
0.8.7.3 (ruby-2.0.0).
|
130
130
|
</div>
|
@@ -124,7 +124,7 @@
|
|
124
124
|
</div>
|
125
125
|
|
126
126
|
<div id="footer">
|
127
|
-
Generated on
|
127
|
+
Generated on Sun Nov 24 14:07:04 2013 by
|
128
128
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
129
129
|
0.8.7.3 (ruby-2.0.0).
|
130
130
|
</div>
|
data/doc/Mbrao/Exceptions.html
CHANGED
@@ -116,7 +116,7 @@
|
|
116
116
|
</div>
|
117
117
|
|
118
118
|
<div id="footer">
|
119
|
-
Generated on
|
119
|
+
Generated on Sun Nov 24 14:07:03 2013 by
|
120
120
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
121
121
|
0.8.7.3 (ruby-2.0.0).
|
122
122
|
</div>
|
data/doc/Mbrao/Parser.html
CHANGED
@@ -275,13 +275,13 @@
|
|
275
275
|
<pre class="lines">
|
276
276
|
|
277
277
|
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
278
|
+
173
|
279
|
+
174
|
280
|
+
175
|
281
|
+
176</pre>
|
282
282
|
</td>
|
283
283
|
<td>
|
284
|
-
<pre class="code"><span class="info file"># File 'lib/mbrao/parser.rb', line
|
284
|
+
<pre class="code"><span class="info file"># File 'lib/mbrao/parser.rb', line 173</span>
|
285
285
|
|
286
286
|
<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>
|
287
287
|
<span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='id identifier rubyid_sanitize_parsing_options'>sanitize_parsing_options</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
@@ -387,13 +387,13 @@
|
|
387
387
|
<pre class="lines">
|
388
388
|
|
389
389
|
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
390
|
+
184
|
391
|
+
185
|
392
|
+
186
|
393
|
+
187</pre>
|
394
394
|
</td>
|
395
395
|
<td>
|
396
|
-
<pre class="code"><span class="info file"># File 'lib/mbrao/parser.rb', line
|
396
|
+
<pre class="code"><span class="info file"># File 'lib/mbrao/parser.rb', line 184</span>
|
397
397
|
|
398
398
|
<span class='kw'>def</span> <span class='id identifier rubyid_render'>render</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='comma'>,</span> <span class='id identifier rubyid_context'>context</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
399
399
|
<span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='id identifier rubyid_sanitize_rendering_options'>sanitize_rendering_options</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
@@ -409,7 +409,7 @@
|
|
409
409
|
</div>
|
410
410
|
|
411
411
|
<div id="footer">
|
412
|
-
Generated on
|
412
|
+
Generated on Sun Nov 24 14:07:03 2013 by
|
413
413
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
414
414
|
0.8.7.3 (ruby-2.0.0).
|
415
415
|
</div>
|
@@ -131,7 +131,7 @@
|
|
131
131
|
<li class="public ">
|
132
132
|
<span class="summary_signature">
|
133
133
|
|
134
|
-
<a href="#filter_content-instance_method" title="#filter_content (instance method)">- (String|HashWithIndifferentAccess) <strong>filter_content</strong>(
|
134
|
+
<a href="#filter_content-instance_method" title="#filter_content (instance method)">- (String|HashWithIndifferentAccess) <strong>filter_content</strong>(_content, _locales = [], _options = {}) </a>
|
135
135
|
|
136
136
|
|
137
137
|
|
@@ -177,7 +177,7 @@
|
|
177
177
|
<li class="public ">
|
178
178
|
<span class="summary_signature">
|
179
179
|
|
180
|
-
<a href="#parse_metadata-instance_method" title="#parse_metadata (instance method)">- (Hash) <strong>parse_metadata</strong>(
|
180
|
+
<a href="#parse_metadata-instance_method" title="#parse_metadata (instance method)">- (Hash) <strong>parse_metadata</strong>(_content, _options = {}) </a>
|
181
181
|
|
182
182
|
|
183
183
|
|
@@ -200,7 +200,7 @@
|
|
200
200
|
<li class="public ">
|
201
201
|
<span class="summary_signature">
|
202
202
|
|
203
|
-
<a href="#separate_components-instance_method" title="#separate_components (instance method)">- (Array) <strong>separate_components</strong>(
|
203
|
+
<a href="#separate_components-instance_method" title="#separate_components (instance method)">- (Array) <strong>separate_components</strong>(_content, _options = {}) </a>
|
204
204
|
|
205
205
|
|
206
206
|
|
@@ -232,7 +232,7 @@
|
|
232
232
|
<div class="method_details first">
|
233
233
|
<h3 class="signature first" id="filter_content-instance_method">
|
234
234
|
|
235
|
-
- (<tt>String|HashWithIndifferentAccess</tt>) <strong>filter_content</strong>(
|
235
|
+
- (<tt>String|HashWithIndifferentAccess</tt>) <strong>filter_content</strong>(_content, _locales = [], _options = {})
|
236
236
|
|
237
237
|
|
238
238
|
|
@@ -251,7 +251,7 @@
|
|
251
251
|
|
252
252
|
<li>
|
253
253
|
|
254
|
-
<span class='name'>
|
254
|
+
<span class='name'>_content</span>
|
255
255
|
|
256
256
|
|
257
257
|
<span class='type'>(<tt><span class='object_link'><a href="../Content.html" title="Mbrao::Content (class)">Content</a></span></tt>)</span>
|
@@ -266,7 +266,7 @@
|
|
266
266
|
|
267
267
|
<li>
|
268
268
|
|
269
|
-
<span class='name'>
|
269
|
+
<span class='name'>_locales</span>
|
270
270
|
|
271
271
|
|
272
272
|
<span class='type'>(<tt>String|Array</tt>)</span>
|
@@ -283,7 +283,7 @@
|
|
283
283
|
|
284
284
|
<li>
|
285
285
|
|
286
|
-
<span class='name'>
|
286
|
+
<span class='name'>_options</span>
|
287
287
|
|
288
288
|
|
289
289
|
<span class='type'>(<tt>Hash</tt>)</span>
|
@@ -311,7 +311,8 @@
|
|
311
311
|
|
312
312
|
|
313
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
|
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
|
315
|
+
returned, else a <code>HashWithIndifferentAccess</code> with locales as keys.</p>
|
315
316
|
</div>
|
316
317
|
|
317
318
|
</li>
|
@@ -337,14 +338,14 @@
|
|
337
338
|
<pre class="lines">
|
338
339
|
|
339
340
|
|
340
|
-
36
|
341
341
|
37
|
342
|
-
38
|
342
|
+
38
|
343
|
+
39</pre>
|
343
344
|
</td>
|
344
345
|
<td>
|
345
|
-
<pre class="code"><span class="info file"># File 'lib/mbrao/parsing_engines/base.rb', line
|
346
|
+
<pre class="code"><span class="info file"># File 'lib/mbrao/parsing_engines/base.rb', line 37</span>
|
346
347
|
|
347
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_filter_content'>filter_content</span><span class='lparen'>(</span><span class='id identifier
|
348
|
+
<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
349
|
<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
350
|
<span class='kw'>end</span></pre>
|
350
351
|
</td>
|
@@ -413,14 +414,14 @@
|
|
413
414
|
<pre class="lines">
|
414
415
|
|
415
416
|
|
416
|
-
44
|
417
417
|
45
|
418
418
|
46
|
419
419
|
47
|
420
|
-
48
|
420
|
+
48
|
421
|
+
49</pre>
|
421
422
|
</td>
|
422
423
|
<td>
|
423
|
-
<pre class="code"><span class="info file"># File 'lib/mbrao/parsing_engines/base.rb', line
|
424
|
+
<pre class="code"><span class="info file"># File 'lib/mbrao/parsing_engines/base.rb', line 45</span>
|
424
425
|
|
425
426
|
<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
427
|
<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>
|
@@ -435,7 +436,7 @@
|
|
435
436
|
<div class="method_details ">
|
436
437
|
<h3 class="signature " id="parse_metadata-instance_method">
|
437
438
|
|
438
|
-
- (<tt>Hash</tt>) <strong>parse_metadata</strong>(
|
439
|
+
- (<tt>Hash</tt>) <strong>parse_metadata</strong>(_content, _options = {})
|
439
440
|
|
440
441
|
|
441
442
|
|
@@ -454,7 +455,7 @@
|
|
454
455
|
|
455
456
|
<li>
|
456
457
|
|
457
|
-
<span class='name'>
|
458
|
+
<span class='name'>_content</span>
|
458
459
|
|
459
460
|
|
460
461
|
<span class='type'>(<tt>Object</tt>)</span>
|
@@ -469,7 +470,7 @@
|
|
469
470
|
|
470
471
|
<li>
|
471
472
|
|
472
|
-
<span class='name'>
|
473
|
+
<span class='name'>_options</span>
|
473
474
|
|
474
475
|
|
475
476
|
<span class='type'>(<tt>Hash</tt>)</span>
|
@@ -530,7 +531,7 @@
|
|
530
531
|
<td>
|
531
532
|
<pre class="code"><span class="info file"># File 'lib/mbrao/parsing_engines/base.rb', line 26</span>
|
532
533
|
|
533
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_parse_metadata'>parse_metadata</span><span class='lparen'>(</span><span class='id identifier
|
534
|
+
<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
535
|
<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
536
|
<span class='kw'>end</span></pre>
|
536
537
|
</td>
|
@@ -541,7 +542,7 @@
|
|
541
542
|
<div class="method_details ">
|
542
543
|
<h3 class="signature " id="separate_components-instance_method">
|
543
544
|
|
544
|
-
- (<tt>Array</tt>) <strong>separate_components</strong>(
|
545
|
+
- (<tt>Array</tt>) <strong>separate_components</strong>(_content, _options = {})
|
545
546
|
|
546
547
|
|
547
548
|
|
@@ -560,7 +561,7 @@
|
|
560
561
|
|
561
562
|
<li>
|
562
563
|
|
563
|
-
<span class='name'>
|
564
|
+
<span class='name'>_content</span>
|
564
565
|
|
565
566
|
|
566
567
|
<span class='type'>(<tt>Object</tt>)</span>
|
@@ -575,7 +576,7 @@
|
|
575
576
|
|
576
577
|
<li>
|
577
578
|
|
578
|
-
<span class='name'>
|
579
|
+
<span class='name'>_options</span>
|
579
580
|
|
580
581
|
|
581
582
|
<span class='type'>(<tt>Hash</tt>)</span>
|
@@ -636,7 +637,7 @@
|
|
636
637
|
<td>
|
637
638
|
<pre class="code"><span class="info file"># File 'lib/mbrao/parsing_engines/base.rb', line 17</span>
|
638
639
|
|
639
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_separate_components'>separate_components</span><span class='lparen'>(</span><span class='id identifier
|
640
|
+
<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
641
|
<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
642
|
<span class='kw'>end</span></pre>
|
642
643
|
</td>
|
@@ -649,7 +650,7 @@
|
|
649
650
|
</div>
|
650
651
|
|
651
652
|
<div id="footer">
|
652
|
-
Generated on
|
653
|
+
Generated on Sun Nov 24 14:07:04 2013 by
|
653
654
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
654
655
|
0.8.7.3 (ruby-2.0.0).
|
655
656
|
</div>
|
@@ -297,7 +297,8 @@
|
|
297
297
|
|
298
298
|
|
299
299
|
—
|
300
|
-
<div class='inline'><p>Return the filtered content in the desired locales. If only one locale is required, then a <code>String</code> is
|
300
|
+
<div class='inline'><p>Return the filtered content in the desired locales. If only one locale is required, then a <code>String</code> is
|
301
|
+
returned, else a <code>HashWithIndifferentAccess</code> with locales as keys.</p>
|
301
302
|
</div>
|
302
303
|
|
303
304
|
</li>
|
@@ -310,7 +311,6 @@
|
|
310
311
|
<pre class="lines">
|
311
312
|
|
312
313
|
|
313
|
-
51
|
314
314
|
52
|
315
315
|
53
|
316
316
|
54
|
@@ -320,18 +320,19 @@
|
|
320
320
|
58
|
321
321
|
59
|
322
322
|
60
|
323
|
-
61
|
323
|
+
61
|
324
|
+
62</pre>
|
324
325
|
</td>
|
325
326
|
<td>
|
326
|
-
<pre class="code"><span class="info file"># File 'lib/mbrao/parsing_engines/plain_text.rb', line
|
327
|
+
<pre class="code"><span class="info file"># File 'lib/mbrao/parsing_engines/plain_text.rb', line 52</span>
|
327
328
|
|
328
329
|
<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>
|
329
330
|
<span class='id identifier rubyid_body'>body</span> <span class='op'>=</span> <span class='id identifier rubyid_content'>content</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span>
|
330
|
-
<span class='id identifier
|
331
|
+
<span class='id identifier rubyid_content_tags'>content_tags</span> <span class='op'>=</span> <span class='id identifier rubyid_sanitize_tags'>sanitize_tags</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:content_tags</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>{{content: %ARGS%}}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>{{/content}}</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
331
332
|
<span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Content</span><span class='period'>.</span><span class='id identifier rubyid_validate_locales'>validate_locales</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span><span class='comma'>,</span> <span class='id identifier rubyid_content'>content</span><span class='rparen'>)</span>
|
332
333
|
|
333
334
|
<span class='comment'># Split the content
|
334
|
-
</span> <span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='id identifier rubyid_scan_content'>scan_content</span><span class='lparen'>(</span><span class='id identifier rubyid_body'>body</span><span class='comma'>,</span> <span class='id identifier
|
335
|
+
</span> <span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='id identifier rubyid_scan_content'>scan_content</span><span class='lparen'>(</span><span class='id identifier rubyid_body'>body</span><span class='comma'>,</span> <span class='id identifier rubyid_content_tags'>content_tags</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='comma'>,</span> <span class='id identifier rubyid_content_tags'>content_tags</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='rparen'>)</span>
|
335
336
|
|
336
337
|
<span class='comment'># Now filter results
|
337
338
|
</span> <span class='id identifier rubyid_perform_filter_content'>perform_filter_content</span><span class='lparen'>(</span><span class='id identifier rubyid_result'>result</span><span class='comma'>,</span> <span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span>
|
@@ -539,15 +540,15 @@
|
|
539
540
|
<pre class="code"><span class="info file"># File 'lib/mbrao/parsing_engines/plain_text.rb', line 17</span>
|
540
541
|
|
541
542
|
<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>
|
542
|
-
<span class='id identifier rubyid_metadata'>metadata</span> <span class='op'>=</span> <span class='
|
543
|
-
|
544
|
-
<span class='
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
<span class='
|
543
|
+
<span class='id identifier rubyid_metadata'>metadata</span><span class='comma'>,</span> <span class='id identifier rubyid_content'>content</span><span class='comma'>,</span> <span class='id identifier rubyid_scanner'>scanner</span><span class='comma'>,</span> <span class='id identifier rubyid_start_tag'>start_tag</span><span class='comma'>,</span> <span class='id identifier rubyid_end_tag'>end_tag</span> <span class='op'>=</span> <span class='id identifier rubyid_prepare_for_separation'>prepare_for_separation</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>
|
544
|
+
|
545
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_scanner'>scanner</span><span class='period'>.</span><span class='id identifier rubyid_scan_until'>scan_until</span><span class='lparen'>(</span><span class='id identifier rubyid_start_tag'>start_tag</span><span class='rparen'>)</span> <span class='kw'>then</span>
|
546
|
+
<span class='id identifier rubyid_metadata'>metadata</span> <span class='op'>=</span> <span class='id identifier rubyid_scanner'>scanner</span><span class='period'>.</span><span class='id identifier rubyid_scan_until'>scan_until</span><span class='lparen'>(</span><span class='id identifier rubyid_end_tag'>end_tag</span><span class='rparen'>)</span>
|
547
|
+
|
548
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_metadata'>metadata</span> <span class='kw'>then</span>
|
549
|
+
<span class='id identifier rubyid_metadata'>metadata</span> <span class='op'>=</span> <span class='id identifier rubyid_metadata'>metadata</span><span class='period'>.</span><span class='id identifier rubyid_partition'>partition</span><span class='lparen'>(</span><span class='id identifier rubyid_end_tag'>end_tag</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
550
|
+
<span class='id identifier rubyid_content'>content</span> <span class='op'>=</span> <span class='id identifier rubyid_scanner'>scanner</span><span class='period'>.</span><span class='id identifier rubyid_rest'>rest</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span>
|
551
|
+
<span class='kw'>end</span>
|
551
552
|
<span class='kw'>end</span>
|
552
553
|
|
553
554
|
<span class='lbracket'>[</span><span class='id identifier rubyid_metadata'>metadata</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span><span class='comma'>,</span> <span class='id identifier rubyid_content'>content</span><span class='rbracket'>]</span>
|
@@ -562,7 +563,7 @@
|
|
562
563
|
</div>
|
563
564
|
|
564
565
|
<div id="footer">
|
565
|
-
Generated on
|
566
|
+
Generated on Sun Nov 24 14:07:04 2013 by
|
566
567
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
567
568
|
0.8.7.3 (ruby-2.0.0).
|
568
569
|
</div>
|
@@ -118,7 +118,7 @@
|
|
118
118
|
</div>
|
119
119
|
|
120
120
|
<div id="footer">
|
121
|
-
Generated on
|
121
|
+
Generated on Sun Nov 24 14:07:03 2013 by
|
122
122
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
123
123
|
0.8.7.3 (ruby-2.0.0).
|
124
124
|
</div>
|