smart_diff 0.0.1 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/doc/Htmlize.html CHANGED
@@ -103,7 +103,20 @@
103
103
  </dl>
104
104
  <div class="clear"></div>
105
105
 
106
+ <h2>Overview</h2><div class="docstring">
107
+ <div class="discussion">
108
+
109
+ <p>Given information about two Ruby files, and their semantic diff, creates an
110
+ HTML file to represent the diff information in an intuitive and appealing
111
+ visual format.</p>
112
+
113
+
114
+ </div>
115
+ </div>
116
+ <div class="tags">
117
+
106
118
 
119
+ </div>
107
120
 
108
121
 
109
122
 
@@ -180,7 +193,7 @@
180
193
  <li class="public ">
181
194
  <span class="summary_signature">
182
195
 
183
- <a href="#apply_tags-instance_method" title="#apply_tags (instance method)">- (Object) <strong>apply_tags</strong>(s, tags) </a>
196
+ <a href="#apply_tags-instance_method" title="#apply_tags (instance method)">- (String) <strong>apply_tags</strong>(s, tags) </a>
184
197
 
185
198
 
186
199
 
@@ -194,7 +207,10 @@
194
207
 
195
208
 
196
209
 
197
- <span class="summary_desc"><div class='inline'></div></span>
210
+ <span class="summary_desc"><div class='inline'>
211
+ <p>Does HTML escaping on both tags and text, and places the tags around the
212
+ appropriate text.</p>
213
+ </div></span>
198
214
 
199
215
  </li>
200
216
 
@@ -202,7 +218,7 @@
202
218
  <li class="public ">
203
219
  <span class="summary_signature">
204
220
 
205
- <a href="#change_class-instance_method" title="#change_class (instance method)">- (Object) <strong>change_class</strong>(change) </a>
221
+ <a href="#change_class-instance_method" title="#change_class (instance method)">- (String) <strong>change_class</strong>(change) </a>
206
222
 
207
223
 
208
224
 
@@ -216,7 +232,9 @@
216
232
 
217
233
 
218
234
 
219
- <span class="summary_desc"><div class='inline'></div></span>
235
+ <span class="summary_desc"><div class='inline'>
236
+ <p>Determines whether the change is an insertion, deletion or modification.</p>
237
+ </div></span>
220
238
 
221
239
  </li>
222
240
 
@@ -224,7 +242,7 @@
224
242
  <li class="public ">
225
243
  <span class="summary_signature">
226
244
 
227
- <a href="#change_tags-instance_method" title="#change_tags (instance method)">- (Object) <strong>change_tags</strong>(changes, side) </a>
245
+ <a href="#change_tags-instance_method" title="#change_tags (instance method)">- (Array) <strong>change_tags</strong>(changes, side) </a>
228
246
 
229
247
 
230
248
 
@@ -238,7 +256,10 @@
238
256
 
239
257
 
240
258
 
241
- <span class="summary_desc"><div class='inline'></div></span>
259
+ <span class="summary_desc"><div class='inline'>
260
+ <p>Works through the Change objects in the diff, creating the appropriate HTML
261
+ tags for each.</p>
262
+ </div></span>
242
263
 
243
264
  </li>
244
265
 
@@ -268,7 +289,7 @@
268
289
  <li class="public ">
269
290
  <span class="summary_signature">
270
291
 
271
- <a href="#create_html-instance_method" title="#create_html (instance method)">- (Object) <strong>create_html</strong>(changes, file1, file2, text1, text2) </a>
292
+ <a href="#create_html-instance_method" title="#create_html (instance method)">- (String) <strong>create_html</strong>(changes, file1, file2, text1, text2) </a>
272
293
 
273
294
 
274
295
 
@@ -282,7 +303,9 @@
282
303
 
283
304
 
284
305
 
285
- <span class="summary_desc"><div class='inline'></div></span>
306
+ <span class="summary_desc"><div class='inline'>
307
+ <p>Takes in the information about the diff and writes out a file of HTML.</p>
308
+ </div></span>
286
309
 
287
310
  </li>
288
311
 
@@ -290,7 +313,7 @@
290
313
  <li class="public ">
291
314
  <span class="summary_signature">
292
315
 
293
- <a href="#html_footer-instance_method" title="#html_footer (instance method)">- (Object) <strong>html_footer</strong> </a>
316
+ <a href="#html_footer-instance_method" title="#html_footer (instance method)">- (String) <strong>html_footer</strong> </a>
294
317
 
295
318
 
296
319
 
@@ -304,7 +327,9 @@
304
327
 
305
328
 
306
329
 
307
- <span class="summary_desc"><div class='inline'></div></span>
330
+ <span class="summary_desc"><div class='inline'>
331
+ <p>Create the html for the bottom of the page.</p>
332
+ </div></span>
308
333
 
309
334
  </li>
310
335
 
@@ -312,7 +337,7 @@
312
337
  <li class="public ">
313
338
  <span class="summary_signature">
314
339
 
315
- <a href="#html_header-instance_method" title="#html_header (instance method)">- (Object) <strong>html_header</strong> </a>
340
+ <a href="#html_header-instance_method" title="#html_header (instance method)">- (String) <strong>html_header</strong> </a>
316
341
 
317
342
 
318
343
 
@@ -326,7 +351,9 @@
326
351
 
327
352
 
328
353
 
329
- <span class="summary_desc"><div class='inline'></div></span>
354
+ <span class="summary_desc"><div class='inline'>
355
+ <p>Construct the HTML for the top of the file.</p>
356
+ </div></span>
330
357
 
331
358
  </li>
332
359
 
@@ -360,7 +387,7 @@
360
387
  <li class="public ">
361
388
  <span class="summary_signature">
362
389
 
363
- <a href="#link_start-instance_method" title="#link_start (instance method)">- (Object) <strong>link_start</strong>(change, side) </a>
390
+ <a href="#link_start-instance_method" title="#link_start (instance method)">- (String) <strong>link_start</strong>(change, side) </a>
364
391
 
365
392
 
366
393
 
@@ -374,7 +401,9 @@
374
401
 
375
402
 
376
403
 
377
- <span class="summary_desc"><div class='inline'></div></span>
404
+ <span class="summary_desc"><div class='inline'>
405
+ <p>Create anchor tags for a Change object.</p>
406
+ </div></span>
378
407
 
379
408
  </li>
380
409
 
@@ -382,7 +411,7 @@
382
411
  <li class="public ">
383
412
  <span class="summary_signature">
384
413
 
385
- <a href="#qs-instance_method" title="#qs (instance method)">- (Object) <strong>qs</strong>(s) </a>
414
+ <a href="#qs-instance_method" title="#qs (instance method)">- (String) <strong>qs</strong>(s) </a>
386
415
 
387
416
 
388
417
 
@@ -396,7 +425,9 @@
396
425
 
397
426
 
398
427
 
399
- <span class="summary_desc"><div class='inline'></div></span>
428
+ <span class="summary_desc"><div class='inline'>
429
+ <p>Takes a string and returns it in quotes.</p>
430
+ </div></span>
400
431
 
401
432
  </li>
402
433
 
@@ -404,7 +435,7 @@
404
435
  <li class="public ">
405
436
  <span class="summary_signature">
406
437
 
407
- <a href="#span_start-instance_method" title="#span_start (instance method)">- (Object) <strong>span_start</strong>(change) </a>
438
+ <a href="#span_start-instance_method" title="#span_start (instance method)">- (String) <strong>span_start</strong>(change) </a>
408
439
 
