mbrao 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. data/.gitignore +6 -0
  2. data/.travis-gemfile +13 -0
  3. data/.travis.yml +8 -0
  4. data/.yardopts +1 -0
  5. data/Gemfile +21 -0
  6. data/README.md +60 -0
  7. data/Rakefile +11 -0
  8. data/doc/ActionView/Template/Handlers/MbraoTemplate.html +568 -0
  9. data/doc/ActionView/Template/Handlers.html +125 -0
  10. data/doc/HTML/Pipeline/KramdownFilter.html +354 -0
  11. data/doc/HTML/Pipeline.html +140 -0
  12. data/doc/HTML.html +125 -0
  13. data/doc/Mbrao/Author.html +1402 -0
  14. data/doc/Mbrao/Content.html +4779 -0
  15. data/doc/Mbrao/ContentPublicInterface.html +658 -0
  16. data/doc/Mbrao/Exceptions/InvalidDate.html +133 -0
  17. data/doc/Mbrao/Exceptions/InvalidMetadata.html +133 -0
  18. data/doc/Mbrao/Exceptions/Parsing.html +133 -0
  19. data/doc/Mbrao/Exceptions/Rendering.html +133 -0
  20. data/doc/Mbrao/Exceptions/UnavailableLocalization.html +133 -0
  21. data/doc/Mbrao/Exceptions/Unimplemented.html +133 -0
  22. data/doc/Mbrao/Exceptions/UnknownEngine.html +133 -0
  23. data/doc/Mbrao/Exceptions.html +125 -0
  24. data/doc/Mbrao/Parser.html +418 -0
  25. data/doc/Mbrao/ParsingEngines/Base.html +658 -0
  26. data/doc/Mbrao/ParsingEngines/PlainText.html +571 -0
  27. data/doc/Mbrao/ParsingEngines.html +127 -0
  28. data/doc/Mbrao/PublicInterface/ClassMethods.html +1727 -0
  29. data/doc/Mbrao/PublicInterface.html +134 -0
  30. data/doc/Mbrao/RenderingEngines/Base.html +280 -0
  31. data/doc/Mbrao/RenderingEngines/HtmlPipeline.html +873 -0
  32. data/doc/Mbrao/RenderingEngines.html +127 -0
  33. data/doc/Mbrao/Validations/ClassMethods.html +692 -0
  34. data/doc/Mbrao/Validations.html +134 -0
  35. data/doc/Mbrao/Version.html +189 -0
  36. data/doc/Mbrao.html +130 -0
  37. data/doc/_index.html +395 -0
  38. data/doc/class_list.html +53 -0
  39. data/doc/css/common.css +1 -0
  40. data/doc/css/full_list.css +57 -0
  41. data/doc/css/style.css +338 -0
  42. data/doc/file.README.html +135 -0
  43. data/doc/file_list.html +55 -0
  44. data/doc/frames.html +28 -0
  45. data/doc/index.html +135 -0
  46. data/doc/js/app.js +214 -0
  47. data/doc/js/full_list.js +173 -0
  48. data/doc/js/jquery.js +4 -0
  49. data/doc/method_list.html +516 -0
  50. data/doc/top-level-namespace.html +112 -0
  51. data/lib/mbrao/author.rb +61 -0
  52. data/lib/mbrao/content.rb +300 -0
  53. data/lib/mbrao/exceptions.rb +38 -0
  54. data/lib/mbrao/integrations/rails.rb +51 -0
  55. data/lib/mbrao/parser.rb +276 -0
  56. data/lib/mbrao/parsing_engines/base.rb +51 -0
  57. data/lib/mbrao/parsing_engines/plain_text.rb +187 -0
  58. data/lib/mbrao/rendering_engines/base.rb +22 -0
  59. data/lib/mbrao/rendering_engines/html_pipeline.rb +147 -0
  60. data/lib/mbrao/version.rb +25 -0
  61. data/lib/mbrao.rb +24 -0
  62. data/mbrao.gemspec +31 -0
  63. data/spec/coverage_helper.rb +17 -0
  64. data/spec/mbrao/author_spec.rb +62 -0
  65. data/spec/mbrao/content_spec.rb +280 -0
  66. data/spec/mbrao/integrations/rails_spec.rb +92 -0
  67. data/spec/mbrao/parser_spec.rb +269 -0
  68. data/spec/mbrao/parsing_engines/base_spec.rb +52 -0
  69. data/spec/mbrao/parsing_engines/plain_text_spec.rb +141 -0
  70. data/spec/mbrao/rendering_engines/base_spec.rb +17 -0
  71. data/spec/mbrao/rendering_engines/html_pipeline_spec.rb +128 -0
  72. data/spec/spec_helper.rb +15 -0
  73. metadata +195 -0
