mbrao 1.2.3 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -263,8 +263,6 @@
|
|
263
263
|
<pre class="lines">
|
264
264
|
|
265
265
|
|
266
|
-
42
|
267
|
-
43
|
268
266
|
44
|
269
267
|
45
|
270
268
|
46
|
@@ -366,10 +364,15 @@
|
|
366
364
|
142
|
367
365
|
143
|
368
366
|
144
|
369
|
-
145
|
367
|
+
145
|
368
|
+
146
|
369
|
+
147
|
370
|
+
148
|
371
|
+
149
|
372
|
+
150</pre>
|
370
373
|
</td>
|
371
374
|
<td>
|
372
|
-
<pre class="code"><span class="info file"># File 'lib/mbrao/rendering_engines/html_pipeline.rb', line
|
375
|
+
<pre class="code"><span class="info file"># File 'lib/mbrao/rendering_engines/html_pipeline.rb', line 44</span>
|
373
376
|
|
374
377
|
<span class='kw'>class</span> <span class='const'>HtmlPipeline</span> <span class='op'><</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>RenderingEngines</span><span class='op'>::</span><span class='const'>Base</span>
|
375
378
|
<span class='id identifier rubyid_attr_accessor'>attr_accessor</span> <span class='symbol'>:default_pipeline</span>
|
@@ -450,7 +453,10 @@
|
|
450
453
|
</span> <span class='comment'># @param context [Hash] A context for rendering.
|
451
454
|
</span> <span class='comment'># @return [HTML::Pipeline] The pipeline
|
452
455
|
</span> <span class='kw'>def</span> <span class='id identifier rubyid_create_pipeline'>create_pipeline</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
453
|
-
<span class='op'>::</span><span class='const'>HTML</span><span class='op'>::</span><span class='const'>Pipeline</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span
|
456
|
+
<span class='op'>::</span><span class='const'>HTML</span><span class='op'>::</span><span class='const'>Pipeline</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span>
|
457
|
+
<span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:pipeline</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_f'>f</span><span class='op'>|</span> <span class='op'>::</span><span class='const'>Lazier</span><span class='period'>.</span><span class='id identifier rubyid_find_class'>find_class</span><span class='lparen'>(</span><span class='id identifier rubyid_f'>f</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>::HTML::Pipeline::%CLASS%Filter</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='comma'>,</span>
|
458
|
+
<span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:pipeline_options</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
459
|
+
<span class='rparen'>)</span>
|
454
460
|
<span class='kw'>end</span>
|
455
461
|
|
456
462
|
<span class='comment'># Filters pipeline filters basing on the options provided.
|
@@ -524,8 +530,6 @@
|
|
524
530
|
<pre class="lines">
|
525
531
|
|
526
532
|
|
527
|
-
42
|
528
|
-
43
|
529
533
|
44
|
530
534
|
45
|
531
535
|
46
|
@@ -627,10 +631,15 @@
|
|
627
631
|
142
|
628
632
|
143
|
629
633
|
144
|
630
|
-
145
|
634
|
+
145
|
635
|
+
146
|
636
|
+
147
|
637
|
+
148
|
638
|
+
149
|
639
|
+
150</pre>
|
631
640
|
</td>
|
632
641
|
<td>
|
633
|
-
<pre class="code"><span class="info file"># File 'lib/mbrao/rendering_engines/html_pipeline.rb', line
|
642
|
+
<pre class="code"><span class="info file"># File 'lib/mbrao/rendering_engines/html_pipeline.rb', line 44</span>
|
634
643
|
|
635
644
|
<span class='kw'>class</span> <span class='const'>HtmlPipeline</span> <span class='op'><</span> <span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>RenderingEngines</span><span class='op'>::</span><span class='const'>Base</span>
|
636
645
|
<span class='id identifier rubyid_attr_accessor'>attr_accessor</span> <span class='symbol'>:default_pipeline</span>
|
@@ -711,7 +720,10 @@
|
|
711
720
|
</span> <span class='comment'># @param context [Hash] A context for rendering.
|
712
721
|
</span> <span class='comment'># @return [HTML::Pipeline] The pipeline
|
713
722
|
</span> <span class='kw'>def</span> <span class='id identifier rubyid_create_pipeline'>create_pipeline</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
714
|
-
<span class='op'>::</span><span class='const'>HTML</span><span class='op'>::</span><span class='const'>Pipeline</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span
|
723
|
+
<span class='op'>::</span><span class='const'>HTML</span><span class='op'>::</span><span class='const'>Pipeline</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span>
|
724
|
+
<span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:pipeline</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_f'>f</span><span class='op'>|</span> <span class='op'>::</span><span class='const'>Lazier</span><span class='period'>.</span><span class='id identifier rubyid_find_class'>find_class</span><span class='lparen'>(</span><span class='id identifier rubyid_f'>f</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>::HTML::Pipeline::%CLASS%Filter</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='comma'>,</span>
|
725
|
+
<span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:pipeline_options</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
726
|
+
<span class='rparen'>)</span>
|
715
727
|
<span class='kw'>end</span>
|
716
728
|
|
717
729
|
<span class='comment'># Filters pipeline filters basing on the options provided.
|
@@ -826,8 +838,6 @@
|
|
826
838
|
<pre class="lines">
|
827
839
|
|
828
840
|
|
829
|
-
51
|
830
|
-
52
|
831
841
|
53
|
832
842
|
54
|
833
843
|
55
|
@@ -837,10 +847,12 @@
|
|
837
847
|
59
|
838
848
|
60
|
839
849
|
61
|
840
|
-
62
|
850
|
+
62
|
851
|
+
63
|
852
|
+
64</pre>
|
841
853
|
</td>
|
842
854
|
<td>
|
843
|
-
<pre class="code"><span class="info file"># File 'lib/mbrao/rendering_engines/html_pipeline.rb', line
|
855
|
+
<pre class="code"><span class="info file"># File 'lib/mbrao/rendering_engines/html_pipeline.rb', line 53</span>
|
844
856
|
|
845
857
|
<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>
|
846
858
|
<span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='id identifier rubyid_sanitize_options'>sanitize_options</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
@@ -864,7 +876,7 @@
|
|
864
876
|
</div>
|
865
877
|
|
866
878
|
<div id="footer">
|
867
|
-
Generated on
|
879
|
+
Generated on Sun Nov 24 14:07:04 2013 by
|
868
880
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
869
881
|
0.8.7.3 (ruby-2.0.0).
|
870
882
|
</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>
|
@@ -225,13 +225,13 @@
|
|
225
225
|
<pre class="lines">
|
226
226
|
|
227
227
|
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
228
|
+
136
|
229
|
+
137
|
230
|
+
138
|
231
|
+
139</pre>
|
232
232
|
</td>
|
233
233
|
<td>
|
234
|
-
<pre class="code"><span class="info file"># File 'lib/mbrao/parser.rb', line
|
234
|
+
<pre class="code"><span class="info file"># File 'lib/mbrao/parser.rb', line 136</span>
|
235
235
|
|
236
236
|
<span class='kw'>def</span> <span class='id identifier rubyid_is_email?'>is_email?</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
|
237
237
|
<span class='id identifier rubyid_regex'>regex</span> <span class='op'>=</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^([a-z0-9_\.\-\+]+)@([\da-z\.\-]+)\.([a-z\.]{2,6})$</span><span class='regexp_end'>/i</span></span>
|
@@ -303,23 +303,23 @@
|
|
303
303
|
<pre class="lines">
|
304
304
|
|
305
305
|
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
306
|
+
145
|
307
|
+
146
|
308
|
+
147
|
309
|
+
148
|
310
|
+
149
|
311
|
+
150
|
312
|
+
151
|
313
|
+
152
|
314
|
+
153
|
315
|
+
154
|
316
|
+
155
|
317
|
+
156
|
318
|
+
157
|
319
|
+
158</pre>
|
320
320
|
</td>
|
321
321
|
<td>
|
322
|
-
<pre class="code"><span class="info file"># File 'lib/mbrao/parser.rb', line
|
322
|
+
<pre class="code"><span class="info file"># File 'lib/mbrao/parser.rb', line 145</span>
|
323
323
|
|
324
324
|
<span class='kw'>def</span> <span class='id identifier rubyid_is_url?'>is_url?</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
|
325
325
|
<span class='id identifier rubyid_regex'>regex</span> <span class='op'>=</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>
|
@@ -345,7 +345,7 @@
|
|
345
345
|
</div>
|
346
346
|
|
347
347
|
<div id="footer">
|
348
|
-
Generated on
|
348
|
+
Generated on Sun Nov 24 14:07:03 2013 by
|
349
349
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
350
350
|
0.8.7.3 (ruby-2.0.0).
|
351
351
|
</div>
|
data/doc/Mbrao/Validations.html
CHANGED
@@ -125,7 +125,7 @@
|
|
125
125
|
</div>
|
126
126
|
|
127
127
|
<div id="footer">
|
128
|
-
Generated on
|
128
|
+
Generated on Sun Nov 24 14:07:03 2013 by
|
129
129
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
130
130
|
0.8.7.3 (ruby-2.0.0).
|
131
131
|
</div>
|
data/doc/Mbrao/Version.html
CHANGED
@@ -134,7 +134,7 @@
|
|
134
134
|
|
135
135
|
</div>
|
136
136
|
</dt>
|
137
|
-
<dd><pre class="code"><span class='int'>
|
137
|
+
<dd><pre class="code"><span class='int'>3</span></pre></dd>
|
138
138
|
|
139
139
|
<dt id="PATCH-constant" class="">PATCH =
|
140
140
|
<div class="docstring">
|
@@ -149,7 +149,7 @@
|
|
149
149
|
|
150
150
|
</div>
|
151
151
|
</dt>
|
152
|
-
<dd><pre class="code"><span class='int'>
|
152
|
+
<dd><pre class="code"><span class='int'>0</span></pre></dd>
|
153
153
|
|
154
154
|
<dt id="STRING-constant" class="">STRING =
|
155
155
|
<div class="docstring">
|
@@ -180,7 +180,7 @@
|
|
180
180
|
</div>
|
181
181
|
|
182
182
|
<div id="footer">
|
183
|
-
Generated on
|
183
|
+
Generated on Sun Nov 24 14:07:03 2013 by
|
184
184
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
185
185
|
0.8.7.3 (ruby-2.0.0).
|
186
186
|
</div>
|
data/doc/Mbrao.html
CHANGED
@@ -121,7 +121,7 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
121
121
|
</div>
|
122
122
|
|
123
123
|
<div id="footer">
|
124
|
-
Generated on
|
124
|
+
Generated on Sun Nov 24 14:07:03 2013 by
|
125
125
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
126
126
|
0.8.7.3 (ruby-2.0.0).
|
127
127
|
</div>
|
data/doc/_index.html
CHANGED
@@ -386,7 +386,7 @@
|
|
386
386
|
</div>
|
387
387
|
|
388
388
|
<div id="footer">
|
389
|
-
Generated on
|
389
|
+
Generated on Sun Nov 24 14:07:03 2013 by
|
390
390
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
391
391
|
0.8.7.3 (ruby-2.0.0).
|
392
392
|
</div>
|
data/doc/file.README.html
CHANGED
@@ -130,7 +130,7 @@ Mbrao::Parser.render(content)
|
|
130
130
|
</div></div>
|
131
131
|
|
132
132
|
<div id="footer">
|
133
|
-
Generated on
|
133
|
+
Generated on Sun Nov 24 14:07:03 2013 by
|
134
134
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
135
135
|
0.8.7.3 (ruby-2.0.0).
|
136
136
|
</div>
|
data/doc/index.html
CHANGED
@@ -130,7 +130,7 @@ Mbrao::Parser.render(content)
|
|
130
130
|
</div></div>
|
131
131
|
|
132
132
|
<div id="footer">
|
133
|
-
Generated on
|
133
|
+
Generated on Sun Nov 24 14:07:03 2013 by
|
134
134
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
135
135
|
0.8.7.3 (ruby-2.0.0).
|
136
136
|
</div>
|