409
440
 
410
441
 
@@ -418,7 +449,9 @@
418
449
 
419
450
 
420
451
 
421
- <span class="summary_desc"><div class='inline'></div></span>
452
+ <span class="summary_desc"><div class='inline'>
453
+ <p>Takes a Change and creates a span tag.</p>
454
+ </div></span>
422
455
 
423
456
  </li>
424
457
 
@@ -426,7 +459,7 @@
426
459
  <li class="public ">
427
460
  <span class="summary_signature">
428
461
 
429
- <a href="#uid-instance_method" title="#uid (instance method)">- (Object) <strong>uid</strong>(node) </a>
462
+ <a href="#uid-instance_method" title="#uid (instance method)">- (Fixnum) <strong>uid</strong>(node) </a>
430
463
 
431
464
 
432
465
 
@@ -440,7 +473,9 @@
440
473
 
441
474
 
442
475
 
443
- <span class="summary_desc"><div class='inline'></div></span>
476
+ <span class="summary_desc"><div class='inline'>
477
+ <p>Give the node a uid, place it in the uid hash and up the count.</p>
478
+ </div></span>
444
479
 
445
480
  </li>
446
481
 
@@ -448,7 +483,7 @@
448
483
  <li class="public ">
449
484
  <span class="summary_signature">
450
485
 
451
- <a href="#write_html-instance_method" title="#write_html (instance method)">- (Object) <strong>write_html</strong>(text, side) </a>
486
+ <a href="#write_html-instance_method" title="#write_html (instance method)">- (String) <strong>write_html</strong>(text, side) </a>
452
487
 
453
488
 
454
489
 
@@ -462,7 +497,9 @@
462
497
 
463
498
 
464
499
 
465
- <span class="summary_desc"><div class='inline'></div></span>
500
+ <span class="summary_desc"><div class='inline'>
501
+ <p>Takes in the text and outputs html.</p>
502
+ </div></span>
466
503
 
467
504
  </li>
468
505
 
@@ -510,13 +547,13 @@
510
547
  <pre class="lines">
511
548
 
512
549
 
513
- 23
514
- 24
515
- 25
516
- 26</pre>
550
+ 57
551
+ 58
552
+ 59
553
+ 60</pre>
517
554
  </td>
518
555
  <td>
519
- <pre class="code"><span class="info file"># File 'lib/smart_diff/htmlize.rb', line 23</span>
556
+ <pre class="code"><span class="info file"># File 'lib/smart_diff/htmlize.rb', line 57</span>
520
557
 
521
558
  <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
522
559
  <span class='ivar'>@uid_count</span> <span class='op'>=</span> <span class='op'>-</span><span class='int'>1</span>
@@ -560,12 +597,12 @@
560
597
  <pre class="lines">
561
598
 
562
599
 
563
- 21
564
- 22
565
- 23</pre>
600
+ 55
601
+ 56
602
+ 57</pre>
566
603
  </td>
567
604
  <td>
568
- <pre class="code"><span class="info file"># File 'lib/smart_diff/htmlize.rb', line 21</span>
605
+ <pre class="code"><span class="info file"># File 'lib/smart_diff/htmlize.rb', line 55</span>
569
606
 
570
607
  <span class='kw'>def</span> <span class='id identifier rubyid_uid_count'>uid_count</span>
571
608
  <span class='ivar'>@uid_count</span>
@@ -603,12 +640,12 @@
603
640
  <pre class="lines">
604
641
 
605
642
 
606
- 21
607
- 22
608
- 23</pre>
643
+ 55
644
+ 56
645
+ 57</pre>
609
646
  </td>
610
647
  <td>
611
- <pre class="code"><span class="info file"># File 'lib/smart_diff/htmlize.rb', line 21</span>
648
+ <pre class="code"><span class="info file"># File 'lib/smart_diff/htmlize.rb', line 55</span>
612
649
 
613
650
  <span class='kw'>def</span> <span class='id identifier rubyid_uid_hash'>uid_hash</span>
614
651
  <span class='ivar'>@uid_hash</span>
@@ -628,38 +665,104 @@
628
665
  <div class="method_details first">
629
666
  <h3 class="signature first" id="apply_tags-instance_method">
630
667
 
631
- - (<tt>Object</tt>) <strong>apply_tags</strong>(s, tags)
668
+ - (<tt>String</tt>) <strong>apply_tags</strong>(s, tags)
632
669
 
633
670
 
634
671
 
635
672
 
636
673
 
637
- </h3><table class="source_code">
674
+ </h3><div class="docstring">
675
+ <div class="discussion">
676
+
677
+ <p>Does HTML escaping on both tags and text, and places the tags around the
678
+ appropriate text.</p>
679
+
680
+
681
+ </div>
682
+ </div>
683
+ <div class="tags">
684
+ <p class="tag_title">Parameters:</p>
685
+ <ul class="param">
686
+
687
+ <li>
688
+
689
+ <span class='name'>s</span>
690
+
691
+
692
+ <span class='type'>(<tt>String</tt>)</span>
693
+
694
+
695
+
696
+ &mdash;
697
+ <div class='inline'>
698
+ <p>The text from one of the files.</p>
699
+ </div>
700
+
701
+ </li>
702
+
703
+ <li>
704
+
705
+ <span class='name'>tags</span>
706
+
707
+
708
+ <span class='type'>(<tt>String</tt>)</span>
709
+
710
+
711
+
712
+ &mdash;
713
+ <div class='inline'>
714
+ <p>The tags belonging to one of the files.</p>
715
+ </div>
716
+
717
+ </li>
718
+
719
+ </ul>
720
+
721
+ <p class="tag_title">Returns:</p>
722
+ <ul class="return">
723
+
724
+ <li>
725
+
726
+
727
+ <span class='type'>(<tt>String</tt>)</span>
728
+
729
+
730
+
731
+ &mdash;
732
+ <div class='inline'>
733
+ <p>The tagged text.</p>
734
+ </div>
735
+
736
+ </li>
737
+
738
+ </ul>
739
+
740
+ </div><table class="source_code">
638
741
  <tr>
639
742
  <td>
640
743
  <pre class="lines">
641
744
 
642
745
 
643
- 103
644
- 104
645
- 105
646
- 106
647
- 107
648
- 108
649
- 109
650
- 110
651
- 111
652
- 112
653
- 113
654
- 114
655
- 115
656
- 116
657
- 117
658
- 118
659
- 119</pre>
746
+ 184
747
+ 185
748
+ 186
749
+ 187
750
+ 188
751
+ 189
752
+ 190
753
+ 191
754
+ 192
755
+ 193
756
+ 194
757
+ 195
758
+ 196
759
+ 197
760
+ 198
761
+ 199
762
+ 200</pre>
660
763
  </td>
661
764
  <td>
662
- <pre class="code"><span class="info file"># File 'lib/smart_diff/htmlize.rb', line 103</span>
765
+ <pre class="code"><span class="info file"># File 'lib/smart_diff/htmlize.rb', line 184</span>
663
766
 
664
767
  <span class='kw'>def</span> <span class='id identifier rubyid_apply_tags'>apply_tags</span><span class='lparen'>(</span><span class='id identifier rubyid_s'>s</span><span class='comma'>,</span> <span class='id identifier rubyid_tags'>tags</span><span class='rparen'>)</span>