@@ -0,0 +1,418 @@
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::Parser
8
+
9
+ &mdash; 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 (P)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../Mbrao.html" title="Mbrao (module)">Mbrao</a></span></span>
36
+ &raquo;
37
+ <span class="title">Parser</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::Parser
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::Parser</li>
82
+
83
+ </ul>
84
+ <a href="#" class="inheritanceTree">show all</a>
85
+
86
+ </dd>
87
+
88
+
89
+
90
+
91
+
92
+
93
+ <dt class="r2">Includes:</dt>
94
+ <dd class="r2"><span class='object_link'><a href="PublicInterface.html" title="Mbrao::PublicInterface (module)">PublicInterface</a></span>, <span class='object_link'><a href="Validations.html" title="Mbrao::Validations (module)">Validations</a></span></dd>
95
+
96
+
97
+
98
+
99
+
100
+ <dt class="r1 last">Defined in:</dt>
101
+ <dd class="r1 last">lib/mbrao/parser.rb</dd>
102
+
103
+ </dl>
104
+ <div class="clear"></div>
105
+
106
+ <h2>Overview</h2><div class="docstring">
107
+ <div class="discussion">
108
+ <p>A parser to handle pipelined content.</p>
109
+
110
+
111
+ </div>
112
+ </div>
113
+ <div class="tags">
114
+
115
+
116
+ </div>
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="#parse-instance_method" title="#parse (instance method)">- (Content) <strong>parse</strong>(content, 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>Parses a source text.</p>
149
+ </div></span>
150
+
151
+ </li>
152
+
153
+
154
+ <li class="public ">
155
+ <span class="summary_signature">
156
+
157
+ <a href="#render-instance_method" title="#render (instance method)">- (String) <strong>render</strong>(content, options = {}, context = {}) </a>
158
+
159
+
160
+
161
+ </span>
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+ <span class="summary_desc"><div class='inline'><p>Renders a content.</p>
172
+ </div></span>
173
+
174
+ </li>
175
+
176
+
177
+ </ul>
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+ <div id="instance_method_details" class="method_details_list">
197
+ <h2>Instance Method Details</h2>
198
+
199
+
200
+ <div class="method_details first">
201
+ <h3 class="signature first" id="parse-instance_method">
202
+
203
+ - (<tt><span class='object_link'><a href="Content.html" title="Mbrao::Content (class)">Content</a></span></tt>) <strong>parse</strong>(content, options = {})
204
+
205
+
206
+
207
+
208
+
209
+ </h3><div class="docstring">
210
+ <div class="discussion">
211
+ <p>Parses a source text.</p>
212
+
213
+
214
+ </div>
215
+ </div>
216
+ <div class="tags">
217
+ <p class="tag_title">Parameters:</p>
218
+ <ul class="param">
219
+
220
+ <li>
221
+
222
+ <span class='name'>content</span>
223
+
224
+
225
+ <span class='type'>(<tt>Object</tt>)</span>
226
+
227
+
228
+
229
+ &mdash;
230
+ <div class='inline'><p>The content to parse.</p>
231
+ </div>
232
+
233
+ </li>
234
+
235
+ <li>
236
+
237
+ <span class='name'>options</span>
238
+
239
+
240
+ <span class='type'>(<tt>Hash</tt>)</span>
241
+
242
+
243
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
244
+
245
+
246
+ &mdash;
247
+ <div class='inline'><p>A list of options for parsing.</p>
248
+ </div>
249
+
250
+ </li>
251
+
252
+ </ul>
253
+
254
+ <p class="tag_title">Returns:</p>
255
+ <ul class="return">
256
+
257
+ <li>
258
+
259
+
260
+ <span class='type'>(<tt><span class='object_link'><a href="Content.html" title="Mbrao::Content (class)">Content</a></span></tt>)</span>
261
+
262
+
263
+
264
+ &mdash;
265
+ <div class='inline'><p>The parsed data.</p>
266
+ </div>
267
+
268
+ </li>
269
+
270
+ </ul>
271
+
272
+ </div><table class="source_code">
273
+ <tr>
274
+ <td>
275
+ <pre class="lines">
276
+
277
+
278
+ 233
279
+ 234
280
+ 235
281
+ 236</pre>
282
+ </td>
283
+ <td>
284
+ <pre class="code"><span class="info file"># File 'lib/mbrao/parser.rb', line 233</span>
285
+
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
+ <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>
288
+ <span class='op'>::</span><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_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:engine</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</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='rparen'>)</span>
289
+ <span class='kw'>end</span></pre>
290
+ </td>
291
+ </tr>
292
+ </table>
293
+ </div>
294
+
295
+ <div class="method_details ">
296
+ <h3 class="signature " id="render-instance_method">
297
+
298
+ - (<tt>String</tt>) <strong>render</strong>(content, options = {}, context = {})
299
+
300
+
301
+
302
+
303
+
304
+ </h3><div class="docstring">
305
+ <div class="discussion">
306
+ <p>Renders a content.</p>
307
+
308
+
309
+ </div>
310
+ </div>
311
+ <div class="tags">
312
+ <p class="tag_title">Parameters:</p>
313
+ <ul class="param">
314
+
315
+ <li>
316
+
317
+ <span class='name'>content</span>
318
+
319
+
320
+ <span class='type'>(<tt><span class='object_link'><a href="Content.html" title="Mbrao::Content (class)">Content</a></span></tt>)</span>
321
+
322
+
323
+
324
+ &mdash;
325
+ <div class='inline'><p>The content to parse.</p>
326
+ </div>
327
+
328
+ </li>
329
+
330
+ <li>
331
+
332
+ <span class='name'>options</span>
333
+
334
+
335
+ <span class='type'>(<tt>Hash</tt>)</span>
336
+
337
+
338
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
339
+
340
+
341
+ &mdash;
342
+ <div class='inline'><p>A list of options for renderer.</p>
343
+ </div>
344
+
345
+ </li>
346
+
347
+ <li>
348
+
349
+ <span class='name'>context</span>
350
+
351
+
352
+ <span class='type'>(<tt>Hash</tt>)</span>
353
+
354
+
355
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
356
+
357
+
358
+ &mdash;
359
+ <div class='inline'><p>A context for rendering.</p>
360
+ </div>
361
+
362
+ </li>
363
+
364
+ </ul>
365
+
366
+ <p class="tag_title">Returns:</p>
367
+ <ul class="return">
368
+
369
+ <li>
370
+
371
+
372
+ <span class='type'>(<tt>String</tt>)</span>
373
+
374
+
375
+
376
+ &mdash;
377
+ <div class='inline'><p>The rendered content.</p>
378
+ </div>
379
+
380
+ </li>
381
+
382
+ </ul>
383
+
384
+ </div><table class="source_code">
385
+ <tr>
386
+ <td>
387
+ <pre class="lines">
388
+
389
+
390
+ 244
391
+ 245
392
+ 246
393
+ 247</pre>
394
+ </td>
395
+ <td>
396
+ <pre class="code"><span class="info file"># File 'lib/mbrao/parser.rb', line 244</span>
397
+
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
+ <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>
400
+ <span class='op'>::</span><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_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:engine</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:rendering</span><span class='rparen'>)</span><span class='period'>.</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='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
401
+ <span class='kw'>end</span></pre>
402
+ </td>
403
+ </tr>
404
+ </table>
405
+ </div>
406
+
407
+ </div>
408
+
409
+ </div>
410
+
411
+ <div id="footer">
412
+ Generated on Fri Mar 1 09:13:31 2013 by
413
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
414
+ 0.8.5.2 (ruby-1.9.3).
415
+ </div>
416
+
417
+ </body>
418
+ </html>