mbrao 1.4.4 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +29 -0
  3. data/.travis.yml +3 -4
  4. data/CHANGELOG.md +5 -0
  5. data/Gemfile +4 -4
  6. data/doc/ActionView.html +125 -0
  7. data/doc/ActionView/Template.html +140 -0
  8. data/doc/ActionView/Template/Handlers.html +3 -3
  9. data/doc/ActionView/Template/Handlers/MbraoTemplate.html +26 -26
  10. data/doc/HTML.html +2 -2
  11. data/doc/HTML/Pipeline.html +2 -2
  12. data/doc/HTML/Pipeline/KramdownFilter.html +4 -4
  13. data/doc/Mbrao.html +3 -3
  14. data/doc/Mbrao/Author.html +29 -29
  15. data/doc/Mbrao/Content.html +1977 -3644
  16. data/doc/Mbrao/ContentInterface.html +817 -0
  17. data/doc/Mbrao/ContentInterface/ClassMethods.html +388 -0
  18. data/doc/Mbrao/Exceptions.html +1 -1
  19. data/doc/Mbrao/Exceptions/InvalidDate.html +1 -1
  20. data/doc/Mbrao/Exceptions/InvalidMetadata.html +1 -1
  21. data/doc/Mbrao/Exceptions/Parsing.html +1 -1
  22. data/doc/Mbrao/Exceptions/Rendering.html +1 -1
  23. data/doc/Mbrao/Exceptions/UnavailableLocalization.html +1 -1
  24. data/doc/Mbrao/Exceptions/Unimplemented.html +1 -1
  25. data/doc/Mbrao/Exceptions/UnknownEngine.html +1 -1
  26. data/doc/Mbrao/Parser.html +12 -12
  27. data/doc/Mbrao/ParserInterface.html +134 -0
  28. data/doc/Mbrao/ParserInterface/ClassMethods.html +1724 -0
  29. data/doc/Mbrao/ParserValidations.html +134 -0
  30. data/doc/Mbrao/ParserValidations/ClassMethods.html +348 -0
  31. data/doc/Mbrao/ParsingEngines.html +1 -1
  32. data/doc/Mbrao/ParsingEngines/Base.html +4 -4
  33. data/doc/Mbrao/ParsingEngines/PlainText.html +25 -15
  34. data/doc/Mbrao/RenderingEngines.html +1 -1
  35. data/doc/Mbrao/RenderingEngines/Base.html +2 -2
  36. data/doc/Mbrao/RenderingEngines/HtmlPipeline.html +173 -169
  37. data/doc/Mbrao/Version.html +3 -3
  38. data/doc/_index.html +51 -24
  39. data/doc/class_list.html +1 -1
  40. data/doc/file.README.html +1 -1
  41. data/doc/index.html +1 -1
  42. data/doc/method_list.html +63 -69
  43. data/doc/top-level-namespace.html +2 -2
  44. data/lib/mbrao.rb +7 -2
  45. data/lib/mbrao/author.rb +5 -5
  46. data/lib/mbrao/content.rb +110 -256
  47. data/lib/mbrao/content_interface.rb +146 -0
  48. data/lib/mbrao/exceptions.rb +1 -1
  49. data/lib/mbrao/integrations/rails.rb +48 -42
  50. data/lib/mbrao/parser.rb +24 -176
  51. data/lib/mbrao/parser_interface.rb +143 -0
  52. data/lib/mbrao/parser_validations.rb +41 -0
  53. data/lib/mbrao/parsing_engines/base.rb +4 -4
  54. data/lib/mbrao/parsing_engines/plain_text.rb +136 -121
  55. data/lib/mbrao/rendering_engines/base.rb +2 -2
  56. data/lib/mbrao/rendering_engines/html_pipeline.rb +52 -77
  57. data/lib/mbrao/rendering_engines/html_pipeline/kramdown_filter.rb +31 -0
  58. data/lib/mbrao/version.rb +2 -2
  59. data/mbrao.gemspec +3 -3
  60. data/spec/mbrao/author_spec.rb +1 -1
  61. data/spec/mbrao/content_spec.rb +1 -1
  62. data/spec/mbrao/parser_spec.rb +16 -16
  63. data/spec/mbrao/rendering_engines/html_pipeline/kramdown_filter_spec.rb +28 -0
  64. data/spec/mbrao/rendering_engines/html_pipeline_spec.rb +0 -21
  65. metadata +23 -8