665
768
  <span class='id identifier rubyid_tags'>tags</span> <span class='op'>=</span> <span class='id identifier rubyid_tags'>tags</span><span class='period'>.</span><span class='id identifier rubyid_sort_by'>sort_by</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_x'>x</span><span class='op'>|</span> <span class='lbracket'>[</span><span class='id identifier rubyid_x'>x</span><span class='period'>.</span><span class='id identifier rubyid_idx'>idx</span><span class='comma'>,</span> <span class='op'>-</span><span class='id identifier rubyid_x'>x</span><span class='period'>.</span><span class='id identifier rubyid_start'>start</span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
@@ -686,30 +789,79 @@
686
789
  <div class="method_details ">
687
790
  <h3 class="signature " id="change_class-instance_method">
688
791
 
689
- - (<tt>Object</tt>) <strong>change_class</strong>(change)
792
+ - (<tt>String</tt>) <strong>change_class</strong>(change)
690
793
 
691
794
 
692
795
 
693
796
 
694
797
 
695
- </h3><table class="source_code">
798
+ </h3><div class="docstring">
799
+ <div class="discussion">
800
+
801
+ <p>Determines whether the change is an insertion, deletion or modification.</p>
802
+
803
+
804
+ </div>
805
+ </div>
806
+ <div class="tags">
807
+ <p class="tag_title">Parameters:</p>
808
+ <ul class="param">
809
+
810
+ <li>
811
+
812
+ <span class='name'>change</span>
813
+
814
+
815
+ <span class='type'>(<tt>Change</tt>)</span>
816
+
817
+
818
+
819
+ &mdash;
820
+ <div class='inline'>
821
+ <p>The Change object to be checked.</p>
822
+ </div>
823
+
824
+ </li>
825
+
826
+ </ul>
827
+
828
+ <p class="tag_title">Returns:</p>
829
+ <ul class="return">
830
+
831
+ <li>
832
+
833
+
834
+ <span class='type'>(<tt>String</tt>)</span>
835
+
836
+
837
+
838
+ &mdash;
839
+ <div class='inline'>
840
+ <p>Either a &#39;c&#39;, &#39;d&#39;, or &#39;i&#39;</p>
841
+ </div>
842
+
843
+ </li>
844
+
845
+ </ul>
846
+
847
+ </div><table class="source_code">
696
848
  <tr>
697
849
  <td>
698
850
  <pre class="lines">
699
851
 
700
852
 
701
- 151
702
- 152
703
- 153
704
- 154
705
- 155
706
- 156
707
- 157
708
- 158
709
- 159</pre>
853
+ 252
854
+ 253
855
+ 254
856
+ 255
857
+ 256
858
+ 257
859
+ 258
860
+ 259
861
+ 260</pre>
710
862
  </td>
711
863
  <td>
712
- <pre class="code"><span class="info file"># File 'lib/smart_diff/htmlize.rb', line 151</span>
864
+ <pre class="code"><span class="info file"># File 'lib/smart_diff/htmlize.rb', line 252</span>
713
865
 
714
866
  <span class='kw'>def</span> <span class='id identifier rubyid_change_class'>change_class</span><span class='lparen'>(</span><span class='id identifier rubyid_change'>change</span><span class='rparen'>)</span>
715
867
  <span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_change'>change</span><span class='period'>.</span><span class='id identifier rubyid_old_node'>old_node</span>
@@ -728,50 +880,120 @@
728
880
  <div class="method_details ">
729
881
  <h3 class="signature " id="change_tags-instance_method">
730
882
 
731
- - (<tt>Object</tt>) <strong>change_tags</strong>(changes, side)
883
+ - (<tt>Array</tt>) <strong>change_tags</strong>(changes, side)
732
884
 
733
885
 
734
886
 
735
887
 
736
888
 
737
- </h3><table class="source_code">
889
+ </h3><div class="docstring">
890
+ <div class="discussion">
891
+
892
+ <p>Works through the Change objects in the diff, creating the appropriate HTML
893
+ tags for each.</p>
894
+
895
+
896
+ </div>
897
+ </div>
898
+ <div class="tags">
899
+ <p class="tag_title">Parameters:</p>
900
+ <ul class="param">
901
+
902
+ <li>
903
+
904
+ <span class='name'>changes</span>
905
+
906
+
907
+ <span class='type'>(<tt>Array</tt>)</span>
908
+
909
+
910
+
911
+ &mdash;
912
+ <div class='inline'>
913
+ <p>An array of Change objects.</p>
914
+ </div>
915
+
916
+ </li>
917
+
918
+ <li>
919
+
920
+ <span class='name'>side</span>
921
+
922
+
923
+ <span class='type'>(<tt>String</tt>)</span>
924
+
925
+
926
+
927
+ &mdash;
928
+ <div class='inline'>
929
+ <p>Tells us which side of the page to create tags for.</p>
930
+ </div>
931
+
932
+ </li>
933
+
934
+ </ul>
935
+
936
+ <p class="tag_title">Returns:</p>
937
+ <ul class="return">
938
+
939
+ <li>
940
+
941
+
942
+ <span class='type'>(<tt>Array</tt>)</span>
943
+
944
+
945
+
946
+ &mdash;
947
+ <div class='inline'>
948
+ <p>The tags to place around the text.</p>
949
+ </div>
950
+
951
+ </li>
952
+
953
+ </ul>
954
+
955
+ </div><table class="source_code">
738
956
  <tr>
739
957
  <td>
740
958
  <pre class="lines">
741
959
 
742
960
 
743
- 121
744
- 122
745
- 123
746
- 124
747
- 125
748
- 126
749
- 127
750
- 128
751
- 129
752
- 130
753
- 131
754
- 132
755
- 133
756
- 134
757
- 135
758
- 136
759
- 137
760
- 138
761
- 139
762
- 140
763
- 141
764
- 142
765
- 143
766
- 144
767
- 145
768
- 146
769
- 147
770
- 148
771
- 149</pre>
961
+ 211
962
+ 212
963
+ 213
964
+ 214
965
+ 215
966
+ 216
967
+ 217
968
+ 218
969
+ 219
970
+ 220
971
+ 221
972
+ 222
973
+ 223
974
+ 224
975
+ 225
976
+ 226
977
+ 227
978
+ 228
979
+ 229
980
+ 230
981
+ 231
982
+ 232
983
+ 233
984
+ 234
985
+ 235
986
+ 236
987
+ 237
988
+ 238
989
+ 239
990
+ 240
991
+ 241
992
+ 242
993
+ 243</pre>
772
994
  </td>
773
995
  <td>
774
- <pre class="code"><span class="info file"># File 'lib/smart_diff/htmlize.rb', line 121</span>
996
+ <pre class="code"><span class="info file"># File 'lib/smart_diff/htmlize.rb', line 211</span>
775
997
 
776
998
  <span class='kw'>def</span> <span class='id identifier rubyid_change_tags'>change_tags</span><span class='lparen'>(</span><span class='id identifier rubyid_changes'>changes</span><span class='comma'>,</span> <span class='id identifier rubyid_side'>side</span><span class='rparen'>)</span>
777
999
  <span class='id identifier rubyid_tags'>tags</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
@@ -786,16 +1008,20 @@
786
1008
  <span class='kw'>if</span> <span class='id identifier rubyid_inside_anchor?'>inside_anchor?</span><span class='lparen'>(</span><span class='id identifier rubyid_tags'>tags</span><span class='comma'>,</span> <span class='id identifier rubyid_nd_start'>nd_start</span><span class='comma'>,</span> <span class='id identifier rubyid_nd_end'>nd_end</span><span class='rparen'>)</span>
