mbrao 1.0.3 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +1 -2
- data/doc/ActionView/Template/Handlers/MbraoTemplate.html +1 -1
- 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 +1 -1
- data/doc/Mbrao/Content.html +1 -1
- data/doc/Mbrao/ContentPublicInterface.html +1 -1
- 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 +1 -1
- data/doc/Mbrao/ParsingEngines/PlainText.html +1 -1
- data/doc/Mbrao/ParsingEngines.html +1 -1
- data/doc/Mbrao/PublicInterface/ClassMethods.html +20 -329
- data/doc/Mbrao/PublicInterface.html +1 -1
- data/doc/Mbrao/RenderingEngines/Base.html +1 -1
- data/doc/Mbrao/RenderingEngines/HtmlPipeline.html +3 -3
- data/doc/Mbrao/RenderingEngines.html +1 -1
- data/doc/Mbrao/Validations/ClassMethods.html +50 -50
- 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 +54 -62
- data/doc/top-level-namespace.html +1 -1
- data/lib/mbrao/parser.rb +2 -26
- data/lib/mbrao/rendering_engines/html_pipeline.rb +1 -1
- data/lib/mbrao/version.rb +2 -2
- data/mbrao.gemspec +2 -2
- data/spec/mbrao/parser_spec.rb +3 -30
- data/spec/mbrao/rendering_engines/html_pipeline_spec.rb +6 -6
- metadata +7 -7
@@ -271,13 +271,13 @@
|
|
271
271
|
<pre class="lines">
|
272
272
|
|
273
273
|
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
274
|
+
115
|
275
|
+
116
|
276
|
+
117
|
277
|
+
118</pre>
|
278
278
|
</td>
|
279
279
|
<td>
|
280
|
-
<pre class="code"><span class="info file"># File 'lib/mbrao/parser.rb', line
|
280
|
+
<pre class="code"><span class="info file"># File 'lib/mbrao/parser.rb', line 115</span>
|
281
281
|
|
282
282
|
<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>
|
283
283
|
<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>
|
@@ -349,23 +349,23 @@
|
|
349
349
|
<pre class="lines">
|
350
350
|
|
351
351
|
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
352
|
+
124
|
353
|
+
125
|
354
|
+
126
|
355
|
+
127
|
356
|
+
128
|
357
|
+
129
|
358
|
+
130
|
359
|
+
131
|
360
|
+
132
|
361
|
+
133
|
362
|
+
134
|
363
|
+
135
|
364
|
+
136
|
365
|
+
137</pre>
|
366
366
|
</td>
|
367
367
|
<td>
|
368
|
-
<pre class="code"><span class="info file"># File 'lib/mbrao/parser.rb', line
|
368
|
+
<pre class="code"><span class="info file"># File 'lib/mbrao/parser.rb', line 124</span>
|
369
369
|
|
370
370
|
<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>
|
371
371
|
<span class='id identifier rubyid_regex'>regex</span> <span class='op'>=</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>
|
@@ -513,24 +513,24 @@
|
|
513
513
|
<pre class="lines">
|
514
514
|
|
515
515
|
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
516
|
+
166
|
517
|
+
167
|
518
|
+
168
|
519
|
+
169
|
520
|
+
170
|
521
|
+
171
|
522
|
+
172
|
523
|
+
173
|
524
|
+
174
|
525
|
+
175
|
526
|
+
176
|
527
|
+
177
|
528
|
+
178
|
529
|
+
179
|
530
|
+
180</pre>
|
531
531
|
</td>
|
532
532
|
<td>
|
533
|
-
<pre class="code"><span class="info file"># File 'lib/mbrao/parser.rb', line
|
533
|
+
<pre class="code"><span class="info file"># File 'lib/mbrao/parser.rb', line 166</span>
|
534
534
|
|
535
535
|
<span class='kw'>def</span> <span class='id identifier rubyid_sanitized_array'>sanitized_array</span><span class='lparen'>(</span><span class='id identifier rubyid_object'>object</span><span class='comma'>,</span> <span class='id identifier rubyid_uniq'>uniq</span> <span class='op'>=</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='id identifier rubyid_compact'>compact</span> <span class='op'>=</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='id identifier rubyid_sanitize_method'>sanitize_method</span> <span class='op'>=</span> <span class='symbol'>:ensure_string</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
536
536
|
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span>
|
@@ -645,21 +645,21 @@
|
|
645
645
|
<pre class="lines">
|
646
646
|
|
647
647
|
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
648
|
+
145
|
649
|
+
146
|
650
|
+
147
|
651
|
+
148
|
652
|
+
149
|
653
|
+
150
|
654
|
+
151
|
655
|
+
152
|
656
|
+
153
|
657
|
+
154
|
658
|
+
155
|
659
|
+
156</pre>
|
660
660
|
</td>
|
661
661
|
<td>
|
662
|
-
<pre class="code"><span class="info file"># File 'lib/mbrao/parser.rb', line
|
662
|
+
<pre class="code"><span class="info file"># File 'lib/mbrao/parser.rb', line 145</span>
|
663
663
|
|
664
664
|
<span class='kw'>def</span> <span class='id identifier rubyid_sanitized_hash'>sanitized_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_object'>object</span><span class='comma'>,</span> <span class='id identifier rubyid_sanitize_method'>sanitize_method</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
665
665
|
<span class='kw'>if</span> <span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>HashWithIndifferentAccess</span><span class='rparen'>)</span> <span class='kw'>then</span>
|
@@ -683,7 +683,7 @@
|
|
683
683
|
</div>
|
684
684
|
|
685
685
|
<div id="footer">
|
686
|
-
Generated on
|
686
|
+
Generated on Sun Mar 24 11:07:07 2013 by
|
687
687
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
688
688
|
0.8.5.2 (ruby-1.9.3).
|
689
689
|
</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 Mar 24 11:07:07 2013 by
|
129
129
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
130
130
|
0.8.5.2 (ruby-1.9.3).
|
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'>1</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 Mar 24 11:07:07 2013 by
|
184
184
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
185
185
|
0.8.5.2 (ruby-1.9.3).
|
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 Mar 24 11:07:07 2013 by
|
125
125
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
126
126
|
0.8.5.2 (ruby-1.9.3).
|
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 Mar 24 11:07:07 2013 by
|
390
390
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
391
391
|
0.8.5.2 (ruby-1.9.3).
|
392
392
|
</div>
|
data/doc/file.README.html
CHANGED
@@ -128,7 +128,7 @@ Mbrao::Parser.render(content)
|
|
128
128
|
</div></div>
|
129
129
|
|
130
130
|
<div id="footer">
|
131
|
-
Generated on
|
131
|
+
Generated on Sun Mar 24 11:07:07 2013 by
|
132
132
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
133
133
|
0.8.5.2 (ruby-1.9.3).
|
134
134
|
</div>
|
data/doc/index.html
CHANGED
@@ -128,7 +128,7 @@ Mbrao::Parser.render(content)
|
|
128
128
|
</div></div>
|
129
129
|
|
130
130
|
<div id="footer">
|
131
|
-
Generated on
|
131
|
+
Generated on Sun Mar 24 11:07:07 2013 by
|
132
132
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
133
133
|
0.8.5.2 (ruby-1.9.3).
|
134
134
|
</div>
|
data/doc/method_list.html
CHANGED
@@ -167,15 +167,15 @@
|
|
167
167
|
|
168
168
|
|
169
169
|
<li class="r2 ">
|
170
|
-
<span class='object_link'><a href="Mbrao/
|
170
|
+
<span class='object_link'><a href="Mbrao/ContentPublicInterface.html#get_body-instance_method" title="Mbrao::ContentPublicInterface#get_body (method)">#get_body</a></span>
|
171
171
|
|
172
|
-
<small>Mbrao::
|
172
|
+
<small>Mbrao::ContentPublicInterface</small>
|
173
173
|
|
174
174
|
</li>
|
175
175
|
|
176
176
|
|
177
177
|
<li class="r1 ">
|
178
|
-
<span class='object_link'><a href="Mbrao/ContentPublicInterface.html#
|
178
|
+
<span class='object_link'><a href="Mbrao/ContentPublicInterface.html#get_more-instance_method" title="Mbrao::ContentPublicInterface#get_more (method)">#get_more</a></span>
|
179
179
|
|
180
180
|
<small>Mbrao::ContentPublicInterface</small>
|
181
181
|
|
@@ -183,7 +183,7 @@
|
|
183
183
|
|
184
184
|
|
185
185
|
<li class="r2 ">
|
186
|
-
<span class='object_link'><a href="Mbrao/ContentPublicInterface.html#
|
186
|
+
<span class='object_link'><a href="Mbrao/ContentPublicInterface.html#get_tags-instance_method" title="Mbrao::ContentPublicInterface#get_tags (method)">#get_tags</a></span>
|
187
187
|
|
188
188
|
<small>Mbrao::ContentPublicInterface</small>
|
189
189
|
|
@@ -191,7 +191,7 @@
|
|
191
191
|
|
192
192
|
|
193
193
|
<li class="r1 ">
|
194
|
-
<span class='object_link'><a href="Mbrao/ContentPublicInterface.html#
|
194
|
+
<span class='object_link'><a href="Mbrao/ContentPublicInterface.html#get_title-instance_method" title="Mbrao::ContentPublicInterface#get_title (method)">#get_title</a></span>
|
195
195
|
|
196
196
|
<small>Mbrao::ContentPublicInterface</small>
|
197
197
|
|
@@ -199,15 +199,15 @@
|
|
199
199
|
|
200
200
|
|
201
201
|
<li class="r2 ">
|
202
|
-
<span class='object_link'><a href="Mbrao/
|
202
|
+
<span class='object_link'><a href="Mbrao/Author.html#image-instance_method" title="Mbrao::Author#image (method)">#image</a></span>
|
203
203
|
|
204
|
-
<small>Mbrao::
|
204
|
+
<small>Mbrao::Author</small>
|
205
205
|
|
206
206
|
</li>
|
207
207
|
|
208
208
|
|
209
209
|
<li class="r1 ">
|
210
|
-
<span class='object_link'><a href="Mbrao/Author.html#
|
210
|
+
<span class='object_link'><a href="Mbrao/Author.html#initialize-instance_method" title="Mbrao::Author#initialize (method)">#initialize</a></span>
|
211
211
|
|
212
212
|
<small>Mbrao::Author</small>
|
213
213
|
|
@@ -215,9 +215,9 @@
|
|
215
215
|
|
216
216
|
|
217
217
|
<li class="r2 ">
|
218
|
-
<span class='object_link'><a href="
|
218
|
+
<span class='object_link'><a href="HTML/Pipeline/KramdownFilter.html#initialize-instance_method" title="HTML::Pipeline::KramdownFilter#initialize (method)">#initialize</a></span>
|
219
219
|
|
220
|
-
<small>
|
220
|
+
<small>HTML::Pipeline::KramdownFilter</small>
|
221
221
|
|
222
222
|
</li>
|
223
223
|
|
@@ -231,9 +231,9 @@
|
|
231
231
|
|
232
232
|
|
233
233
|
<li class="r2 ">
|
234
|
-
<span class='object_link'><a href="
|
234
|
+
<span class='object_link'><a href="Mbrao/PublicInterface/ClassMethods.html#instance-instance_method" title="Mbrao::PublicInterface::ClassMethods#instance (method)">#instance</a></span>
|
235
235
|
|
236
|
-
<small>
|
236
|
+
<small>Mbrao::PublicInterface::ClassMethods</small>
|
237
237
|
|
238
238
|
</li>
|
239
239
|
|
@@ -247,15 +247,15 @@
|
|
247
247
|
|
248
248
|
|
249
249
|
<li class="r2 ">
|
250
|
-
<span class='object_link'><a href="Mbrao/
|
250
|
+
<span class='object_link'><a href="Mbrao/Validations/ClassMethods.html#is_email%3F-instance_method" title="Mbrao::Validations::ClassMethods#is_email? (method)">#is_email?</a></span>
|
251
251
|
|
252
|
-
<small>Mbrao::
|
252
|
+
<small>Mbrao::Validations::ClassMethods</small>
|
253
253
|
|
254
254
|
</li>
|
255
255
|
|
256
256
|
|
257
257
|
<li class="r1 ">
|
258
|
-
<span class='object_link'><a href="Mbrao/Validations/ClassMethods.html#
|
258
|
+
<span class='object_link'><a href="Mbrao/Validations/ClassMethods.html#is_url%3F-instance_method" title="Mbrao::Validations::ClassMethods#is_url? (method)">#is_url?</a></span>
|
259
259
|
|
260
260
|
<small>Mbrao::Validations::ClassMethods</small>
|
261
261
|
|
@@ -263,25 +263,25 @@
|
|
263
263
|
|
264
264
|
|
265
265
|
<li class="r2 ">
|
266
|
-
<span class='object_link'><a href="Mbrao/
|
266
|
+
<span class='object_link'><a href="Mbrao/PublicInterface/ClassMethods.html#locale-instance_method" title="Mbrao::PublicInterface::ClassMethods#locale (method)">#locale</a></span>
|
267
267
|
|
268
|
-
<small>Mbrao::
|
268
|
+
<small>Mbrao::PublicInterface::ClassMethods</small>
|
269
269
|
|
270
270
|
</li>
|
271
271
|
|
272
272
|
|
273
273
|
<li class="r1 ">
|
274
|
-
<span class='object_link'><a href="Mbrao/
|
274
|
+
<span class='object_link'><a href="Mbrao/Content.html#locales-instance_method" title="Mbrao::Content#locales (method)">#locales</a></span>
|
275
275
|
|
276
|
-
<small>Mbrao::
|
276
|
+
<small>Mbrao::Content</small>
|
277
277
|
|
278
278
|
</li>
|
279
279
|
|
280
280
|
|
281
281
|
<li class="r2 ">
|
282
|
-
<span class='object_link'><a href="Mbrao/
|
282
|
+
<span class='object_link'><a href="Mbrao/Author.html#metadata-instance_method" title="Mbrao::Author#metadata (method)">#metadata</a></span>
|
283
283
|
|
284
|
-
<small>Mbrao::
|
284
|
+
<small>Mbrao::Author</small>
|
285
285
|
|
286
286
|
</li>
|
287
287
|
|
@@ -295,25 +295,25 @@
|
|
295
295
|
|
296
296
|
|
297
297
|
<li class="r2 ">
|
298
|
-
<span class='object_link'><a href="Mbrao/
|
298
|
+
<span class='object_link'><a href="Mbrao/Content.html#more-instance_method" title="Mbrao::Content#more (method)">#more</a></span>
|
299
299
|
|
300
|
-
<small>Mbrao::
|
300
|
+
<small>Mbrao::Content</small>
|
301
301
|
|
302
302
|
</li>
|
303
303
|
|
304
304
|
|
305
305
|
<li class="r1 ">
|
306
|
-
<span class='object_link'><a href="Mbrao/
|
306
|
+
<span class='object_link'><a href="Mbrao/Author.html#name-instance_method" title="Mbrao::Author#name (method)">#name</a></span>
|
307
307
|
|
308
|
-
<small>Mbrao::
|
308
|
+
<small>Mbrao::Author</small>
|
309
309
|
|
310
310
|
</li>
|
311
311
|
|
312
312
|
|
313
313
|
<li class="r2 ">
|
314
|
-
<span class='object_link'><a href="Mbrao/
|
314
|
+
<span class='object_link'><a href="Mbrao/PublicInterface/ClassMethods.html#parse-instance_method" title="Mbrao::PublicInterface::ClassMethods#parse (method)">#parse</a></span>
|
315
315
|
|
316
|
-
<small>Mbrao::
|
316
|
+
<small>Mbrao::PublicInterface::ClassMethods</small>
|
317
317
|
|
318
318
|
</li>
|
319
319
|
|
@@ -327,14 +327,6 @@
|
|
327
327
|
|
328
328
|
|
329
329
|
<li class="r2 ">
|
330
|
-
<span class='object_link'><a href="Mbrao/PublicInterface/ClassMethods.html#parse-instance_method" title="Mbrao::PublicInterface::ClassMethods#parse (method)">#parse</a></span>
|
331
|
-
|
332
|
-
<small>Mbrao::PublicInterface::ClassMethods</small>
|
333
|
-
|
334
|
-
</li>
|
335
|
-
|
336
|
-
|
337
|
-
<li class="r1 ">
|
338
330
|
<span class='object_link'><a href="Mbrao/ParsingEngines/Base.html#parse-instance_method" title="Mbrao::ParsingEngines::Base#parse (method)">#parse</a></span>
|
339
331
|
|
340
332
|
<small>Mbrao::ParsingEngines::Base</small>
|
@@ -342,7 +334,7 @@
|
|
342
334
|
</li>
|
343
335
|
|
344
336
|
|
345
|
-
<li class="
|
337
|
+
<li class="r1 ">
|
346
338
|
<span class='object_link'><a href="Mbrao/ParsingEngines/PlainText.html#parse_metadata-instance_method" title="Mbrao::ParsingEngines::PlainText#parse_metadata (method)">#parse_metadata</a></span>
|
347
339
|
|
348
340
|
<small>Mbrao::ParsingEngines::PlainText</small>
|
@@ -350,7 +342,7 @@
|
|
350
342
|
</li>
|
351
343
|
|
352
344
|
|
353
|
-
<li class="
|
345
|
+
<li class="r2 ">
|
354
346
|
<span class='object_link'><a href="Mbrao/ParsingEngines/Base.html#parse_metadata-instance_method" title="Mbrao::ParsingEngines::Base#parse_metadata (method)">#parse_metadata</a></span>
|
355
347
|
|
356
348
|
<small>Mbrao::ParsingEngines::Base</small>
|
@@ -358,7 +350,7 @@
|
|
358
350
|
</li>
|
359
351
|
|
360
352
|
|
361
|
-
<li class="
|
353
|
+
<li class="r1 ">
|
362
354
|
<span class='object_link'><a href="Mbrao/PublicInterface/ClassMethods.html#parsing_engine-instance_method" title="Mbrao::PublicInterface::ClassMethods#parsing_engine (method)">#parsing_engine</a></span>
|
363
355
|
|
364
356
|
<small>Mbrao::PublicInterface::ClassMethods</small>
|
@@ -366,7 +358,7 @@
|
|
366
358
|
</li>
|
367
359
|
|
368
360
|
|
369
|
-
<li class="
|
361
|
+
<li class="r2 ">
|
370
362
|
<span class='object_link'><a href="Mbrao/Parser.html#render-instance_method" title="Mbrao::Parser#render (method)">#render</a></span>
|
371
363
|
|
372
364
|
<small>Mbrao::Parser</small>
|
@@ -374,6 +366,14 @@
|
|
374
366
|
</li>
|
375
367
|
|
376
368
|
|
369
|
+
<li class="r1 ">
|
370
|
+
<span class='object_link'><a href="Mbrao/RenderingEngines/Base.html#render-instance_method" title="Mbrao::RenderingEngines::Base#render (method)">#render</a></span>
|
371
|
+
|
372
|
+
<small>Mbrao::RenderingEngines::Base</small>
|
373
|
+
|
374
|
+
</li>
|
375
|
+
|
376
|
+
|
377
377
|
<li class="r2 ">
|
378
378
|
<span class='object_link'><a href="Mbrao/RenderingEngines/HtmlPipeline.html#render-instance_method" title="Mbrao::RenderingEngines::HtmlPipeline#render (method)">#render</a></span>
|
379
379
|
|
@@ -391,15 +391,15 @@
|
|
391
391
|
|
392
392
|
|
393
393
|
<li class="r2 ">
|
394
|
-
<span class='object_link'><a href="Mbrao/
|
394
|
+
<span class='object_link'><a href="Mbrao/PublicInterface/ClassMethods.html#render-instance_method" title="Mbrao::PublicInterface::ClassMethods#render (method)">#render</a></span>
|
395
395
|
|
396
|
-
<small>Mbrao::
|
396
|
+
<small>Mbrao::PublicInterface::ClassMethods</small>
|
397
397
|
|
398
398
|
</li>
|
399
399
|
|
400
400
|
|
401
401
|
<li class="r1 ">
|
402
|
-
<span class='object_link'><a href="Mbrao/PublicInterface/ClassMethods.html#
|
402
|
+
<span class='object_link'><a href="Mbrao/PublicInterface/ClassMethods.html#rendering_engine-instance_method" title="Mbrao::PublicInterface::ClassMethods#rendering_engine (method)">#rendering_engine</a></span>
|
403
403
|
|
404
404
|
<small>Mbrao::PublicInterface::ClassMethods</small>
|
405
405
|
|
@@ -407,15 +407,15 @@
|
|
407
407
|
|
408
408
|
|
409
409
|
<li class="r2 ">
|
410
|
-
<span class='object_link'><a href="Mbrao/
|
410
|
+
<span class='object_link'><a href="Mbrao/Validations/ClassMethods.html#sanitized_array-instance_method" title="Mbrao::Validations::ClassMethods#sanitized_array (method)">#sanitized_array</a></span>
|
411
411
|
|
412
|
-
<small>Mbrao::
|
412
|
+
<small>Mbrao::Validations::ClassMethods</small>
|
413
413
|
|
414
414
|
</li>
|
415
415
|
|
416
416
|
|
417
417
|
<li class="r1 ">
|
418
|
-
<span class='object_link'><a href="Mbrao/Validations/ClassMethods.html#
|
418
|
+
<span class='object_link'><a href="Mbrao/Validations/ClassMethods.html#sanitized_hash-instance_method" title="Mbrao::Validations::ClassMethods#sanitized_hash (method)">#sanitized_hash</a></span>
|
419
419
|
|
420
420
|
<small>Mbrao::Validations::ClassMethods</small>
|
421
421
|
|
@@ -423,9 +423,9 @@
|
|
423
423
|
|
424
424
|
|
425
425
|
<li class="r2 ">
|
426
|
-
<span class='object_link'><a href="Mbrao/
|
426
|
+
<span class='object_link'><a href="Mbrao/ParsingEngines/Base.html#separate_components-instance_method" title="Mbrao::ParsingEngines::Base#separate_components (method)">#separate_components</a></span>
|
427
427
|
|
428
|
-
<small>Mbrao::
|
428
|
+
<small>Mbrao::ParsingEngines::Base</small>
|
429
429
|
|
430
430
|
</li>
|
431
431
|
|
@@ -439,14 +439,6 @@
|
|
439
439
|
|
440
440
|
|
441
441
|
<li class="r2 ">
|
442
|
-
<span class='object_link'><a href="Mbrao/ParsingEngines/Base.html#separate_components-instance_method" title="Mbrao::ParsingEngines::Base#separate_components (method)">#separate_components</a></span>
|
443
|
-
|
444
|
-
<small>Mbrao::ParsingEngines::Base</small>
|
445
|
-
|
446
|
-
</li>
|
447
|
-
|
448
|
-
|
449
|
-
<li class="r1 ">
|
450
442
|
<span class='object_link'><a href="ActionView/Template/Handlers/MbraoTemplate.html#supports_streaming%3F-instance_method" title="ActionView::Template::Handlers::MbraoTemplate#supports_streaming? (method)">#supports_streaming?</a></span>
|
451
443
|
|
452
444
|
<small>ActionView::Template::Handlers::MbraoTemplate</small>
|
@@ -454,7 +446,7 @@
|
|
454
446
|
</li>
|
455
447
|
|
456
448
|
|
457
|
-
<li class="
|
449
|
+
<li class="r1 ">
|
458
450
|
<span class='object_link'><a href="Mbrao/Content.html#tags-instance_method" title="Mbrao::Content#tags (method)">#tags</a></span>
|
459
451
|
|
460
452
|
<small>Mbrao::Content</small>
|
@@ -462,7 +454,7 @@
|
|
462
454
|
</li>
|
463
455
|
|
464
456
|
|
465
|
-
<li class="
|
457
|
+
<li class="r2 ">
|
466
458
|
<span class='object_link'><a href="Mbrao/Content.html#title-instance_method" title="Mbrao::Content#title (method)">#title</a></span>
|
467
459
|
|
468
460
|
<small>Mbrao::Content</small>
|
@@ -470,7 +462,7 @@
|
|
470
462
|
</li>
|
471
463
|
|
472
464
|
|
473
|
-
<li class="
|
465
|
+
<li class="r1 ">
|
474
466
|
<span class='object_link'><a href="Mbrao/Author.html#uid-instance_method" title="Mbrao::Author#uid (method)">#uid</a></span>
|
475
467
|
|
476
468
|
<small>Mbrao::Author</small>
|
@@ -478,7 +470,7 @@
|
|
478
470
|
</li>
|
479
471
|
|
480
472
|
|
481
|
-
<li class="
|
473
|
+
<li class="r2 ">
|
482
474
|
<span class='object_link'><a href="Mbrao/Content.html#uid-instance_method" title="Mbrao::Content#uid (method)">#uid</a></span>
|
483
475
|
|
484
476
|
<small>Mbrao::Content</small>
|
@@ -486,7 +478,7 @@
|
|
486
478
|
</li>
|
487
479
|
|
488
480
|
|
489
|
-
<li class="
|
481
|
+
<li class="r1 ">
|
490
482
|
<span class='object_link'><a href="Mbrao/Content.html#updated_at-instance_method" title="Mbrao::Content#updated_at (method)">#updated_at</a></span>
|
491
483
|
|
492
484
|
<small>Mbrao::Content</small>
|
@@ -494,7 +486,7 @@
|
|
494
486
|
</li>
|
495
487
|
|
496
488
|
|
497
|
-
<li class="
|
489
|
+
<li class="r2 ">
|
498
490
|
<span class='object_link'><a href="Mbrao/Content.html#validate_locales-class_method" title="Mbrao::Content.validate_locales (method)">validate_locales</a></span>
|
499
491
|
|
500
492
|
<small>Mbrao::Content</small>
|
@@ -502,7 +494,7 @@
|
|
502
494
|
</li>
|
503
495
|
|
504
496
|
|
505
|
-
<li class="
|
497
|
+
<li class="r1 ">
|
506
498
|
<span class='object_link'><a href="Mbrao/Author.html#website-instance_method" title="Mbrao::Author#website (method)">#website</a></span>
|
507
499
|
|
508
500
|
<small>Mbrao::Author</small>
|
@@ -103,7 +103,7 @@
|
|
103
103
|
</div>
|
104
104
|
|
105
105
|
<div id="footer">
|
106
|
-
Generated on
|
106
|
+
Generated on Sun Mar 24 11:07:07 2013 by
|
107
107
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
108
108
|
0.8.5.2 (ruby-1.9.3).
|
109
109
|
</div>
|
data/lib/mbrao/parser.rb
CHANGED
@@ -71,37 +71,13 @@ module Mbrao
|
|
71
71
|
def create_engine(cls, type = :parsing)
|
72
72
|
begin
|
73
73
|
type = :parsing if type != :rendering
|
74
|
-
::
|
75
|
-
rescue
|
74
|
+
::Lazier.find_class(cls, "::Mbrao::#{type.to_s.classify}Engines::%CLASS%").new
|
75
|
+
rescue NameError => _
|
76
76
|
raise Mbrao::Exceptions::UnknownEngine.new
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
|
-
# Finds a class to instantiate.
|
81
|
-
#
|
82
|
-
# @param cls [Symbol|String|Object] If a `String` or a `Symbol` or a `Class`, then it will be the class to instantiate. Otherwise the class of the object will returned.
|
83
|
-
# @param scope [String] An additional scope to find the class. `%CLASS%` will be substituted with the class name.
|
84
|
-
# @param only_in_scope [Boolean] If only try to instantiate the class in the scope.
|
85
|
-
# @return [Class] The found class.
|
86
|
-
def find_class(cls, scope = "::%CLASS%", only_in_scope = false)
|
87
|
-
if cls.is_a?(String) || cls.is_a?(Symbol) then
|
88
|
-
rv = nil
|
89
|
-
|
90
|
-
cls = cls.to_s.camelize
|
91
|
-
if only_in_scope then
|
92
|
-
cls.gsub!(/^::/, "")
|
93
|
-
else
|
94
|
-
rv = (cls.constantize rescue nil)
|
95
|
-
end
|
96
80
|
|
97
|
-
rv = (scope.ensure_string.gsub("%CLASS%", cls).constantize rescue nil) if !rv && cls !~ /^::/ && scope.present?
|
98
|
-
rv || raise(Mbrao::Exceptions::Unimplemented.new(cls))
|
99
|
-
elsif cls.is_a?(Class)
|
100
|
-
cls
|
101
|
-
else
|
102
|
-
cls.class
|
103
|
-
end
|
104
|
-
end
|
105
81
|
|
106
82
|
# Returns a unique (singleton) instance of the parser.
|
107
83
|
#
|
@@ -118,7 +118,7 @@ module Mbrao
|
|
118
118
|
# @param context [Hash] A context for rendering.
|
119
119
|
# @return [HTML::Pipeline] The pipeline
|
120
120
|
def create_pipeline(options, context)
|
121
|
-
::HTML::Pipeline.new(options[:pipeline].collect {|f| ::
|
121
|
+
::HTML::Pipeline.new(options[:pipeline].collect {|f| ::Lazier.find_class(f, "::HTML::Pipeline::%CLASS%Filter", true) }, options[:pipeline_options].merge(context))
|
122
122
|
end
|
123
123
|
|
124
124
|
# Filters pipeline filters basing on the options provided.
|
data/lib/mbrao/version.rb
CHANGED