rack-blogengine 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,1708 +0,0 @@
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: Rack::Blogengine::DocumentParser
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#!Rack/Blogengine/DocumentParser.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 (D)</a> &raquo;
35
- <span class='title'><span class='object_link'><a href="../../Rack.html" title="Rack (module)">Rack</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Blogengine.html" title="Rack::Blogengine (module)">Blogengine</a></span></span>
36
- &raquo;
37
- <span class="title">DocumentParser</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: Rack::Blogengine::DocumentParser
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/rack/blogengine/document_parser.rb</dd>
83
-
84
- </dl>
85
- <div class="clear"></div>
86
-
87
- <h2>Overview</h2><div class="docstring">
88
- <div class="discussion">
89
-
90
- <p>Prepares the documents for the response Reads in layout.html and .content
91
- file -&gt; merged html Sort documents by date Execute Content Operator
92
- after all documents has been parsed in</p>
93
-
94
-
95
- </div>
96
- </div>
97
- <div class="tags">
98
-
99
- <p class="tag_title">Author:</p>
100
- <ul class="author">
101
-
102
- <li>
103
-
104
-
105
-
106
-
107
-
108
- <div class='inline'><dl class="rdoc-list label-list"><dt>benny
109
- <dd></dd></dl>
110
- </div>
111
-
112
- </li>
113
-
114
- </ul>
115
-
116
- </div>
117
-
118
-
119
-
120
- <h2>Class Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
121
- <ul class="summary">
122
-
123
- <li class="private ">
124
- <span class="summary_signature">
125
-
126
- <a href="#content-class_method" title="content (class method)">+ (Object) <strong>content</strong> </a>
127
-
128
-
129
-
130
- </span>
131
-
132
-
133
-
134
-
135
-
136
-
137
- <span class="note title private">private</span>
138
-
139
-
140
-
141
-
142
-
143
- <span class="summary_desc"><div class='inline'>
144
- <p>Returns the value of attribute content.</p>
145
- </div></span>
146
-
147
- </li>
148
-
149
-
150
- <li class="private ">
151
- <span class="summary_signature">
152
-
153
- <a href="#date-class_method" title="date (class method)">+ (Object) <strong>date</strong> </a>
154
-
155
-
156
-
157
- </span>
158
-
159
-
160
-
161
-
162
-
163
-
164
- <span class="note title private">private</span>
165
-
166
-
167
-
168
-
169
-
170
- <span class="summary_desc"><div class='inline'>
171
- <p>Returns the value of attribute date.</p>
172
- </div></span>
173
-
174
- </li>
175
-
176
-
177
- <li class="private ">
178
- <span class="summary_signature">
179
-
180
- <a href="#html-class_method" title="html (class method)">+ (Object) <strong>html</strong> </a>
181
-
182
-
183
-
184
- </span>
185
-
186
-
187
-
188
-
189
-
190
-
191
- <span class="note title private">private</span>
192
-
193
-
194
-
195
-
196
-
197
- <span class="summary_desc"><div class='inline'>
198
- <p>Returns the value of attribute html.</p>
199
- </div></span>
200
-
201
- </li>
202
-
203
-
204
- <li class="private ">
205
- <span class="summary_signature">
206
-
207
- <a href="#layout-class_method" title="layout (class method)">+ (Object) <strong>layout</strong> </a>
208
-
209
-
210
-
211
- </span>
212
-
213
-
214
-
215
-
216
-
217
-
218
- <span class="note title private">private</span>
219
-
220
-
221
-
222
-
223
-
224
- <span class="summary_desc"><div class='inline'>
225
- <p>Returns the value of attribute layout.</p>
226
- </div></span>
227
-
228
- </li>
229
-
230
-
231
- <li class="private ">
232
- <span class="summary_signature">
233
-
234
- <a href="#path-class_method" title="path (class method)">+ (Object) <strong>path</strong> </a>
235
-
236
-
237
-
238
- </span>
239
-
240
-
241
-
242
-
243
-
244
-
245
- <span class="note title private">private</span>
246
-
247
-
248
-
249
-
250
-
251
- <span class="summary_desc"><div class='inline'>
252
- <p>Returns the value of attribute path.</p>
253
- </div></span>
254
-
255
- </li>
256
-
257
-
258
- <li class="public ">
259
- <span class="summary_signature">
260
-
261
- <a href="#target-class_method" title="target (class method)">+ (Object) <strong>target</strong> </a>
262
-
263
-
264
-
265
- </span>
266
-
267
-
268
-
269
-
270
-
271
-
272
-
273
-
274
-
275
-
276
-
277
-
278
- <span class="summary_desc"><div class='inline'>
279
- <p>Returns the value of attribute target.</p>
280
- </div></span>
281
-
282
- </li>
283
-
284
-
285
- <li class="private ">
286
- <span class="summary_signature">
287
-
288
- <a href="#title-class_method" title="title (class method)">+ (Object) <strong>title</strong> </a>
289
-
290
-
291
-
292
- </span>
293
-
294
-
295
-
296
-
297
-
298
-
299
- <span class="note title private">private</span>
300
-
301
-
302
-
303
-
304
-
305
- <span class="summary_desc"><div class='inline'>
306
- <p>Returns the value of attribute title.</p>
307
- </div></span>
308
-
309
- </li>
310
-
311
-
312
- </ul>
313
-
314
-
315
-
316
-
317
-
318
- <h2>
319
- Class Method Summary
320
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
321
- </h2>
322
-
323
- <ul class="summary">
324
-
325
- <li class="private ">
326
- <span class="summary_signature">
327
-
328
- <a href="#fill_file_contents-class_method" title="fill_file_contents (class method)">+ (String) <strong>fill_file_contents</strong>(layout, title, content, date) </a>
329
-
330
-
331
-
332
- </span>
333
-
334
-
335
-
336
- <span class="note title private">private</span>
337
-
338
-
339
-
340
-
341
-
342
- <span class="summary_desc"><div class='inline'>
343
- <p>Replace layout placeholder with content from .content file.</p>
344
- </div></span>
345
-
346
- </li>
347
-
348
-
349
- <li class="private ">
350
- <span class="summary_signature">
351
-
352
- <a href="#generate_highlight_css-class_method" title="generate_highlight_css (class method)">+ (Object) <strong>generate_highlight_css</strong>(target) </a>
353
-
354
-
355
-
356
- </span>
357
-
358
-
359
-
360
- <span class="note title private">private</span>
361
-
362
-
363
-
364
-
365
-
366
- <span class="summary_desc"><div class='inline'>
367
- <p>Populates highlight.css with specific highlight css.</p>
368
- </div></span>
369
-
370
- </li>
371
-
372
-
373
- <li class="private ">
374
- <span class="summary_signature">
375
-
376
- <a href="#get_content_array-class_method" title="get_content_array (class method)">+ (Array) <strong>get_content_array</strong>(content) </a>
377
-
378
-
379
-
380
- </span>
381
-
382
-
383
-
384
- <span class="note title private">private</span>
385
-
386
-
387
-
388
-
389
-
390
- <span class="summary_desc"><div class='inline'>
391
- <p>Get Content Array.</p>
392
- </div></span>
393
-
394
- </li>
395
-
396
-
397
- <li class="private ">
398
- <span class="summary_signature">
399
-
400
- <a href="#get_file_contents-class_method" title="get_file_contents (class method)">+ (Object) <strong>get_file_contents</strong>(file) </a>
401
-
402
-
403
-
404
- </span>
405
-
406
-
407
-
408
- <span class="note title private">private</span>
409
-
410
-
411
-
412
-
413
-
414
- <span class="summary_desc"><div class='inline'>
415
- <p>Get File Contents (path, title, content).</p>
416
- </div></span>
417
-
418
- </li>
419
-
420
-
421
- <li class="private ">
422
- <span class="summary_signature">
423
-
424
- <a href="#get_highlight_code-class_method" title="get_highlight_code (class method)">+ (Hash) <strong>get_highlight_code</strong>(content, seperator) </a>
425
-
426
-
427
-
428
- </span>
429
-
430
-
431
-
432
- <span class="note title private">private</span>
433
-
434
-
435
-
436
-
437
-
438
- <span class="summary_desc"><div class='inline'>
439
- <p>Get Highlight Code from Content.</p>
440
- </div></span>
441
-
442
- </li>
443
-
444
-
445
- <li class="private ">
446
- <span class="summary_signature">
447
-
448
- <a href="#highlight-class_method" title="highlight (class method)">+ (String) <strong>highlight</strong>(code, language) </a>
449
-
450
-
451
-
452
- </span>
453
-
454
-
455
-
456
- <span class="note title private">private</span>
457
-
458
-
459
-
460
-
461
-
462
- <span class="summary_desc"><div class='inline'>
463
- <p>Highlight Code in specific language.</p>
464
- </div></span>
465
-
466
- </li>
467
-
468
-
469
- <li class="public ">
470
- <span class="summary_signature">
471
-
472
- <a href="#parse_in_documents-class_method" title="parse_in_documents (class method)">+ (Hash) <strong>parse_in_documents</strong>(target) </a>
473
-
474
-
475
-
476
- </span>
477
-
478
-
479
-
480
-
481
-
482
-
483
-
484
-
485
-
486
- <span class="summary_desc"><div class='inline'>
487
- <p>Parse in .content Documents.</p>
488
- </div></span>
489
-
490
- </li>
491
-
492
-
493
- <li class="private ">
494
- <span class="summary_signature">
495
-
496
- <a href="#sort-class_method" title="sort (class method)">+ (Array) <strong>sort</strong>(documents) </a>
497
-
498
-
499
-
500
- </span>
501
-
502
-
503
-
504
- <span class="note title private">private</span>
505
-
506
-
507
-
508
-
509
-
510
- <span class="summary_desc"><div class='inline'>
511
- <p>Sort documents array by date of each documenthash Should it be sorted in
512
- Core or in the operator??.</p>
513
- </div></span>
514
-
515
- </li>
516
-
517
-
518
- </ul>
519
-
520
-
521
-
522
- <div id="class_attr_details" class="attr_details">
523
- <h2>Class Attribute Details</h2>
524
-
525
-
526
- <span id="content=-class_method"></span>
527
- <div class="method_details first">
528
- <h3 class="signature first" id="content-class_method">
529
-
530
- + (<tt>Object</tt>) <strong>content</strong> <span class="extras">(private)</span>
531
-
532
-
533
-
534
-
535
-
536
- </h3><div class="docstring">
537
- <div class="discussion">
538
-
539
- <p>Returns the value of attribute content</p>
540
-
541
-
542
- </div>
543
- </div>
544
- <div class="tags">
545
-
546
-
547
- </div><table class="source_code">
548
- <tr>
549
- <td>
550
- <pre class="lines">
551
-
552
-
553
- 17
554
- 18
555
- 19</pre>
556
- </td>
557
- <td>
558
- <pre class="code"><span class="info file"># File 'lib/rack/blogengine/document_parser.rb', line 17</span>
559
-
560
- <span class='kw'>def</span> <span class='id identifier rubyid_content'>content</span>
561
- <span class='ivar'>@content</span>
562
- <span class='kw'>end</span></pre>
563
- </td>
564
- </tr>
565
- </table>
566
- </div>
567
-
568
-
569
- <span id="date=-class_method"></span>
570
- <div class="method_details ">
571
- <h3 class="signature " id="date-class_method">
572
-
573
- + (<tt>Object</tt>) <strong>date</strong> <span class="extras">(private)</span>
574
-
575
-
576
-
577
-
578
-
579
- </h3><div class="docstring">
580
- <div class="discussion">
581
-
582
- <p>Returns the value of attribute date</p>
583
-
584
-
585
- </div>
586
- </div>
587
- <div class="tags">
588
-
589
-
590
- </div><table class="source_code">
591
- <tr>
592
- <td>
593
- <pre class="lines">
594
-
595
-
596
- 17
597
- 18
598
- 19</pre>
599
- </td>
600
- <td>
601
- <pre class="code"><span class="info file"># File 'lib/rack/blogengine/document_parser.rb', line 17</span>
602
-
603
- <span class='kw'>def</span> <span class='id identifier rubyid_date'>date</span>
604
- <span class='ivar'>@date</span>
605
- <span class='kw'>end</span></pre>
606
- </td>
607
- </tr>
608
- </table>
609
- </div>
610
-
611
-
612
- <span id="html=-class_method"></span>
613
- <div class="method_details ">
614
- <h3 class="signature " id="html-class_method">
615
-
616
- + (<tt>Object</tt>) <strong>html</strong> <span class="extras">(private)</span>
617
-
618
-
619
-
620
-
621
-
622
- </h3><div class="docstring">
623
- <div class="discussion">
624
-
625
- <p>Returns the value of attribute html</p>
626
-
627
-
628
- </div>
629
- </div>
630
- <div class="tags">
631
-
632
-
633
- </div><table class="source_code">
634
- <tr>
635
- <td>
636
- <pre class="lines">
637
-
638
-
639
- 17
640
- 18
641
- 19</pre>
642
- </td>
643
- <td>
644
- <pre class="code"><span class="info file"># File 'lib/rack/blogengine/document_parser.rb', line 17</span>
645
-
646
- <span class='kw'>def</span> <span class='id identifier rubyid_html'>html</span>
647
- <span class='ivar'>@html</span>
648
- <span class='kw'>end</span></pre>
649
- </td>
650
- </tr>
651
- </table>
652
- </div>
653
-
654
-
655
- <span id="layout=-class_method"></span>
656
- <div class="method_details ">
657
- <h3 class="signature " id="layout-class_method">
658
-
659
- + (<tt>Object</tt>) <strong>layout</strong> <span class="extras">(private)</span>
660
-
661
-
662
-
663
-
664
-
665
- </h3><div class="docstring">
666
- <div class="discussion">
667
-
668
- <p>Returns the value of attribute layout</p>
669
-
670
-
671
- </div>
672
- </div>
673
- <div class="tags">
674
-
675
-
676
- </div><table class="source_code">
677
- <tr>
678
- <td>
679
- <pre class="lines">
680
-
681
-
682
- 17
683
- 18
684
- 19</pre>
685
- </td>
686
- <td>
687
- <pre class="code"><span class="info file"># File 'lib/rack/blogengine/document_parser.rb', line 17</span>
688
-
689
- <span class='kw'>def</span> <span class='id identifier rubyid_layout'>layout</span>
690
- <span class='ivar'>@layout</span>
691
- <span class='kw'>end</span></pre>
692
- </td>
693
- </tr>
694
- </table>
695
- </div>
696
-
697
-
698
- <span id="path=-class_method"></span>
699
- <div class="method_details ">
700
- <h3 class="signature " id="path-class_method">
701
-
702
- + (<tt>Object</tt>) <strong>path</strong> <span class="extras">(private)</span>
703
-
704
-
705
-
706
-
707
-
708
- </h3><div class="docstring">
709
- <div class="discussion">
710
-
711
- <p>Returns the value of attribute path</p>
712
-
713
-
714
- </div>
715
- </div>
716
- <div class="tags">
717
-
718
-
719
- </div><table class="source_code">
720
- <tr>
721
- <td>
722
- <pre class="lines">
723
-
724
-
725
- 17
726
- 18
727
- 19</pre>
728
- </td>
729
- <td>
730
- <pre class="code"><span class="info file"># File 'lib/rack/blogengine/document_parser.rb', line 17</span>
731
-
732
- <span class='kw'>def</span> <span class='id identifier rubyid_path'>path</span>
733
- <span class='ivar'>@path</span>
734
- <span class='kw'>end</span></pre>
735
- </td>
736
- </tr>
737
- </table>
738
- </div>
739
-
740
-
741
- <span id="target=-class_method"></span>
742
- <div class="method_details ">
743
- <h3 class="signature " id="target-class_method">
744
-
745
- + (<tt>Object</tt>) <strong>target</strong>
746
-
747
-
748
-
749
-
750
-
751
- </h3><div class="docstring">
752
- <div class="discussion">
753
-
754
- <p>Returns the value of attribute target</p>
755
-
756
-
757
- </div>
758
- </div>
759
- <div class="tags">
760
-
761
-
762
- </div><table class="source_code">
763
- <tr>
764
- <td>
765
- <pre class="lines">
766
-
767
-
768
- 13
769
- 14
770
- 15</pre>
771
- </td>
772
- <td>
773
- <pre class="code"><span class="info file"># File 'lib/rack/blogengine/document_parser.rb', line 13</span>
774
-
775
- <span class='kw'>def</span> <span class='id identifier rubyid_target'>target</span>
776
- <span class='ivar'>@target</span>
777
- <span class='kw'>end</span></pre>
778
- </td>
779
- </tr>
780
- </table>
781
- </div>
782
-
783
-
784
- <span id="title=-class_method"></span>
785
- <div class="method_details ">
786
- <h3 class="signature " id="title-class_method">
787
-
788
- + (<tt>Object</tt>) <strong>title</strong> <span class="extras">(private)</span>
789
-
790
-
791
-
792
-
793
-
794
- </h3><div class="docstring">
795
- <div class="discussion">
796
-
797
- <p>Returns the value of attribute title</p>
798
-
799
-
800
- </div>
801
- </div>
802
- <div class="tags">
803
-
804
-
805
- </div><table class="source_code">
806
- <tr>
807
- <td>
808
- <pre class="lines">
809
-
810
-
811
- 17
812
- 18
813
- 19</pre>
814
- </td>
815
- <td>
816
- <pre class="code"><span class="info file"># File 'lib/rack/blogengine/document_parser.rb', line 17</span>
817
-
818
- <span class='kw'>def</span> <span class='id identifier rubyid_title'>title</span>
819
- <span class='ivar'>@title</span>
820
- <span class='kw'>end</span></pre>
821
- </td>
822
- </tr>
823
- </table>
824
- </div>
825
-
826
- </div>
827
-
828
-
829
- <div id="class_method_details" class="method_details_list">
830
- <h2>Class Method Details</h2>
831
-
832
-
833
- <div class="method_details first">
834
- <h3 class="signature first" id="fill_file_contents-class_method">
835
-
836
- + (<tt>String</tt>) <strong>fill_file_contents</strong>(layout, title, content, date) <span class="extras">(private)</span>
837
-
838
-
839
-
840
-
841
-
842
- </h3><div class="docstring">
843
- <div class="discussion">
844
-
845
- <p>Replace layout placeholder with content from .content file</p>
846
-
847
-
848
- </div>
849
- </div>
850
- <div class="tags">
851
- <p class="tag_title">Parameters:</p>
852
- <ul class="param">
853
-
854
- <li>
855
-
856
- <span class='name'>layout</span>
857
-
858
-
859
- <span class='type'>(<tt>String</tt>)</span>
860
-
861
-
862
-
863
- </li>
864
-
865
- <li>
866
-
867
- <span class='name'>title</span>
868
-
869
-
870
- <span class='type'>(<tt>String</tt>)</span>
871
-
872
-
873
-
874
- </li>
875
-
876
- <li>
877
-
878
- <span class='name'>content</span>
879
-
880
-
881
- <span class='type'>(<tt>String</tt>)</span>
882
-
883
-
884
-
885
- </li>
886
-
887
- <li>
888
-
889
- <span class='name'>date</span>
890
-
891
-
892
- <span class='type'>(<tt>Date</tt>)</span>
893
-
894
-
895
-
896
- </li>
897
-
898
- </ul>
899
-
900
- <p class="tag_title">Returns:</p>
901
- <ul class="return">
902
-
903
- <li>
904
-
905
-
906
- <span class='type'>(<tt>String</tt>)</span>
907
-
908
-
909
-
910
- &mdash;
911
- <div class='inline'>
912
- <p>html placeholder replaced with content</p>
913
- </div>
914
-
915
- </li>
916
-
917
- </ul>
918
-
919
- </div><table class="source_code">
920
- <tr>
921
- <td>
922
- <pre class="lines">
923
-
924
-
925
- 162
926
- 163
927
- 164
928
- 165
929
- 166
930
- 167
931
- 168
932
- 169
933
- 170
934
- 171
935
- 172
936
- 173
937
- 174
938
- 175
939
- 176
940
- 177
941
- 178
942
- 179
943
- 180</pre>
944
- </td>
945
- <td>
946
- <pre class="code"><span class="info file"># File 'lib/rack/blogengine/document_parser.rb', line 162</span>
947
-
948
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_fill_file_contents'>fill_file_contents</span><span class='lparen'>(</span><span class='id identifier rubyid_layout'>layout</span><span class='comma'>,</span> <span class='id identifier rubyid_title'>title</span><span class='comma'>,</span> <span class='id identifier rubyid_content'>content</span><span class='comma'>,</span> <span class='id identifier rubyid_date'>date</span><span class='rparen'>)</span>
949
- <span class='id identifier rubyid_html'>html</span> <span class='op'>=</span> <span class='id identifier rubyid_layout'>layout</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
950
-
951
- <span class='id identifier rubyid_html'>html</span><span class='period'>.</span><span class='id identifier rubyid_gsub!'>gsub!</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>{title}</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_title'>title</span>
952
- <span class='id identifier rubyid_html'>html</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>{content}</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_content'>content</span>
953
- <span class='id identifier rubyid_html'>html</span><span class='period'>.</span><span class='id identifier rubyid_gsub!'>gsub!</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>{date}</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_date'>date</span><span class='period'>.</span><span class='id identifier rubyid_strftime'>strftime</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>%d.%m.%Y</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
954
-
955
- <span class='id identifier rubyid_html'>html</span> <span class='op'>=</span> <span class='const'>Nokogiri</span><span class='op'>::</span><span class='const'>HTML</span><span class='lparen'>(</span><span class='id identifier rubyid_html'>html</span><span class='rparen'>)</span>
956
- <span class='id identifier rubyid_seperator'>seperator</span> <span class='op'>=</span> <span class='const'>Rack</span><span class='op'>::</span><span class='const'>Blogengine</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>pygments_seperator</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
957
-
958
- <span class='id identifier rubyid_html'>html</span><span class='period'>.</span><span class='id identifier rubyid_css'>css</span><span class='lparen'>(</span><span class='id identifier rubyid_seperator'>seperator</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_replace_html'>replace_html</span><span class='op'>|</span>
959
- <span class='id identifier rubyid_highlight_code'>highlight_code</span> <span class='op'>=</span> <span class='id identifier rubyid_get_highlight_code'>get_highlight_code</span><span class='lparen'>(</span><span class='id identifier rubyid_replace_html'>replace_html</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='comma'>,</span> <span class='id identifier rubyid_seperator'>seperator</span><span class='rparen'>)</span>
960
- <span class='id identifier rubyid_highlighted'>highlighted</span> <span class='op'>=</span> <span class='id identifier rubyid_highlight'>highlight</span><span class='lparen'>(</span><span class='id identifier rubyid_highlight_code'>highlight_code</span><span class='lbracket'>[</span><span class='symbol'>:text</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_highlight_code'>highlight_code</span><span class='lbracket'>[</span><span class='symbol'>:brush</span><span class='rbracket'>]</span><span class='rparen'>)</span>
961
-
962
- <span class='id identifier rubyid_replace_html'>replace_html</span><span class='period'>.</span><span class='id identifier rubyid_replace'>replace</span><span class='lparen'>(</span><span class='id identifier rubyid_highlighted'>highlighted</span><span class='rparen'>)</span>
963
- <span class='kw'>end</span>
964
-
965
- <span class='id identifier rubyid_html'>html</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
966
- <span class='kw'>end</span></pre>
967
- </td>
968
- </tr>
969
- </table>
970
- </div>
971
-
972
- <div class="method_details ">
973
- <h3 class="signature " id="generate_highlight_css-class_method">
974
-
975
- + (<tt>Object</tt>) <strong>generate_highlight_css</strong>(target) <span class="extras">(private)</span>
976
-
977
-
978
-
979
-
980
-
981
- </h3><div class="docstring">
982
- <div class="discussion">
983
-
984
- <p>Populates highlight.css with specific highlight css</p>
985
-
986
-
987
- </div>
988
- </div>
989
- <div class="tags">
990
- <p class="tag_title">Parameters:</p>
991
- <ul class="param">
992
-
993
- <li>
994
-
995
- <span class='name'>target</span>
996
-
997
-
998
- <span class='type'>(<tt>String</tt>)</span>
999
-
1000
-
1001
-
1002
- &mdash;
1003
- <div class='inline'><dl class="rdoc-list label-list"><dt>Targetfolder in which highlight.css lives
1004
- <dd></dd></dl>
1005
- </div>
1006
-
1007
- </li>
1008
-
1009
- </ul>
1010
-
1011
-
1012
- </div><table class="source_code">
1013
- <tr>
1014
- <td>
1015
- <pre class="lines">
1016
-
1017
-
1018
- 143
1019
- 144
1020
- 145
1021
- 146
1022
- 147
1023
- 148
1024
- 149
1025
- 150
1026
- 151
1027
- 152
1028
- 153</pre>
1029
- </td>
1030
- <td>
1031
- <pre class="code"><span class="info file"># File 'lib/rack/blogengine/document_parser.rb', line 143</span>
1032
-
1033
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_generate_highlight_css'>generate_highlight_css</span><span class='lparen'>(</span><span class='id identifier rubyid_target'>target</span><span class='rparen'>)</span>
1034
- <span class='id identifier rubyid_cli'>cli</span> <span class='op'>=</span> <span class='const'>Rack</span><span class='op'>::</span><span class='const'>Blogengine</span><span class='op'>::</span><span class='const'>CommandLineInterface</span>
1035
- <span class='id identifier rubyid_system'>system</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>rm </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_target'>target</span><span class='embexpr_end'>}</span><span class='tstring_content'>/assets/style/highlight.css</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='op'>::</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_exist?'>exist?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_target'>target</span><span class='embexpr_end'>}</span><span class='tstring_content'>/assets/style/highlight.css</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
1036
-
1037
- <span class='id identifier rubyid_cli'>cli</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='symbol'>:setup</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>highlight.css</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_target'>target</span><span class='embexpr_end'>}</span><span class='tstring_content'>/assets/style</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='kw'>false</span><span class='rparen'>)</span>
1038
-
1039
- <span class='id identifier rubyid_path'>path</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_target'>target</span><span class='embexpr_end'>}</span><span class='tstring_content'>/assets/style</span><span class='tstring_end'>&quot;</span></span>
1040
-
1041
- <span class='id identifier rubyid_css'>css</span> <span class='op'>=</span> <span class='const'>Pygments</span><span class='period'>.</span><span class='id identifier rubyid_css'>css</span><span class='lparen'>(</span><span class='label'>style:</span> <span class='const'>Rack</span><span class='op'>::</span><span class='const'>Blogengine</span><span class='period'>.</span><span class='id identifier rubyid_config'>config</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>pygments_style</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
1042
- <span class='op'>::</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_path'>path</span><span class='embexpr_end'>}</span><span class='tstring_content'>/highlight.css</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>w</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_file'>file</span><span class='op'>|</span> <span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span><span class='lparen'>(</span><span class='id identifier rubyid_css'>css</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
1043
- <span class='kw'>end</span></pre>
1044
- </td>
1045
- </tr>
1046
- </table>
1047
- </div>
1048
-
1049
- <div class="method_details ">
1050
- <h3 class="signature " id="get_content_array-class_method">
1051
-
1052
- + (<tt>Array</tt>) <strong>get_content_array</strong>(content) <span class="extras">(private)</span>
1053
-
1054
-
1055
-
1056
-
1057
-
1058
- </h3><div class="docstring">
1059
- <div class="discussion">
1060
-
1061
- <p>Get Content Array</p>
1062
-
1063
-
1064
- </div>
1065
- </div>
1066
- <div class="tags">
1067
- <p class="tag_title">Parameters:</p>
1068
- <ul class="param">
1069
-
1070
- <li>
1071
-
1072
- <span class='name'>content</span>
1073
-
1074
-
1075
- <span class='type'>(<tt>String</tt>)</span>
1076
-
1077
-
1078
-
1079
- &mdash;
1080
- <div class='inline'><dl class="rdoc-list label-list"><dt>The Content (.content file)
1081
- <dd></dd></dl>
1082
- </div>
1083
-
1084
- </li>
1085
-
1086
- </ul>
1087
-
1088
- <p class="tag_title">Returns:</p>
1089
- <ul class="return">
1090
-
1091
- <li>
1092
-
1093
-
1094
- <span class='type'>(<tt>Array</tt>)</span>
1095
-
1096
-
1097
-
1098
- &mdash;
1099
- <div class='inline'>
1100
- <p>contentArray [Splitted Content File]</p>
1101
- </div>
1102
-
1103
- </li>
1104
-
1105
- </ul>
1106
-
1107
- </div><table class="source_code">
1108
- <tr>
1109
- <td>
1110
- <pre class="lines">
1111
-
1112
-
1113
- 108
1114
- 109
1115
- 110
1116
- 111
1117
- 112
1118
- 113
1119
- 114
1120
- 115
1121
- 116</pre>
1122
- </td>
1123
- <td>
1124
- <pre class="code"><span class="info file"># File 'lib/rack/blogengine/document_parser.rb', line 108</span>
1125
-
1126
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_get_content_array'>get_content_array</span><span class='lparen'>(</span><span class='id identifier rubyid_content'>content</span><span class='rparen'>)</span>
1127
- <span class='comment'># Replace Closing tags
1128
- </span> <span class='id identifier rubyid_content'>content</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/path</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/close</span><span class='tstring_end'>&#39;</span></span>
1129
- <span class='id identifier rubyid_content'>content</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/title</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/close</span><span class='tstring_end'>&#39;</span></span>
1130
- <span class='id identifier rubyid_content'>content</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/content</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/close</span><span class='tstring_end'>&#39;</span></span>
1131
- <span class='id identifier rubyid_content'>content</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/date</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/close</span><span class='tstring_end'>&#39;</span></span>
1132
-
1133
- <span class='id identifier rubyid_content'>content</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>[/close]</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
1134
- <span class='kw'>end</span></pre>
1135
- </td>
1136
- </tr>
1137
- </table>
1138
- </div>
1139
-
1140
- <div class="method_details ">
1141
- <h3 class="signature " id="get_file_contents-class_method">
1142
-
1143
- + (<tt>Object</tt>) <strong>get_file_contents</strong>(file) <span class="extras">(private)</span>
1144
-
1145
-
1146
-
1147
-
1148
-
1149
- </h3><div class="docstring">
1150
- <div class="discussion">
1151
-
1152
- <p>Get File Contents (path, title, content)</p>
1153
-
1154
-
1155
- </div>
1156
- </div>
1157
- <div class="tags">
1158
- <p class="tag_title">Parameters:</p>
1159
- <ul class="param">
1160
-
1161
- <li>
1162
-
1163
- <span class='name'>file</span>
1164
-
1165
-
1166
- <span class='type'>(<tt>String</tt>)</span>
1167
-
1168
-
1169
-
1170
- </li>
1171
-
1172
- </ul>
1173
-
1174
-
1175
- </div><table class="source_code">
1176
- <tr>
1177
- <td>
1178
- <pre class="lines">
1179
-
1180
-
1181
- 62
1182
- 63
1183
- 64
1184
- 65
1185
- 66
1186
- 67
1187
- 68
1188
- 69
1189
- 70
1190
- 71
1191
- 72
1192
- 73
1193
- 74
1194
- 75
1195
- 76
1196
- 77
1197
- 78
1198
- 79
1199
- 80
1200
- 81
1201
- 82
1202
- 83
1203
- 84
1204
- 85
1205
- 86
1206
- 87
1207
- 88
1208
- 89
1209
- 90
1210
- 91
1211
- 92
1212
- 93
1213
- 94
1214
- 95
1215
- 96
1216
- 97
1217
- 98
1218
- 99
1219
- 100
1220
- 101
1221
- 102
1222
- 103</pre>
1223
- </td>
1224
- <td>
1225
- <pre class="code"><span class="info file"># File 'lib/rack/blogengine/document_parser.rb', line 62</span>
1226
-
1227
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_get_file_contents'>get_file_contents</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span>
1228
- <span class='id identifier rubyid_content_file'>content_file</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_target'>target</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_file'>file</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
1229
- <span class='id identifier rubyid_content'>content</span> <span class='op'>=</span> <span class='id identifier rubyid_content_file'>content_file</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span>
1230
-
1231
- <span class='id identifier rubyid_contentarray'>contentarray</span> <span class='op'>=</span> <span class='id identifier rubyid_get_content_array'>get_content_array</span><span class='lparen'>(</span><span class='id identifier rubyid_content'>content</span><span class='rparen'>)</span>
1232
-
1233
- <span class='id identifier rubyid_contentarray'>contentarray</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_contentblock'>contentblock</span><span class='op'>|</span>
1234
- <span class='kw'>if</span> <span class='id identifier rubyid_contentblock'>contentblock</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>[path]:</span><span class='tstring_end'>&#39;</span></span>
1235
- <span class='id identifier rubyid_contentblock'>contentblock</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>[path]:</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span>
1236
- <span class='ivar'>@path</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_contentblock'>contentblock</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
1237
-
1238
- <span class='kw'>elsif</span> <span class='id identifier rubyid_contentblock'>contentblock</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>[title]:</span><span class='tstring_end'>&#39;</span></span>
1239
- <span class='id identifier rubyid_contentblock'>contentblock</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>[title]:</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span>
1240
- <span class='kw'>if</span> <span class='id identifier rubyid_contentblock'>contentblock</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
1241
- <span class='id identifier rubyid_fail'>fail</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Title in </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_file'>file</span><span class='embexpr_end'>}</span><span class='tstring_content'> is empty</span><span class='tstring_end'>&quot;</span></span>
1242
- <span class='kw'>else</span>
1243
- <span class='ivar'>@title</span> <span class='op'>=</span> <span class='id identifier rubyid_contentblock'>contentblock</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span>
1244
- <span class='kw'>end</span>
1245
-
1246
- <span class='kw'>elsif</span> <span class='id identifier rubyid_contentblock'>contentblock</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>[content]:</span><span class='tstring_end'>&#39;</span></span>
1247
- <span class='id identifier rubyid_contentblock'>contentblock</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>[content]:</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span>
1248
- <span class='kw'>if</span> <span class='id identifier rubyid_contentblock'>contentblock</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
1249
- <span class='id identifier rubyid_fail'>fail</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Content in </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_file'>file</span><span class='embexpr_end'>}</span><span class='tstring_content'> is empty</span><span class='tstring_end'>&quot;</span></span>
1250
- <span class='kw'>else</span>
1251
- <span class='ivar'>@content</span> <span class='op'>=</span> <span class='id identifier rubyid_contentblock'>contentblock</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span>
1252
- <span class='kw'>end</span>
1253
-
1254
- <span class='kw'>elsif</span> <span class='id identifier rubyid_contentblock'>contentblock</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>[date]:</span><span class='tstring_end'>&#39;</span></span>
1255
- <span class='id identifier rubyid_contentblock'>contentblock</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>[date]:</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span>
1256
- <span class='kw'>if</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\d</span><span class='regexp_end'>/</span></span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='id identifier rubyid_contentblock'>contentblock</span><span class='rparen'>)</span>
1257
- <span class='id identifier rubyid_datearray'>datearray</span> <span class='op'>=</span> <span class='id identifier rubyid_contentblock'>contentblock</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>,</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
1258
- <span class='id identifier rubyid_datearray'>datearray</span> <span class='op'>=</span> <span class='id identifier rubyid_datearray'>datearray</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_date'>date</span><span class='op'>|</span>
1259
- <span class='id identifier rubyid_date'>date</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
1260
- <span class='kw'>end</span>
1261
-
1262
- <span class='ivar'>@date</span> <span class='op'>=</span> <span class='const'>Date</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_datearray'>datearray</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_datearray'>datearray</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_datearray'>datearray</span><span class='lbracket'>[</span><span class='int'>2</span><span class='rbracket'>]</span><span class='rparen'>)</span>
1263
- <span class='kw'>else</span>
1264
- <span class='id identifier rubyid_fail'>fail</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Invalid Date in </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_file'>file</span><span class='embexpr_end'>}</span><span class='tstring_content'>\n [date]:</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_contentblock'>contentblock</span><span class='embexpr_end'>}</span><span class='tstring_content'>[/date]</span><span class='tstring_end'>&quot;</span></span>
1265
- <span class='kw'>end</span>
1266
- <span class='kw'>end</span>
1267
- <span class='kw'>end</span>
1268
- <span class='kw'>end</span></pre>
1269
- </td>
1270
- </tr>
1271
- </table>
1272
- </div>
1273
-
1274
- <div class="method_details ">
1275
- <h3 class="signature " id="get_highlight_code-class_method">
1276
-
1277
- + (<tt>Hash</tt>) <strong>get_highlight_code</strong>(content, seperator) <span class="extras">(private)</span>
1278
-
1279
-
1280
-
1281
-
1282
-
1283
- </h3><div class="docstring">
1284
- <div class="discussion">
1285
-
1286
- <p>Get Highlight Code from Content</p>
1287
-
1288
-
1289
- </div>
1290
- </div>
1291
- <div class="tags">
1292
- <p class="tag_title">Parameters:</p>
1293
- <ul class="param">
1294
-
1295
- <li>
1296
-
1297
- <span class='name'>content</span>
1298
-
1299
-
1300
- <span class='type'>(<tt>String</tt>)</span>
1301
-
1302
-
1303
-
1304
- &mdash;
1305
- <div class='inline'><dl class="rdoc-list label-list"><dt>HTML Content
1306
- <dd></dd></dl>
1307
- </div>
1308
-
1309
- </li>
1310
-
1311
- <li>
1312
-
1313
- <span class='name'>seperator</span>
1314
-
1315
-
1316
- <span class='type'>(<tt>String</tt>)</span>
1317
-
1318
-
1319
-
1320
- &mdash;
1321
- <div class='inline'><dl class="rdoc-list label-list"><dt>HTML between seperator will be highlighted
1322
- <dd></dd></dl>
1323
- </div>
1324
-
1325
- </li>
1326
-
1327
- </ul>
1328
-
1329
- <p class="tag_title">Returns:</p>
1330
- <ul class="return">
1331
-
1332
- <li>
1333
-
1334
-
1335
- <span class='type'>(<tt>Hash</tt>)</span>
1336
-
1337
-
1338
-
1339
- &mdash;
1340
- <div class='inline'>
1341
- <p>:text - HTML to highlight, :brush - Brush via seperator class</p>
1342
- </div>
1343
-
1344
- </li>
1345
-
1346
- </ul>
1347
-
1348
- </div><table class="source_code">
1349
- <tr>
1350
- <td>
1351
- <pre class="lines">
1352
-
1353
-
1354
- 123
1355
- 124
1356
- 125
1357
- 126
1358
- 127
1359
- 128
1360
- 129
1361
- 130</pre>
1362
- </td>
1363
- <td>
1364
- <pre class="code"><span class="info file"># File 'lib/rack/blogengine/document_parser.rb', line 123</span>
1365
-
1366
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_get_highlight_code'>get_highlight_code</span><span class='lparen'>(</span><span class='id identifier rubyid_content'>content</span><span class='comma'>,</span> <span class='id identifier rubyid_seperator'>seperator</span><span class='rparen'>)</span>
1367
- <span class='id identifier rubyid_html'>html</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'>Nokogiri</span><span class='op'>::</span><span class='const'>HTML</span><span class='lparen'>(</span><span class='id identifier rubyid_content'>content</span><span class='rparen'>)</span>
1368
- <span class='id identifier rubyid_klass'>klass</span> <span class='op'>=</span> <span class='id identifier rubyid_html'>html</span><span class='period'>.</span><span class='id identifier rubyid_css'>css</span><span class='lparen'>(</span><span class='id identifier rubyid_seperator'>seperator</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_attr'>attr</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>class</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
1369
- <span class='id identifier rubyid_brush'>brush</span> <span class='op'>=</span> <span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>:</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span>
1370
-
1371
- <span class='comment'># return
1372
- </span> <span class='lbrace'>{</span> <span class='label'>text:</span> <span class='id identifier rubyid_html'>html</span><span class='period'>.</span><span class='id identifier rubyid_css'>css</span><span class='lparen'>(</span><span class='id identifier rubyid_seperator'>seperator</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span><span class='comma'>,</span> <span class='label'>brush:</span> <span class='id identifier rubyid_brush'>brush</span> <span class='rbrace'>}</span>
1373
- <span class='kw'>end</span></pre>
1374
- </td>
1375
- </tr>
1376
- </table>
1377
- </div>
1378
-
1379
- <div class="method_details ">
1380
- <h3 class="signature " id="highlight-class_method">
1381
-
1382
- + (<tt>String</tt>) <strong>highlight</strong>(code, language) <span class="extras">(private)</span>
1383
-
1384
-
1385
-
1386
-
1387
-
1388
- </h3><div class="docstring">
1389
- <div class="discussion">
1390
-
1391
- <p>Highlight Code in specific language</p>
1392
-
1393
-
1394
- </div>
1395
- </div>
1396
- <div class="tags">
1397
- <p class="tag_title">Parameters:</p>
1398
- <ul class="param">
1399
-
1400
- <li>
1401
-
1402
- <span class='name'>code</span>
1403
-
1404
-
1405
- <span class='type'>(<tt>String</tt>)</span>
1406
-
1407
-
1408
-
1409
- &mdash;
1410
- <div class='inline'><dl class="rdoc-list label-list"><dt>Code to highlight
1411
- <dd></dd></dl>
1412
- </div>
1413
-
1414
- </li>
1415
-
1416
- <li>
1417
-
1418
- <span class='name'>language</span>
1419
-
1420
-
1421
- <span class='type'>(<tt>String</tt>)</span>
1422
-
1423
-
1424
-
1425
- &mdash;
1426
- <div class='inline'><dl class="rdoc-list label-list"><dt>Language to highlight
1427
- <dd></dd></dl>
1428
- </div>
1429
-
1430
- </li>
1431
-
1432
- </ul>
1433
-
1434
- <p class="tag_title">Returns:</p>
1435
- <ul class="return">
1436
-
1437
- <li>
1438
-
1439
-
1440
- <span class='type'>(<tt>String</tt>)</span>
1441
-
1442
-
1443
-
1444
- &mdash;
1445
- <div class='inline'>
1446
- <p>Highlighted HTML String</p>
1447
- </div>
1448
-
1449
- </li>
1450
-
1451
- </ul>
1452
-
1453
- </div><table class="source_code">
1454
- <tr>
1455
- <td>
1456
- <pre class="lines">
1457
-
1458
-
1459
- 137
1460
- 138
1461
- 139</pre>
1462
- </td>
1463
- <td>
1464
- <pre class="code"><span class="info file"># File 'lib/rack/blogengine/document_parser.rb', line 137</span>
1465
-
1466
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_highlight'>highlight</span><span class='lparen'>(</span><span class='id identifier rubyid_code'>code</span><span class='comma'>,</span> <span class='id identifier rubyid_language'>language</span><span class='rparen'>)</span>
1467
- <span class='const'>Pygments</span><span class='period'>.</span><span class='id identifier rubyid_highlight'>highlight</span><span class='lparen'>(</span><span class='id identifier rubyid_code'>code</span><span class='comma'>,</span> <span class='label'>lexer:</span> <span class='id identifier rubyid_language'>language</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rparen'>)</span>
1468
- <span class='kw'>end</span></pre>
1469
- </td>
1470
- </tr>
1471
- </table>
1472
- </div>
1473
-
1474
- <div class="method_details ">
1475
- <h3 class="signature " id="parse_in_documents-class_method">
1476
-
1477
- + (<tt>Hash</tt>) <strong>parse_in_documents</strong>(target)
1478
-
1479
-
1480
-
1481
-
1482
-
1483
- </h3><div class="docstring">
1484
- <div class="discussion">
1485
-
1486
- <p>Parse in .content Documents.</p>
1487
-
1488
-
1489
- </div>
1490
- </div>
1491
- <div class="tags">
1492
- <p class="tag_title">Parameters:</p>
1493
- <ul class="param">
1494
-
1495
- <li>
1496
-
1497
- <span class='name'>target</span>
1498
-
1499
-
1500
- <span class='type'>(<tt>String</tt>)</span>
1501
-
1502
-
1503
-
1504
- </li>
1505
-
1506
- </ul>
1507
-
1508
- <p class="tag_title">Returns:</p>
1509
- <ul class="return">
1510
-
1511
- <li>
1512
-
1513
-
1514
- <span class='type'>(<tt>Hash</tt>)</span>
1515
-
1516
-
1517
-
1518
- &mdash;
1519
- <div class='inline'>
1520
- <p>Documents</p>
1521
- </div>
1522
-
1523
- </li>
1524
-
1525
- </ul>
1526
-
1527
- </div><table class="source_code">
1528
- <tr>
1529
- <td>
1530
- <pre class="lines">
1531
-
1532
-
1533
- 23
1534
- 24
1535
- 25
1536
- 26
1537
- 27
1538
- 28
1539
- 29
1540
- 30
1541
- 31
1542
- 32
1543
- 33
1544
- 34
1545
- 35
1546
- 36
1547
- 37
1548
- 38
1549
- 39
1550
- 40
1551
- 41
1552
- 42
1553
- 43
1554
- 44
1555
- 45
1556
- 46
1557
- 47
1558
- 48
1559
- 49
1560
- 50
1561
- 51
1562
- 52
1563
- 53
1564
- 54
1565
- 55
1566
- 56
1567
- 57
1568
- 58</pre>
1569
- </td>
1570
- <td>
1571
- <pre class="code"><span class="info file"># File 'lib/rack/blogengine/document_parser.rb', line 23</span>
1572
-
1573
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parse_in_documents'>parse_in_documents</span><span class='lparen'>(</span><span class='id identifier rubyid_target'>target</span><span class='rparen'>)</span>
1574
- <span class='ivar'>@target</span> <span class='op'>=</span> <span class='id identifier rubyid_target'>target</span>
1575
- <span class='id identifier rubyid_documents'>documents</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
1576
-
1577
- <span class='id identifier rubyid_layout_file'>layout_file</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_target'>target</span><span class='embexpr_end'>}</span><span class='tstring_content'>/assets/layout/layout.html</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>r</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
1578
- <span class='id identifier rubyid_layout'>layout</span> <span class='op'>=</span> <span class='id identifier rubyid_layout_file'>layout_file</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span>
1579
-
1580
- <span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_foreach'>foreach</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_target'>target</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_item'>item</span><span class='op'>|</span>
1581
- <span class='id identifier rubyid_extension'>extension</span> <span class='op'>=</span> <span class='id identifier rubyid_item'>item</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>.</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span>
1582
- <span class='kw'>next</span> <span class='kw'>if</span> <span class='id identifier rubyid_item'>item</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>.</span><span class='tstring_end'>&#39;</span></span> <span class='op'>||</span> <span class='id identifier rubyid_item'>item</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>..</span><span class='tstring_end'>&#39;</span></span> <span class='op'>||</span> <span class='id identifier rubyid_extension'>extension</span> <span class='op'>!=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>content</span><span class='tstring_end'>&#39;</span></span>
1583
-
1584
- <span class='id identifier rubyid_get_file_contents'>get_file_contents</span><span class='lparen'>(</span><span class='id identifier rubyid_item'>item</span><span class='rparen'>)</span>
1585
- <span class='id identifier rubyid_html'>html</span> <span class='op'>=</span> <span class='id identifier rubyid_fill_file_contents'>fill_file_contents</span><span class='lparen'>(</span><span class='id identifier rubyid_layout'>layout</span><span class='comma'>,</span> <span class='id identifier rubyid_title'>title</span><span class='comma'>,</span> <span class='id identifier rubyid_content'>content</span><span class='comma'>,</span> <span class='id identifier rubyid_date'>date</span><span class='rparen'>)</span>
1586
-
1587
- <span class='ivar'>@document</span> <span class='op'>=</span> <span class='const'>Document</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
1588
- <span class='ivar'>@document</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span> <span class='op'>=</span> <span class='id identifier rubyid_path'>path</span>
1589
- <span class='ivar'>@document</span><span class='period'>.</span><span class='id identifier rubyid_html'>html</span> <span class='op'>=</span> <span class='id identifier rubyid_html'>html</span>
1590
- <span class='ivar'>@document</span><span class='period'>.</span><span class='id identifier rubyid_title'>title</span> <span class='op'>=</span> <span class='id identifier rubyid_title'>title</span>
1591
- <span class='ivar'>@document</span><span class='period'>.</span><span class='id identifier rubyid_date'>date</span> <span class='op'>=</span> <span class='id identifier rubyid_date'>date</span>
1592
-
1593
- <span class='id identifier rubyid_documents'>documents</span> <span class='op'>&lt;&lt;</span> <span class='ivar'>@document</span>
1594
- <span class='kw'>end</span>
1595
-
1596
- <span class='id identifier rubyid_generate_highlight_css'>generate_highlight_css</span><span class='lparen'>(</span><span class='id identifier rubyid_target'>target</span><span class='rparen'>)</span>
1597
- <span class='id identifier rubyid_sort'>sort</span><span class='lparen'>(</span><span class='id identifier rubyid_documents'>documents</span><span class='rparen'>)</span>
1598
-
1599
- <span class='comment'># Has to exec operator after all docs were read,
1600
- </span> <span class='comment'># so documents are available for operators (list all docs, etc...)
1601
- </span> <span class='id identifier rubyid_documents'>documents</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_document'>document</span><span class='op'>|</span>
1602
- <span class='id identifier rubyid_document'>document</span><span class='period'>.</span><span class='id identifier rubyid_exec_content_operator'>exec_content_operator</span><span class='lparen'>(</span><span class='id identifier rubyid_documents'>documents</span><span class='comma'>,</span> <span class='id identifier rubyid_target'>target</span><span class='rparen'>)</span>
1603
- <span class='kw'>end</span>
1604
-
1605
- <span class='id identifier rubyid_documents'>documents</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_document'>document</span><span class='op'>|</span>
1606
- <span class='id identifier rubyid_document'>document</span><span class='period'>.</span><span class='id identifier rubyid_to_hash'>to_hash</span>
1607
- <span class='kw'>end</span>
1608
- <span class='kw'>end</span></pre>
1609
- </td>
1610
- </tr>
1611
- </table>
1612
- </div>
1613
-
1614
- <div class="method_details ">
1615
- <h3 class="signature " id="sort-class_method">
1616
-
1617
- + (<tt>Array</tt>) <strong>sort</strong>(documents) <span class="extras">(private)</span>
1618
-
1619
-
1620
-
1621
-
1622
-
1623
- </h3><div class="docstring">
1624
- <div class="discussion">
1625
-
1626
- <p>Sort documents array by date of each documenthash Should it be sorted in
1627
- Core or in the operator??</p>
1628
-
1629
-
1630
- </div>
1631
- </div>
1632
- <div class="tags">
1633
- <p class="tag_title">Parameters:</p>
1634
- <ul class="param">
1635
-
1636
- <li>
1637
-
1638
- <span class='name'>documents</span>
1639
-
1640
-
1641
- <span class='type'>(<tt>Array</tt>)</span>
1642
-
1643
-
1644
-
1645
- </li>
1646
-
1647
- </ul>
1648
-
1649
- <p class="tag_title">Returns:</p>
1650
- <ul class="return">
1651
-
1652
- <li>
1653
-
1654
-
1655
- <span class='type'>(<tt>Array</tt>)</span>
1656
-
1657
-
1658
-
1659
- &mdash;
1660
- <div class='inline'>
1661
- <p>documents (sorted)</p>
1662
- </div>
1663
-
1664
- </li>
1665
-
1666
- </ul>
1667
-
1668
- </div><table class="source_code">
1669
- <tr>
1670
- <td>
1671
- <pre class="lines">
1672
-
1673
-
1674
- 187
1675
- 188
1676
- 189
1677
- 190
1678
- 191
1679
- 192
1680
- 193</pre>
1681
- </td>
1682
- <td>
1683
- <pre class="code"><span class="info file"># File 'lib/rack/blogengine/document_parser.rb', line 187</span>
1684
-
1685
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_sort'>sort</span><span class='lparen'>(</span><span class='id identifier rubyid_documents'>documents</span><span class='rparen'>)</span>
1686
- <span class='id identifier rubyid_documents'>documents</span><span class='period'>.</span><span class='id identifier rubyid_sort!'>sort!</span> <span class='kw'>do</span> <span class='op'>|</span> <span class='id identifier rubyid_a'>a</span><span class='comma'>,</span> <span class='id identifier rubyid_b'>b</span> <span class='op'>|</span>
1687
- <span class='id identifier rubyid_a'>a</span><span class='period'>.</span><span class='id identifier rubyid_date'>date</span><span class='period'>.</span><span class='id identifier rubyid_to_time'>to_time</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='op'>&lt;=&gt;</span> <span class='id identifier rubyid_b'>b</span><span class='period'>.</span><span class='id identifier rubyid_date'>date</span><span class='period'>.</span><span class='id identifier rubyid_to_time'>to_time</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
1688
- <span class='kw'>end</span>
1689
-
1690
- <span class='id identifier rubyid_documents'>documents</span>
1691
- <span class='kw'>end</span></pre>
1692
- </td>
1693
- </tr>
1694
- </table>
1695
- </div>
1696
-
1697
- </div>
1698
-
1699
- </div>
1700
-
1701
- <div id="footer">
1702
- Generated on Mon Apr 21 22:58:51 2014 by
1703
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1704
- 0.8.7.4 (ruby-2.1.1).
1705
- </div>
1706
-
1707
- </body>
1708
- </html>