787
1009
  <span class='kw'>if</span> <span class='id identifier rubyid_change_class'>change_class</span><span class='lparen'>(</span><span class='id identifier rubyid_c'>c</span><span class='rparen'>)</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>c</span><span class='regexp_end'>/</span></span>
788
1010
  <span class='comment'># no op
1011
+ </span> <span class='comment'># we don&#39;t nest anchors inside other anchors
789
1012
  </span> <span class='kw'>else</span>
790
- <span class='id identifier rubyid_tags'>tags</span> <span class='op'>&lt;&lt;</span> <span class='const'>Tag</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_span_start'>span_start</span><span class='lparen'>(</span><span class='id identifier rubyid_c'>c</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_nd_start'>nd_start</span><span class='rparen'>)</span>
1013
+ <span class='comment'># In this case, we have an insertion or deletion
1014
+ </span> <span class='id identifier rubyid_tags'>tags</span> <span class='op'>&lt;&lt;</span> <span class='const'>Tag</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_span_start'>span_start</span><span class='lparen'>(</span><span class='id identifier rubyid_c'>c</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_nd_start'>nd_start</span><span class='rparen'>)</span>
791
1015
  <span class='id identifier rubyid_tags'>tags</span> <span class='op'>&lt;&lt;</span> <span class='const'>Tag</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>&lt;/span&gt;</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_nd_end'>nd_end</span><span class='comma'>,</span> <span class='id identifier rubyid_nd_start'>nd_start</span><span class='rparen'>)</span>
792
1016
  <span class='kw'>end</span>
793
1017
  <span class='kw'>else</span>
794
- <span class='id identifier rubyid_tags'>tags</span> <span class='op'>&lt;&lt;</span> <span class='const'>Tag</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_link_start'>link_start</span><span class='lparen'>(</span><span class='id identifier rubyid_c'>c</span><span class='comma'>,</span> <span class='id identifier rubyid_side'>side</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_nd_start'>nd_start</span><span class='rparen'>)</span>
1018
+ <span class='comment'># Link up the matching nodes with anchor tags
1019
+ </span> <span class='id identifier rubyid_tags'>tags</span> <span class='op'>&lt;&lt;</span> <span class='const'>Tag</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_link_start'>link_start</span><span class='lparen'>(</span><span class='id identifier rubyid_c'>c</span><span class='comma'>,</span> <span class='id identifier rubyid_side'>side</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_nd_start'>nd_start</span><span class='rparen'>)</span>
795
1020
  <span class='id identifier rubyid_tags'>tags</span> <span class='op'>&lt;&lt;</span> <span class='const'>Tag</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>&lt;/a&gt;</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_nd_end'>nd_end</span><span class='comma'>,</span> <span class='id identifier rubyid_nd_start'>nd_start</span><span class='rparen'>)</span>
796
1021
  <span class='kw'>end</span>
797
1022
  <span class='kw'>else</span>
798
- <span class='id identifier rubyid_tags'>tags</span> <span class='op'>&lt;&lt;</span> <span class='const'>Tag</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_span_start'>span_start</span><span class='lparen'>(</span><span class='id identifier rubyid_c'>c</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_nd_start'>nd_start</span><span class='rparen'>)</span>
1023
+ <span class='comment'># Wrap a span around the insertion or deletion.
1024
+ </span> <span class='id identifier rubyid_tags'>tags</span> <span class='op'>&lt;&lt;</span> <span class='const'>Tag</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_span_start'>span_start</span><span class='lparen'>(</span><span class='id identifier rubyid_c'>c</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_nd_start'>nd_start</span><span class='rparen'>)</span>
799
1025
  <span class='id identifier rubyid_tags'>tags</span> <span class='op'>&lt;&lt;</span> <span class='const'>Tag</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>&lt;/span&gt;</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_nd_end'>nd_end</span><span class='comma'>,</span> <span class='id identifier rubyid_nd_start'>nd_start</span><span class='rparen'>)</span>
800
1026
  <span class='kw'>end</span>
801
1027
  <span class='kw'>end</span>
@@ -822,13 +1048,13 @@
822
1048
  <pre class="lines">
823
1049
 
824
1050
 
825
- 28
826
- 29
827
- 30
828
- 31</pre>
1051
+ 62
1052
+ 63
1053
+ 64
1054
+ 65</pre>
829
1055
  </td>
830
1056
  <td>
831
- <pre class="code"><span class="info file"># File 'lib/smart_diff/htmlize.rb', line 28</span>
1057
+ <pre class="code"><span class="info file"># File 'lib/smart_diff/htmlize.rb', line 62</span>
832
1058
 
833
1059
  <span class='kw'>def</span> <span class='id identifier rubyid_clear_uid'>clear_uid</span><span class='lparen'>(</span><span class='rparen'>)</span>
834
1060
  <span class='ivar'>@uid_count</span> <span class='op'>=</span> <span class='op'>-</span><span class='int'>1</span>
@@ -842,81 +1068,223 @@
842
1068
  <div class="method_details ">
843
1069
  <h3 class="signature " id="create_html-instance_method">
844
1070
 
845
- - (<tt>Object</tt>) <strong>create_html</strong>(changes, file1, file2, text1, text2)
1071
+ - (<tt>String</tt>) <strong>create_html</strong>(changes, file1, file2, text1, text2)
846
1072
 
847
1073
 
848
1074
 
849
1075
 
850
1076
 