@@ -0,0 +1,134 @@
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
+ Module: Mbrao::ParserValidations
8
+
9
+ &mdash; Documentation by YARD 0.8.7.4
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" 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#!Mbrao/ParserValidations.html";
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">ParserValidations</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>Module: Mbrao::ParserValidations
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+
75
+
76
+ <dt class="r1">Extended by:</dt>
77
+ <dd class="r1">ActiveSupport::Concern</dd>
78
+
79
+
80
+
81
+
82
+
83
+
84
+ <dt class="r2">Included in:</dt>
85
+ <dd class="r2"><span class='object_link'><a href="Parser.html" title="Mbrao::Parser (class)">Parser</a></span></dd>
86
+
87
+
88
+
89
+ <dt class="r1 last">Defined in:</dt>
90
+ <dd class="r1 last">lib/mbrao/parser_validations.rb</dd>
91
+
92
+ </dl>
93
+ <div class="clear"></div>
94
+
95
+ <h2>Overview</h2><div class="docstring">
96
+ <div class="discussion">
97
+ <p>Methods to perform validations.</p>
98
+
99
+
100
+ </div>
101
+ </div>
102
+ <div class="tags">
103
+
104
+
105
+ </div><h2>Defined Under Namespace</h2>
106
+ <p class="children">
107
+
108
+
109
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="ParserValidations/ClassMethods.html" title="Mbrao::ParserValidations::ClassMethods (module)">ClassMethods</a></span>
110
+
111
+
112
+
113
+
114
+ </p>
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+ </div>
126
+
127
+ <div id="footer">
128
+ Generated on Sun May 11 18:17:17 2014 by
129
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
130
+ 0.8.7.4 (ruby-2.1.0).
131
+ </div>
132
+
133
+ </body>
134
+ </html>
@@ -0,0 +1,348 @@
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
+ Module: Mbrao::ParserValidations::ClassMethods
8
+
9
+ &mdash; Documentation by YARD 0.8.7.4
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" 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#!Mbrao/ParserValidations/ClassMethods.html";
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 (C)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../../Mbrao.html" title="Mbrao (module)">Mbrao</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../ParserValidations.html" title="Mbrao::ParserValidations (module)">ParserValidations</a></span></span>
36
+ &raquo;
37
+ <span class="title">ClassMethods</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>Module: Mbrao::ParserValidations::ClassMethods
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+ <dt class="r1 last">Defined in:</dt>
82
+ <dd class="r1 last">lib/mbrao/parser_validations.rb</dd>
83
+
84
+ </dl>
85
+ <div class="clear"></div>
86
+
87
+ <h2>Overview</h2><div class="docstring">
88
+ <div class="discussion">
89
+ <p>Class methods.</p>
90
+
91
+
92
+ </div>
93
+ </div>
94
+ <div class="tags">
95
+
96
+
97
+ </div>
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+ <h2>
106
+ Instance Method Summary
107
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
108
+ </h2>
109
+
110
+ <ul class="summary">
111
+
112
+ <li class="public ">
113
+ <span class="summary_signature">
114
+
115
+ <a href="#email%3F-instance_method" title="#email? (instance method)">- (Boolean) <strong>email?</strong>(text) </a>
116
+
117
+
118
+
119
+ </span>
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+ <span class="summary_desc"><div class='inline'><p>Checks if the text is a valid email.</p>
130
+ </div></span>
131
+
132
+ </li>
133
+
134
+
135
+ <li class="public ">
136
+ <span class="summary_signature">
137
+
138
+ <a href="#url%3F-instance_method" title="#url? (instance method)">- (Boolean) <strong>url?</strong>(text) </a>
139
+
140
+
141
+
142
+ </span>
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+ <span class="summary_desc"><div class='inline'><p>Checks if the text is a valid URL.</p>
153
+ </div></span>
154
+
155
+ </li>
156
+
157
+
158
+ </ul>
159
+
160
+
161
+
162
+
163
+ <div id="instance_method_details" class="method_details_list">
164
+ <h2>Instance Method Details</h2>
165
+
166
+
167
+ <div class="method_details first">
168
+ <h3 class="signature first" id="email?-instance_method">
169
+
170
+ - (<tt>Boolean</tt>) <strong>email?</strong>(text)
171
+
172
+
173
+
174
+
175
+
176
+ </h3><div class="docstring">
177
+ <div class="discussion">
178
+ <p>Checks if the text is a valid email.</p>
179
+
180
+
181
+ </div>
182
+ </div>
183
+ <div class="tags">
184
+ <p class="tag_title">Parameters:</p>
185
+ <ul class="param">
186
+
187
+ <li>
188
+
189
+ <span class='name'>text</span>
190
+
191
+
192
+ <span class='type'>(<tt>String</tt>)</span>
193
+
194
+
195
+
196
+ &mdash;
197
+ <div class='inline'><p>The text to check.</p>
198
+ </div>
199
+
200
+ </li>
201
+
202
+ </ul>
203
+
204
+ <p class="tag_title">Returns:</p>
205
+ <ul class="return">
206
+
207
+ <li>
208
+
209
+
210
+ <span class='type'>(<tt>Boolean</tt>)</span>
211
+
212
+
213
+
214
+ &mdash;
215
+ <div class='inline'><p><code>true</code> if the string is valid email, <code>false</code> otherwise.</p>
216
+ </div>
217
+
218
+ </li>
219
+
220
+ </ul>
221
+
222
+ </div><table class="source_code">
223
+ <tr>
224
+ <td>
225
+ <pre class="lines">
226
+
227
+
228
+ 19
229
+ 20
230
+ 21</pre>
231
+ </td>
232
+ <td>
233
+ <pre class="code"><span class="info file"># File 'lib/mbrao/parser_validations.rb', line 19</span>
234
+
235
+ <span class='kw'>def</span> <span class='id identifier rubyid_email?'>email?</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
236
+ <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><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</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='rparen'>)</span>
237
+ <span class='kw'>end</span></pre>
238
+ </td>
239
+ </tr>
240
+ </table>
241
+ </div>
242
+
243
+ <div class="method_details ">
244
+ <h3 class="signature " id="url?-instance_method">
245
+
246
+ - (<tt>Boolean</tt>) <strong>url?</strong>(text)
247
+
248
+
249
+
250
+
251
+
252
+ </h3><div class="docstring">
253
+ <div class="discussion">
254
+ <p>Checks if the text is a valid URL.</p>
255
+
256
+
257
+ </div>
258
+ </div>
259
+ <div class="tags">
260
+ <p class="tag_title">Parameters:</p>
261
+ <ul class="param">
262
+
263
+ <li>
264
+
265
+ <span class='name'>text</span>
266
+
267
+
268
+ <span class='type'>(<tt>String</tt>)</span>
269
+
270
+
271
+
272
+ &mdash;
273
+ <div class='inline'><p>The text to check.</p>
274
+ </div>
275
+
276
+ </li>
277
+
278
+ </ul>
279
+
280
+ <p class="tag_title">Returns:</p>
281
+ <ul class="return">
282
+
283
+ <li>
284
+
285
+
286
+ <span class='type'>(<tt>Boolean</tt>)</span>
287
+
288
+
289
+
290
+ &mdash;
291
+ <div class='inline'><p><code>true</code> if the string is valid URL, <code>false</code> otherwise.</p>
292
+ </div>
293
+
294
+ </li>
295
+
296
+ </ul>
297
+
298
+ </div><table class="source_code">
299
+ <tr>
300
+ <td>
301
+ <pre class="lines">
302
+
303
+
304
+ 27
305
+ 28
306
+ 29
307
+ 30
308
+ 31
309
+ 32
310
+ 33
311
+ 34
312
+ 35
313
+ 36
314
+ 37
315
+ 38</pre>
316
+ </td>
317
+ <td>
318
+ <pre class="code"><span class="info file"># File 'lib/mbrao/parser_validations.rb', line 27</span>
319
+
320
+ <span class='kw'>def</span> <span class='id identifier rubyid_url?'>url?</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
321
+ <span class='tstring'><span class='regexp_beg'>%r{</span><span class='tstring_content'>
322
+ ^(
323
+ ([a-z0-9\-]+:\/\/) #PROTOCOL
324
+ (([\w-]+\.)?) # LOWEST TLD
325
+ ([\w-]+) # 2nd LEVEL TLD
326
+ (\.[a-z]+) # TOP TLD
327
+ ((:\d+)?) # PORT
328
+ ([\S|\?]*) # PATH, QUERYSTRING AND FRAGMENT
329
+ )$
330
+ </span><span class='regexp_end'>}ix</span></span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</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='rparen'>)</span>
331
+ <span class='kw'>end</span></pre>
332
+ </td>
333
+ </tr>
334
+ </table>
335
+ </div>
336
+
337
+ </div>
338
+
339
+ </div>
340
+
341
+ <div id="footer">
342
+ Generated on Sun May 11 18:17:17 2014 by
343
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
344
+ 0.8.7.4 (ruby-2.1.0).
345
+ </div>
346
+
347
+ </body>
348
+ </html>