851
- </h3><table class="source_code">
852
- <tr>
853
- <td>
854
- <pre class="lines">
855
-
856
-
857
- 86
858
- 87
859
- 88
860
- 89
861
- 90
862
- 91
863
- 92
864
- 93
865
- 94
866
- 95
867
- 96
868
- 97
869
- 98
870
- 99
871
- 100
872
- 101</pre>
873
- </td>
874
- <td>
875
- <pre class="code"><span class="info file"># File 'lib/smart_diff/htmlize.rb', line 86</span>
876
-
877
- <span class='kw'>def</span> <span class='id identifier rubyid_create_html'>create_html</span><span class='lparen'>(</span><span class='id identifier rubyid_changes'>changes</span><span class='comma'>,</span> <span class='id identifier rubyid_file1'>file1</span><span class='comma'>,</span> <span class='id identifier rubyid_file2'>file2</span><span class='comma'>,</span> <span class='id identifier rubyid_text1'>text1</span><span class='comma'>,</span> <span class='id identifier rubyid_text2'>text2</span><span class='rparen'>)</span>
878
- <span class='id identifier rubyid_tags1'>tags1</span> <span class='op'>=</span> <span class='id identifier rubyid_change_tags'>change_tags</span><span class='lparen'>(</span><span class='id identifier rubyid_changes'>changes</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>left</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
879
- <span class='id identifier rubyid_tags2'>tags2</span> <span class='op'>=</span> <span class='id identifier rubyid_change_tags'>change_tags</span><span class='lparen'>(</span><span class='id identifier rubyid_changes'>changes</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>right</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
880
- <span class='id identifier rubyid_tagged_text1'>tagged_text1</span> <span class='op'>=</span> <span class='id identifier rubyid_apply_tags'>apply_tags</span><span class='lparen'>(</span><span class='id identifier rubyid_text1'>text1</span><span class='comma'>,</span> <span class='id identifier rubyid_tags1'>tags1</span><span class='rparen'>)</span>
881
- <span class='id identifier rubyid_tagged_text2'>tagged_text2</span> <span class='op'>=</span> <span class='id identifier rubyid_apply_tags'>apply_tags</span><span class='lparen'>(</span><span class='id identifier rubyid_text2'>text2</span><span class='comma'>,</span> <span class='id identifier rubyid_tags2'>tags2</span><span class='rparen'>)</span>
1077
+ </h3><div class="docstring">
1078
+ <div class="discussion">
1079
+
1080
+ <p>Takes in the information about the diff and writes out a file of HTML.</p>
882
1081
 
883
- <span class='id identifier rubyid_output_filename'>output_filename</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='const'>Pathname</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_file1'>file1</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_basename'>basename</span><span class='embexpr_end'>}</span><span class='tstring_content'>-</span><span class='embexpr_beg'>#{</span><span class='const'>Pathname</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_file2'>file2</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_basename'>basename</span><span class='embexpr_end'>}</span><span class='tstring_content'>.html</span><span class='tstring_end'>&quot;</span></span>
884
- <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_output_filename'>output_filename</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>w</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_f'>f</span><span class='op'>|</span>
885
- <span class='id identifier rubyid_f'>f</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span> <span class='id identifier rubyid_html_header'>html_header</span>
886
- <span class='id identifier rubyid_f'>f</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span> <span class='id identifier rubyid_write_html'>write_html</span><span class='lparen'>(</span><span class='id identifier rubyid_tagged_text1'>tagged_text1</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>left</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
887
- <span class='id identifier rubyid_f'>f</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span> <span class='id identifier rubyid_write_html'>write_html</span><span class='lparen'>(</span><span class='id identifier rubyid_tagged_text2'>tagged_text2</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>right</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
888
- <span class='id identifier rubyid_f'>f</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span> <span class='id identifier rubyid_html_footer'>html_footer</span>
889
- <span class='kw'>end</span>
890
- <span class='id identifier rubyid_output_filename'>output_filename</span>
891
1082
 
892
- <span class='kw'>end</span></pre>
893
- </td>
894
- </tr>
895
- </table>
1083
+ </div>
896
1084
  </div>
897
-
898
- <div class="method_details ">
899
- <h3 class="signature " id="html_footer-instance_method">
900
-
901
- - (<tt>Object</tt>) <strong>html_footer</strong>
1085
+ <div class="tags">
1086
+ <p class="tag_title">Parameters:</p>
1087
+ <ul class="param">
902
1088
 
903
-
1089
+ <li>
1090
+
1091
+ <span class='name'>changes</span>
1092
+
1093
+
1094
+ <span class='type'>(<tt>Array</tt>)</span>
1095
+
1096
+
1097
+
1098
+ &mdash;
1099
+ <div class='inline'>
1100
+ <p>An array of Changes, the diff</p>
1101
+ </div>
1102
+
1103
+ </li>
904
1104
 
905
-
1105
+ <li>
1106
+
1107
+ <span class='name'>file1</span>
1108
+
1109
+
1110
+ <span class='type'>(<tt>String</tt>)</span>
1111
+
1112
+
1113
+
1114
+ &mdash;
1115
+ <div class='inline'>
1116
+ <p>path to the first file.</p>
1117
+ </div>
1118
+
1119
+ </li>
906
1120
 
907
- </h3><table class="source_code">
908
- <tr>
909
- <td>
910
- <pre class="lines">
911
-
912
-
913
- 64
914
- 65
915
- 66
916
- 67</pre>
1121
+ <li>
1122
+
1123
+ <span class='name'>file2</span>
1124
+
1125
+
1126
+ <span class='type'>(<tt>String</tt>)</span>
1127
+
1128
+
1129
+
1130
+ &mdash;
1131
+ <div class='inline'>
1132
+ <p>path to the second file.</p>
1133
+ </div>
1134
+
1135
+ </li>
1136
+
1137
+ <li>
1138
+
1139
+ <span class='name'>text1</span>
1140
+
1141
+
1142
+ <span class='type'>(<tt>String</tt>)</span>
1143
+
1144
+
1145
+
1146
+ &mdash;
1147
+ <div class='inline'>
1148
+ <p>the text from the first file</p>
1149
+ </div>
1150
+
1151
+ </li>
1152
+
1153
+ <li>
1154
+
1155
+ <span class='name'>text2</span>
1156
+
1157
+
1158
+ <span class='type'>(<tt>String</tt>)</span>
1159
+
1160
+
1161
+
1162
+ &mdash;
1163
+ <div class='inline'>
1164
+ <p>the text from the second file.</p>
1165
+ </div>
1166
+
1167
+ </li>
1168
+
1169
+ </ul>
1170
+
1171
+ <p class="tag_title">Returns:</p>
1172
+ <ul class="return">
1173
+
1174
+ <li>
1175
+
1176
+
1177
+ <span class='type'>(<tt>String</tt>)</span>
1178
+
1179
+
1180
+
1181
+ &mdash;
1182
+ <div class='inline'>
1183
+ <p>The name of the HTML file that was written.</p>
1184
+ </div>
1185
+
1186
+ </li>
1187
+
1188
+ </ul>
1189
+
1190
+ </div><table class="source_code">
1191
+ <tr>
1192
+ <td>
1193
+ <pre class="lines">
1194
+
1195
+
1196
+ 158
1197
+ 159
1198
+ 160
1199
+ 161
1200
+ 162
1201
+ 163
1202
+ 164
1203
+ 165
1204
+ 166
1205
+ 167
1206
+ 168
1207
+ 169
1208
+ 170
1209
+ 171
1210
+ 172
1211
+ 173</pre>
1212
+ </td>
1213
+ <td>
1214
+ <pre class="code"><span class="info file"># File 'lib/smart_diff/htmlize.rb', line 158</span>
1215
+
1216
+ <span class='kw'>def</span> <span class='id identifier rubyid_create_html'>create_html</span><span class='lparen'>(</span><span class='id identifier rubyid_changes'>changes</span><span class='comma'>,</span> <span class='id identifier rubyid_file1'>file1</span><span class='comma'>,</span> <span class='id identifier rubyid_file2'>file2</span><span class='comma'>,</span> <span class='id identifier rubyid_text1'>text1</span><span class='comma'>,</span> <span class='id identifier rubyid_text2'>text2</span><span class='rparen'>)</span>
1217
+ <span class='id identifier rubyid_tags1'>tags1</span> <span class='op'>=</span> <span class='id identifier rubyid_change_tags'>change_tags</span><span class='lparen'>(</span><span class='id identifier rubyid_changes'>changes</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>left</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
1218
+ <span class='id identifier rubyid_tags2'>tags2</span> <span class='op'>=</span> <span class='id identifier rubyid_change_tags'>change_tags</span><span class='lparen'>(</span><span class='id identifier rubyid_changes'>changes</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>right</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
1219
+ <span class='id identifier rubyid_tagged_text1'>tagged_text1</span> <span class='op'>=</span> <span class='id identifier rubyid_apply_tags'>apply_tags</span><span class='lparen'>(</span><span class='id identifier rubyid_text1'>text1</span><span class='comma'>,</span> <span class='id identifier rubyid_tags1'>tags1</span><span class='rparen'>)</span>
1220
+ <span class='id identifier rubyid_tagged_text2'>tagged_text2</span> <span class='op'>=</span> <span class='id identifier rubyid_apply_tags'>apply_tags</span><span class='lparen'>(</span><span class='id identifier rubyid_text2'>text2</span><span class='comma'>,</span> <span class='id identifier rubyid_tags2'>tags2</span><span class='rparen'>)</span>
1221
+
1222
+ <span class='id identifier rubyid_output_filename'>output_filename</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='const'>Pathname</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_file1'>file1</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_basename'>basename</span><span class='embexpr_end'>}</span><span class='tstring_content'>-</span><span class='embexpr_beg'>#{</span><span class='const'>Pathname</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_file2'>file2</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_basename'>basename</span><span class='embexpr_end'>}</span><span class='tstring_content'>.html</span><span class='tstring_end'>&quot;</span></span>
1223
+ <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_output_filename'>output_filename</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>w</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_f'>f</span><span class='op'>|</span>
1224
+ <span class='id identifier rubyid_f'>f</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span> <span class='id identifier rubyid_html_header'>html_header</span>
1225
+ <span class='id identifier rubyid_f'>f</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span> <span class='id identifier rubyid_write_html'>write_html</span><span class='lparen'>(</span><span class='id identifier rubyid_tagged_text1'>tagged_text1</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>left</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
1226
+ <span class='id identifier rubyid_f'>f</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span> <span class='id identifier rubyid_write_html'>write_html</span><span class='lparen'>(</span><span class='id identifier rubyid_tagged_text2'>tagged_text2</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>right</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
1227
+ <span class='id identifier rubyid_f'>f</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span> <span class='id identifier rubyid_html_footer'>html_footer</span>
1228
+ <span class='kw'>end</span>
1229
+ <span class='id identifier rubyid_output_filename'>output_filename</span>
1230
+
1231
+ <span class='kw'>end</span></pre>
1232
+ </td>
1233
+ </tr>
1234
+ </table>
1235
+ </div>
1236
+
1237
+ <div class="method_details ">
1238
+ <h3 class="signature " id="html_footer-instance_method">
1239
+
1240
+ - (<tt>String</tt>) <strong>html_footer</strong>
1241
+
1242
+
1243
+
1244
+
1245
+
1246
+ </h3><div class="docstring">
1247
+ <div class="discussion">
1248
+
1249
+ <p>Create the html for the bottom of the page.</p>
1250
+
1251
+
1252
+ </div>
1253
+ </div>
1254
+ <div class="tags">
1255
+
1256
+ <p class="tag_title">Returns:</p>
1257
+ <ul class="return">
1258
+
1259
+ <li>
1260
+
1261
+
1262
+ <span class='type'>(<tt>String</tt>)</span>
1263
+
1264
+
1265
+
1266
+ &mdash;
1267
+ <div class='inline'>
1268
+ <p>the html footer.</p>
1269
+ </div>
1270
+
1271
+ </li>
1272
+
1273
+ </ul>
1274
+
1275
+ </div><table class="source_code">
1276
+ <tr>
1277
+ <td>
1278
+ <pre class="lines">
1279
+
1280
+
1281
+ 117
1282
+ 118
1283
+ 119
1284
+ 120</pre>
917
1285
  </td>
918
1286
  <td>
919
- <pre class="code"><span class="info file"># File 'lib/smart_diff/htmlize.rb', line 64</span>
1287
+ <pre class="code"><span class="info file"># File 'lib/smart_diff/htmlize.rb', line 117</span>
920
1288
 
921
1289
  <span class='kw'>def</span> <span class='id identifier rubyid_html_footer'>html_footer</span>
922
1290
  <span class='id identifier rubyid_out'>out</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>%Q{</span><span class='tstring_content'>&lt;/body&gt;\n
@@ -930,42 +1298,71 @@
930
1298
  <div class="method_details ">
931
1299
  <h3 class="signature " id="html_header-instance_method">
932
1300
 
933
- - (<tt>Object</tt>) <strong>html_header</strong>
1301
+ - (<tt>String</tt>) <strong>html_header</strong>
934
1302
 
935
1303
 
936
1304
 
937
1305
 
938
1306
 
939
- </h3><table class="source_code">
1307
+ </h3><div class="docstring">
1308
+ <div class="discussion">
1309
+
1310
+ <p>Construct the HTML for the top of the file.</p>
1311
+
1312
+
1313
+ </div>
1314
+ </div>
1315
+ <div class="tags">
1316
+
1317
+ <p class="tag_title">Returns:</p>
1318
+ <ul class="return">
1319
+
1320
+ <li>
1321
+
1322
+
1323
+ <span class='type'>(<tt>String</tt>)</span>
1324
+
1325
+
1326
+
1327
+ &mdash;
1328
+ <div class='inline'>
1329
+ <p>HTML header.</p>
1330
+ </div>
1331
+
1332
+ </li>
1333
+
1334
+ </ul>
1335
+
1336
+ </div><table class="source_code">
940
1337
  <tr>
941
1338
  <td>
942
1339
  <pre class="lines">
943
1340
 
944
1341
 
945
- 42
946
- 43
947
- 44
948
- 45
949
- 46
950
- 47
951
- 48
952
- 49
953
- 50
954
- 51
955
- 52
956
- 53
957
- 54
958
- 55
959
- 56
960
- 57
961
- 58
962
- 59
963
- 60
964
- 61
965
- 62</pre>
1342
+ 90
1343
+ 91
1344
+ 92
1345
+ 93
1346
+ 94
1347
+ 95
1348
+ 96
1349
+ 97
1350
+ 98
1351
+ 99
1352
+ 100
1353
+ 101
1354
+ 102
1355
+ 103
1356
+ 104
1357
+ 105
1358
+ 106
1359
+ 107
1360
+ 108
1361
+ 109
1362
+ 110</pre>
966
1363
  </td>
967
1364
  <td>
968
- <pre class="code"><span class="info file"># File 'lib/smart_diff/htmlize.rb', line 42</span>
1365
+ <pre class="code"><span class="info file"># File 'lib/smart_diff/htmlize.rb', line 90</span>
969
1366
 
970
1367
  <span class='kw'>def</span> <span class='id identifier rubyid_html_header'>html_header</span>
971
1368
  <span class='id identifier rubyid_install_path'>install_path</span> <span class='op'>=</span> <span class='id identifier rubyid_get_install_path'>get_install_path</span>
@@ -996,32 +1393,97 @@
996
1393
  <div class="method_details ">
997
1394
  <h3 class="signature " id="link_start-instance_method">
998
1395
 
999
- - (<tt>Object</tt>) <strong>link_start</strong>(change, side)
1396
+ - (<tt>String</tt>) <strong>link_start</strong>(change, side)
1000
1397
 
1001
1398
 
1002
1399
 
1003
1400
 
1004
1401
 
1005
- </h3><table class="source_code">
1402
+ </h3><div class="docstring">
1403
+ <div class="discussion">
1404
+
1405
+ <p>Create anchor tags for a Change object.</p>
1406
+
1407
+
1408
+ </div>
1409
+ </div>
1410
+ <div class="tags">
1411
+ <p class="tag_title">Parameters:</p>
1412
+ <ul class="param">
1413
+
1414
+ <li>
1415
+
1416
+ <span class='name'>change</span>
1417
+
1418
+
1419
+ <span class='type'>(<tt>Change</tt>)</span>
1420
+
1421
+
1422
+
1423
+ &mdash;
1424
+ <div class='inline'>
1425
+ <p>The Change object to be wrapped.</p>
1426
+ </div>
1427
+
1428
+ </li>
1429
+
1430
+ <li>
1431
+
1432
+ <span class='name'>side</span>
1433
+
1434
+
1435
+ <span class='type'>(<tt>String</tt>)</span>
1436
+
1437
+
1438
+
1439
+ &mdash;
1440
+ <div class='inline'>
1441
+ <p>Which side of the page, in other words, which file?</p>
1442
+ </div>
1443
+
1444
+ </li>
1445
+
1446
+ </ul>
1447
+
1448
+ <p class="tag_title">Returns:</p>
1449
+ <ul class="return">
1450
+
1451
+ <li>
1452
+
1453
+
1454
+ <span class='type'>(<tt>String</tt>)</span>
1455
+
1456
+
1457
+
1458
+ &mdash;
1459
+ <div class='inline'>
1460
+ <p>An anchor tag.</p>
1461
+ </div>
1462
+
1463
+ </li>
1464
+
1465
+ </ul>
1466
+
1467
+ </div><table class="source_code">
1006
1468
  <tr>
1007
1469
  <td>
1008
1470
  <pre class="lines">
1009
1471
 
1010
1472
 
1011
- 165
1012
- 166
1013
- 167
1014
- 168
1015
- 169
1016
- 170
1017
- 171
1018
- 172
1019
- 173
1020
- 174
1021
- 175</pre>
1473
+ 282
1474
+ 283
1475
+ 284
1476
+ 285
1477
+ 286
1478
+ 287
1479
+ 288
1480
+ 289
1481
+ 290
1482
+ 291
1483
+ 292</pre>
1022
1484
  </td>
1023
1485
  <td>
1024
- <pre class="code"><span class="info file"># File 'lib/smart_diff/htmlize.rb', line 165</span>
1486
+ <pre class="code"><span class="info file"># File 'lib/smart_diff/htmlize.rb', line 282</span>
1025
1487
 
1026
1488
  <span class='kw'>def</span> <span class='id identifier rubyid_link_start'>link_start</span><span class='lparen'>(</span><span class='id identifier rubyid_change'>change</span><span class='comma'>,</span> <span class='id identifier rubyid_side'>side</span><span class='rparen'>)</span>
1027
1489
  <span class='id identifier rubyid_cls'>cls</span> <span class='op'>=</span> <span class='id identifier rubyid_change_class'>change_class</span><span class='lparen'>(</span><span class='id identifier rubyid_change'>change</span><span class='rparen'>)</span>
@@ -1042,24 +1504,73 @@
1042
1504
  <div class="method_details ">
1043
1505
  <h3 class="signature " id="qs-instance_method">
1044
1506
 
1045
- - (<tt>Object</tt>) <strong>qs</strong>(s)
1507
+ - (<tt>String</tt>) <strong>qs</strong>(s)
1046
1508
 
1047
1509
 
1048
1510
 
1049
1511
 
1050
1512
 
1051
- </h3><table class="source_code">
1513
+ </h3><div class="docstring">
1514
+ <div class="discussion">
1515
+
1516
+ <p>Takes a string and returns it in quotes.</p>
1517
+
1518
+
1519
+ </div>
1520
+ </div>
1521
+ <div class="tags">
1522
+ <p class="tag_title">Parameters:</p>
1523
+ <ul class="param">
1524
+
1525
+ <li>
1526
+
1527
+ <span class='name'>s</span>
1528
+
1529
+
1530
+ <span class='type'>(<tt>String</tt>)</span>
1531
+
1532
+
1533
+
1534
+ &mdash;
1535
+ <div class='inline'>
1536
+ <p>A string to be quoted.</p>
1537
+ </div>
1538
+
1539
+ </li>
1540
+
1541
+ </ul>
1542
+
1543
+ <p class="tag_title">Returns:</p>
1544
+ <ul class="return">
1545
+
1546
+ <li>
1547
+
1548
+
1549
+ <span class='type'>(<tt>String</tt>)</span>
1550
+
1551
+
1552
+
1553
+ &mdash;
1554
+ <div class='inline'>
1555
+ <p>The quoted string.</p>
1556
+ </div>
1557
+
1558
+ </li>
1559
+
1560
+ </ul>
1561
+
1562
+ </div><table class="source_code">
1052
1563
  <tr>
1053
1564
  <td>
1054
1565
  <pre class="lines">
1055
1566
 
1056
1567
 
1057
- 177
1058
- 178
1059
- 179</pre>
1568
+ 301
1569
+ 302
1570
+ 303</pre>
1060
1571
  </td>
1061
1572
  <td>
1062
- <pre class="code"><span class="info file"># File 'lib/smart_diff/htmlize.rb', line 177</span>
1573
+ <pre class="code"><span class="info file"># File 'lib/smart_diff/htmlize.rb', line 301</span>
1063
1574
 
1064
1575
  <span class='kw'>def</span> <span class='id identifier rubyid_qs'>qs</span><span class='lparen'>(</span><span class='id identifier rubyid_s'>s</span><span class='rparen'>)</span>
1065
1576
  <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&#39;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_s'>s</span><span class='embexpr_end'>}</span><span class='tstring_content'>&#39;</span><span class='tstring_end'>&quot;</span></span>
@@ -1072,24 +1583,75 @@
1072
1583
  <div class="method_details ">
1073
1584
  <h3 class="signature " id="span_start-instance_method">
1074
1585
 
1075
- - (<tt>Object</tt>) <strong>span_start</strong>(change)
1586
+ - (<tt>String</tt>) <strong>span_start</strong>(change)
1076
1587
 
1077
1588
 
1078
1589
 
1079
1590
 
1080
1591
 
1081
- </h3><table class="source_code">
1592
+ </h3><div class="docstring">
1593
+ <div class="discussion">
1594
+
1595
+ <p>Takes a Change and creates a span tag.</p>
1596
+
1597
+ <p>an insertion or deletion.</p>
1598
+
1599
+
1600
+ </div>
1601
+ </div>
1602
+ <div class="tags">
1603
+ <p class="tag_title">Parameters:</p>
1604
+ <ul class="param">
1605
+
1606
+ <li>
1607
+
1608
+ <span class='name'>change</span>
1609
+
1610
+
1611
+ <span class='type'>(<tt>Change</tt>)</span>
1612
+
1613
+
1614
+
1615
+ &mdash;
1616
+ <div class='inline'>
1617
+ <p>A single change from the diff representing either</p>
1618
+ </div>
1619
+
1620
+ </li>
1621
+
1622
+ </ul>
1623
+
1624
+ <p class="tag_title">Returns:</p>
1625
+ <ul class="return">
1626
+
1627
+ <li>
1628
+
1629
+
1630
+ <span class='type'>(<tt>String</tt>)</span>
1631
+
1632
+
1633
+
1634
+ &mdash;
1635
+ <div class='inline'>
1636
+ <p>A span tag based on the Change passed in.</p>
1637
+ </div>
1638
+
1639
+ </li>
1640
+
1641
+ </ul>
1642
+
1643
+ </div><table class="source_code">
1082
1644
  <tr>
1083
1645
  <td>
1084
1646
  <pre class="lines">
1085
1647
 
1086
1648
 
1087
- 161
1088
- 162
1089
- 163</pre>
1649
+ 270
1650
+ 271
1651
+ 272</pre>
1090
1652
  </td>
1091
1653
  <td>
1092
- <pre class="code"><span class="info file"># File 'lib/smart_diff/htmlize.rb', line 161</span>
1654
+ <pre class="code"><span class="info file"># File 'lib/smart_diff/htmlize.rb', line 270</span>
1093
1655
 
1094
1656
  <span class='kw'>def</span> <span class='id identifier rubyid_span_start'>span_start</span><span class='lparen'>(</span><span class='id identifier rubyid_change'>change</span><span class='rparen'>)</span>
1095
1657
  <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&lt;span class=</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_qs'>qs</span><span class='lparen'>(</span><span class='id identifier rubyid_change_class'>change_class</span><span class='lparen'>(</span><span class='id identifier rubyid_change'>change</span><span class='rparen'>)</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>&gt;</span><span class='tstring_end'>&quot;</span></span>
@@ -1102,29 +1664,79 @@
1102
1664
  <div class="method_details ">
1103
1665
  <h3 class="signature " id="uid-instance_method">
1104
1666
 
1105
- - (<tt>Object</tt>) <strong>uid</strong>(node)
1667
+ - (<tt>Fixnum</tt>) <strong>uid</strong>(node)
1106
1668
 
1107
1669
 
1108
1670
 
1109
1671
 
1110
1672
 
1111
- </h3><table class="source_code">
1673
+ </h3><div class="docstring">
1674
+ <div class="discussion">
1675
+
1676
+ <p>Give the node a uid, place it in the uid hash and up the count. If it
1677
+ already has one, fetch it from the hash and return it.</p>
1678
+
1679
+
1680
+ </div>
1681
+ </div>
1682
+ <div class="tags">
1683
+ <p class="tag_title">Parameters:</p>
1684
+ <ul class="param">
1685
+
1686
+ <li>
1687
+
1688
+ <span class='name'>node</span>
1689
+
1690
+
1691
+ <span class='type'>(<tt>org.jrubyparser.Node</tt>)</span>
1692
+
1693
+
1694
+
1695
+ &mdash;
1696
+ <div class='inline'>
1697
+ <p>A node in the AST.</p>
1698
+ </div>
1699
+
1700
+ </li>
1701
+
1702
+ </ul>
1703
+
1704
+ <p class="tag_title">Returns:</p>
1705
+ <ul class="return">
1706
+
1707
+ <li>
1708
+
1709
+
1710
+ <span class='type'>(<tt>Fixnum</tt>)</span>
1711
+
1712
+
1713
+
1714
+ &mdash;
1715
+ <div class='inline'>
1716
+ <p>The uid of the node passed in.</p>
1717
+ </div>
1718
+
1719
+ </li>
1720
+
1721
+ </ul>
1722
+
1723
+ </div><table class="source_code">
1112
1724
  <tr>
1113
1725
  <td>
1114
1726
  <pre class="lines">
1115
1727
 
1116
1728
 
1117
- 33
1118
- 34
1119
- 35
1120
- 36
1121
- 37
1122
- 38
1123
- 39
1124
- 40</pre>
1729
+ 76
1730
+ 77
1731
+ 78
1732
+ 79
1733
+ 80
1734
+ 81
1735
+ 82
1736
+ 83</pre>
1125
1737
  </td>
1126
1738
  <td>
1127
- <pre class="code"><span class="info file"># File 'lib/smart_diff/htmlize.rb', line 33</span>
1739
+ <pre class="code"><span class="info file"># File 'lib/smart_diff/htmlize.rb', line 76</span>
1128
1740
 
1129
1741
  <span class='kw'>def</span> <span class='id identifier rubyid_uid'>uid</span><span class='lparen'>(</span><span class='id identifier rubyid_node'>node</span><span class='rparen'>)</span>
1130
1742
  <span class='kw'>if</span> <span class='ivar'>@uid_hash</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='id identifier rubyid_node'>node</span><span class='rparen'>)</span>
@@ -1142,37 +1754,102 @@
1142
1754
  <div class="method_details ">
1143
1755
  <h3 class="signature " id="write_html-instance_method">
1144
1756
 
1145
- - (<tt>Object</tt>) <strong>write_html</strong>(text, side)
1757
+ - (<tt>String</tt>) <strong>write_html</strong>(text, side)
1146
1758
 
1147
1759
 
1148
1760
 
1149
1761
 
1150
1762
 
1151
- </h3><table class="source_code">
1763
+ </h3><div class="docstring">
1764
+ <div class="discussion">
1765
+
1766
+ <p>Takes in the text and outputs html.</p>
1767
+
1768
+
1769
+ </div>
1770
+ </div>
1771
+ <div class="tags">
1772
+ <p class="tag_title">Parameters:</p>
1773
+ <ul class="param">
1774
+
1775
+ <li>
1776
+
1777
+ <span class='name'>text</span>
1778
+
1779
+
1780
+ <span class='type'>(<tt>String</tt>)</span>
1781
+
1782
+
1783
+
1784
+ &mdash;
1785
+ <div class='inline'>
1786
+ <p>the text from either side of the diff, w/ html tags.</p>
1787
+ </div>
1788
+
1789
+ </li>
1790
+
1791
+ <li>
1792
+
1793
+ <span class='name'>side</span>
1794
+
1795
+
1796
+ <span class='type'>(<tt>String</tt>)</span>
1797
+
1798
+
1799
+
1800
+ &mdash;
1801
+ <div class='inline'>
1802
+ <p>left or right</p>
1803
+ </div>
1804
+
1805
+ </li>
1806
+
1807
+ </ul>
1808
+
1809
+ <p class="tag_title">Returns:</p>
1810
+ <ul class="return">
1811
+
1812
+ <li>
1813
+
1814
+
1815
+ <span class='type'>(<tt>String</tt>)</span>
1816
+
1817
+
1818
+
1819
+ &mdash;
1820
+ <div class='inline'>
1821
+ <p>All the html for one side of the diff.</p>
1822
+ </div>
1823
+
1824
+ </li>
1825
+
1826
+ </ul>
1827
+
1828
+ </div><table class="source_code">
1152
1829
  <tr>
1153
1830
  <td>
1154
1831
  <pre class="lines">
1155
1832
 
1156
1833
 
1157
- 69
1158
- 70
1159
- 71
1160
- 72
1161
- 73
1162
- 74
1163
- 75
1164
- 76
1165
- 77
1166
- 78
1167
- 79
1168
- 80
1169
- 81
1170
- 82
1171
- 83
1172
- 84</pre>
1834
+ 130
1835
+ 131
1836
+ 132
1837
+ 133
1838
+ 134
1839
+ 135
1840
+ 136
1841
+ 137
1842
+ 138
1843
+ 139
1844
+ 140
1845
+ 141
1846
+ 142
1847
+ 143
1848
+ 144
1849
+ 145</pre>
1173
1850
  </td>
1174
1851
  <td>
1175
- <pre class="code"><span class="info file"># File 'lib/smart_diff/htmlize.rb', line 69</span>
1852
+ <pre class="code"><span class="info file"># File 'lib/smart_diff/htmlize.rb', line 130</span>
1176
1853
 
1177
1854
  <span class='kw'>def</span> <span class='id identifier rubyid_write_html'>write_html</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='comma'>,</span> <span class='id identifier rubyid_side'>side</span><span class='rparen'>)</span>
1178
1855
  <span class='id identifier rubyid_out'>out</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span>
@@ -1200,7 +1877,7 @@
1200
1877
  </div>
1201
1878
 
1202
1879
  <div id="footer">
1203
- Generated on Fri Sep 13 17:10:49 2013 by
1880
+ Generated on Mon Sep 16 03:40:02 2013 by
1204
1881
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1205
1882
  0.8.6.1 (ruby-2.0.0).
1206
1883
  </div>