smart_diff 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,790 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Class: SmartDiff
8
+
9
+ &mdash; Documentation by YARD 0.8.6.1
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#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="_index.html">Index (S)</a> &raquo;
35
+
36
+
37
+ <span class="title">SmartDiff</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Class: SmartDiff
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName">Object</span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">SmartDiff</li>
82
+
83
+ </ul>
84
+ <a href="#" class="inheritanceTree">show all</a>
85
+
86
+ </dd>
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+ <dt class="r2 last">Defined in:</dt>
97
+ <dd class="r2 last">lib/smart_diff.rb</dd>
98
+
99
+ </dl>
100
+ <div class="clear"></div>
101
+
102
+
103
+
104
+
105
+
106
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
107
+ <ul class="summary">
108
+
109
+ <li class="public ">
110
+ <span class="summary_signature">
111
+
112
+ <a href="#code_one-instance_method" title="#code_one (instance method)">- (Object) <strong>code_one</strong> </a>
113
+
114
+
115
+
116
+ </span>
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+ <span class="summary_desc"><div class='inline'>
130
+ <p>Returns the value of attribute code_one.</p>
131
+ </div></span>
132
+
133
+ </li>
134
+
135
+
136
+ <li class="public ">
137
+ <span class="summary_signature">
138
+
139
+ <a href="#code_two-instance_method" title="#code_two (instance method)">- (Object) <strong>code_two</strong> </a>
140
+
141
+
142
+
143
+ </span>
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+ <span class="summary_desc"><div class='inline'>
157
+ <p>Returns the value of attribute code_two.</p>
158
+ </div></span>
159
+
160
+ </li>
161
+
162
+
163
+ <li class="public ">
164
+ <span class="summary_signature">
165
+
166
+ <a href="#file_one-instance_method" title="#file_one (instance method)">- (Object) <strong>file_one</strong> </a>
167
+
168
+
169
+
170
+ </span>
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+ <span class="summary_desc"><div class='inline'>
184
+ <p>Returns the value of attribute file_one.</p>
185
+ </div></span>
186
+
187
+ </li>
188
+
189
+
190
+ <li class="public ">
191
+ <span class="summary_signature">
192
+
193
+ <a href="#file_two-instance_method" title="#file_two (instance method)">- (Object) <strong>file_two</strong> </a>
194
+
195
+
196
+
197
+ </span>
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+ <span class="summary_desc"><div class='inline'>
211
+ <p>Returns the value of attribute file_two.</p>
212
+ </div></span>
213
+
214
+ </li>
215
+
216
+
217
+ <li class="public ">
218
+ <span class="summary_signature">
219
+
220
+ <a href="#node_diff-instance_method" title="#node_diff (instance method)">- (Object) <strong>node_diff</strong> </a>
221
+
222
+
223
+
224
+ </span>
225
+
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+
235
+
236
+
237
+ <span class="summary_desc"><div class='inline'>
238
+ <p>Returns the value of attribute node_diff.</p>
239
+ </div></span>
240
+
241
+ </li>
242
+
243
+
244
+ </ul>
245
+
246
+
247
+
248
+
249
+
250
+ <h2>
251
+ Instance Method Summary
252
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
253
+ </h2>
254
+
255
+ <ul class="summary">
256
+
257
+ <li class="public ">
258
+ <span class="summary_signature">
259
+
260
+ <a href="#diff-instance_method" title="#diff (instance method)">- (Object) <strong>diff</strong> </a>
261
+
262
+
263
+
264
+ </span>
265
+
266
+
267
+
268
+
269
+
270
+
271
+
272
+
273
+
274
+ <span class="summary_desc"><div class='inline'></div></span>
275
+
276
+ </li>
277
+
278
+
279
+ <li class="public ">
280
+ <span class="summary_signature">
281
+
282
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (SmartDiff) <strong>initialize</strong>(file_one, file_two) </a>
283
+
284
+
285
+
286
+ </span>
287
+
288
+
289
+ <span class="note title constructor">constructor</span>
290
+
291
+
292
+
293
+
294
+
295
+
296
+
297
+
298
+ <span class="summary_desc"><div class='inline'>
299
+ <p>Create a SmartDiff object which will create diff of two source files based
300
+ on AST generated by JRubyParser.</p>
301
+ </div></span>
302
+
303
+ </li>
304
+
305
+
306
+ <li class="public ">
307
+ <span class="summary_signature">
308
+
309
+ <a href="#parse-instance_method" title="#parse (instance method)">- (Object) <strong>parse</strong>(code_to_parse, file_name) </a>
310
+
311
+
312
+
313
+ </span>
314
+
315
+
316
+
317
+
318
+
319
+
320
+
321
+
322
+
323
+ <span class="summary_desc"><div class='inline'></div></span>
324
+
325
+ </li>
326
+
327
+
328
+ <li class="public ">
329
+ <span class="summary_signature">
330
+
331
+ <a href="#read-instance_method" title="#read (instance method)">- (Object) <strong>read</strong>(file_name) </a>
332
+
333
+
334
+
335
+ </span>
336
+
337
+
338
+
339
+
340
+
341
+
342
+
343
+
344
+
345
+ <span class="summary_desc"><div class='inline'></div></span>
346
+
347
+ </li>
348
+
349
+
350
+ </ul>
351
+
352
+
353
+ <div id="constructor_details" class="method_details_list">
354
+ <h2>Constructor Details</h2>
355
+
356
+ <div class="method_details first">
357
+ <h3 class="signature first" id="initialize-instance_method">
358
+
359
+ - (<tt><span class='object_link'><a href="" title="SmartDiff (class)">SmartDiff</a></span></tt>) <strong>initialize</strong>(file_one, file_two)
360
+
361
+
362
+
363
+
364
+
365
+ </h3><div class="docstring">
366
+ <div class="discussion">
367
+
368
+ <p>Create a SmartDiff object which will create diff of two source files based
369
+ on AST generated by JRubyParser.</p>
370
+
371
+
372
+ </div>
373
+ </div>
374
+ <div class="tags">
375
+ <p class="tag_title">Parameters:</p>
376
+ <ul class="param">
377
+
378
+ <li>
379
+
380
+ <span class='name'>file_one</span>
381
+
382
+
383
+ <span class='type'>(<tt>String</tt>)</span>
384
+
385
+
386
+
387
+ &mdash;
388
+ <div class='inline'>
389
+ <p>The path to the first source file.</p>
390
+ </div>
391
+
392
+ </li>
393
+
394
+ <li>
395
+
396
+ <span class='name'>file_two</span>
397
+
398
+
399
+ <span class='type'>(<tt>String</tt>)</span>
400
+
401
+
402
+
403
+ &mdash;
404
+ <div class='inline'>
405
+ <p>The path to the second source file.</p>
406
+ </div>
407
+
408
+ </li>
409
+
410
+ </ul>
411
+
412
+
413
+ </div><table class="source_code">
414
+ <tr>
415
+ <td>
416
+ <pre class="lines">
417
+
418
+
419
+ 19
420
+ 20
421
+ 21
422
+ 22
423
+ 23</pre>
424
+ </td>
425
+ <td>
426
+ <pre class="code"><span class="info file"># File 'lib/smart_diff.rb', line 19</span>
427
+
428
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_file_one'>file_one</span><span class='comma'>,</span> <span class='id identifier rubyid_file_two'>file_two</span><span class='rparen'>)</span>
429
+ <span class='ivar'>@file_one</span> <span class='op'>=</span> <span class='id identifier rubyid_file_one'>file_one</span>
430
+ <span class='ivar'>@file_two</span> <span class='op'>=</span> <span class='id identifier rubyid_file_two'>file_two</span>
431
+ <span class='ivar'>@node_diff</span> <span class='op'>=</span> <span class='id identifier rubyid_diff'>diff</span><span class='lparen'>(</span><span class='rparen'>)</span>
432
+ <span class='kw'>end</span></pre>
433
+ </td>
434
+ </tr>
435
+ </table>
436
+ </div>
437
+
438
+ </div>
439
+
440
+ <div id="instance_attr_details" class="attr_details">
441
+ <h2>Instance Attribute Details</h2>
442
+
443
+
444
+ <span id="code_one=-instance_method"></span>
445
+ <div class="method_details first">
446
+ <h3 class="signature first" id="code_one-instance_method">
447
+
448
+ - (<tt>Object</tt>) <strong>code_one</strong>
449
+
450
+
451
+
452
+
453
+
454
+ </h3><div class="docstring">
455
+ <div class="discussion">
456
+
457
+ <p>Returns the value of attribute code_one</p>
458
+
459
+
460
+ </div>
461
+ </div>
462
+ <div class="tags">
463
+
464
+
465
+ </div><table class="source_code">
466
+ <tr>
467
+ <td>
468
+ <pre class="lines">
469
+
470
+
471
+ 8
472
+ 9
473
+ 10</pre>
474
+ </td>
475
+ <td>
476
+ <pre class="code"><span class="info file"># File 'lib/smart_diff.rb', line 8</span>
477
+
478
+ <span class='kw'>def</span> <span class='id identifier rubyid_code_one'>code_one</span>
479
+ <span class='ivar'>@code_one</span>
480
+ <span class='kw'>end</span></pre>
481
+ </td>
482
+ </tr>
483
+ </table>
484
+ </div>
485
+
486
+
487
+ <span id="code_two=-instance_method"></span>
488
+ <div class="method_details ">
489
+ <h3 class="signature " id="code_two-instance_method">
490
+
491
+ - (<tt>Object</tt>) <strong>code_two</strong>
492
+
493
+
494
+
495
+
496
+
497
+ </h3><div class="docstring">
498
+ <div class="discussion">
499
+
500
+ <p>Returns the value of attribute code_two</p>
501
+
502
+
503
+ </div>
504
+ </div>
505
+ <div class="tags">
506
+
507
+
508
+ </div><table class="source_code">
509
+ <tr>
510
+ <td>
511
+ <pre class="lines">
512
+
513
+
514
+ 8
515
+ 9
516
+ 10</pre>
517
+ </td>
518
+ <td>
519
+ <pre class="code"><span class="info file"># File 'lib/smart_diff.rb', line 8</span>
520
+
521
+ <span class='kw'>def</span> <span class='id identifier rubyid_code_two'>code_two</span>
522
+ <span class='ivar'>@code_two</span>
523
+ <span class='kw'>end</span></pre>
524
+ </td>
525
+ </tr>
526
+ </table>
527
+ </div>
528
+
529
+
530
+ <span id="file_one=-instance_method"></span>
531
+ <div class="method_details ">
532
+ <h3 class="signature " id="file_one-instance_method">
533
+
534
+ - (<tt>Object</tt>) <strong>file_one</strong>
535
+
536
+
537
+
538
+
539
+
540
+ </h3><div class="docstring">
541
+ <div class="discussion">
542
+
543
+ <p>Returns the value of attribute file_one</p>
544
+
545
+
546
+ </div>
547
+ </div>
548
+ <div class="tags">
549
+
550
+
551
+ </div><table class="source_code">
552
+ <tr>
553
+ <td>
554
+ <pre class="lines">
555
+
556
+
557
+ 8
558
+ 9
559
+ 10</pre>
560
+ </td>
561
+ <td>
562
+ <pre class="code"><span class="info file"># File 'lib/smart_diff.rb', line 8</span>
563
+
564
+ <span class='kw'>def</span> <span class='id identifier rubyid_file_one'>file_one</span>
565
+ <span class='ivar'>@file_one</span>
566
+ <span class='kw'>end</span></pre>
567
+ </td>
568
+ </tr>
569
+ </table>
570
+ </div>
571
+
572
+
573
+ <span id="file_two=-instance_method"></span>
574
+ <div class="method_details ">
575
+ <h3 class="signature " id="file_two-instance_method">
576
+
577
+ - (<tt>Object</tt>) <strong>file_two</strong>
578
+
579
+
580
+
581
+
582
+
583
+ </h3><div class="docstring">
584
+ <div class="discussion">
585
+
586
+ <p>Returns the value of attribute file_two</p>
587
+
588
+
589
+ </div>
590
+ </div>
591
+ <div class="tags">
592
+
593
+
594
+ </div><table class="source_code">
595
+ <tr>
596
+ <td>
597
+ <pre class="lines">
598
+
599
+
600
+ 8
601
+ 9
602
+ 10</pre>
603
+ </td>
604
+ <td>
605
+ <pre class="code"><span class="info file"># File 'lib/smart_diff.rb', line 8</span>
606
+
607
+ <span class='kw'>def</span> <span class='id identifier rubyid_file_two'>file_two</span>
608
+ <span class='ivar'>@file_two</span>
609
+ <span class='kw'>end</span></pre>
610
+ </td>
611
+ </tr>
612
+ </table>
613
+ </div>
614
+
615
+
616
+ <span id="node_diff=-instance_method"></span>
617
+ <div class="method_details ">
618
+ <h3 class="signature " id="node_diff-instance_method">
619
+
620
+ - (<tt>Object</tt>) <strong>node_diff</strong>
621
+
622
+
623
+
624
+
625
+
626
+ </h3><div class="docstring">
627
+ <div class="discussion">
628
+
629
+ <p>Returns the value of attribute node_diff</p>
630
+
631
+
632
+ </div>
633
+ </div>
634
+ <div class="tags">
635
+
636
+
637
+ </div><table class="source_code">
638
+ <tr>
639
+ <td>
640
+ <pre class="lines">
641
+
642
+
643
+ 8
644
+ 9
645
+ 10</pre>
646
+ </td>
647
+ <td>
648
+ <pre class="code"><span class="info file"># File 'lib/smart_diff.rb', line 8</span>
649
+
650
+ <span class='kw'>def</span> <span class='id identifier rubyid_node_diff'>node_diff</span>
651
+ <span class='ivar'>@node_diff</span>
652
+ <span class='kw'>end</span></pre>
653
+ </td>
654
+ </tr>
655
+ </table>
656
+ </div>
657
+
658
+ </div>
659
+
660
+
661
+ <div id="instance_method_details" class="method_details_list">
662
+ <h2>Instance Method Details</h2>
663
+
664
+
665
+ <div class="method_details first">
666
+ <h3 class="signature first" id="diff-instance_method">
667
+
668
+ - (<tt>Object</tt>) <strong>diff</strong>
669
+
670
+
671
+
672
+
673
+
674
+ </h3><table class="source_code">
675
+ <tr>
676
+ <td>
677
+ <pre class="lines">
678
+
679
+
680
+ 38
681
+ 39
682
+ 40
683
+ 41
684
+ 42
685
+ 43
686
+ 44
687
+ 45
688
+ 46
689
+ 47</pre>
690
+ </td>
691
+ <td>
692
+ <pre class="code"><span class="info file"># File 'lib/smart_diff.rb', line 38</span>
693
+
694
+ <span class='kw'>def</span> <span class='id identifier rubyid_diff'>diff</span><span class='lparen'>(</span><span class='rparen'>)</span>
695
+ <span class='ivar'>@code_one</span> <span class='op'>=</span> <span class='id identifier rubyid_read'>read</span><span class='lparen'>(</span><span class='ivar'>@file_one</span><span class='rparen'>)</span>
696
+ <span class='ivar'>@code_two</span> <span class='op'>=</span> <span class='id identifier rubyid_read'>read</span><span class='lparen'>(</span><span class='ivar'>@file_two</span><span class='rparen'>)</span>
697
+ <span class='kw'>if</span> <span class='ivar'>@code_one</span> <span class='op'>&amp;&amp;</span> <span class='ivar'>@code_two</span>
698
+ <span class='id identifier rubyid_nodeA'>nodeA</span> <span class='op'>=</span> <span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='ivar'>@code_one</span><span class='comma'>,</span> <span class='ivar'>@file_one</span><span class='rparen'>)</span>
699
+ <span class='id identifier rubyid_nodeB'>nodeB</span> <span class='op'>=</span> <span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='ivar'>@code_two</span><span class='comma'>,</span> <span class='ivar'>@file_two</span><span class='rparen'>)</span>
700
+ <span class='id identifier rubyid_nd'>nd</span> <span class='op'>=</span> <span class='id identifier rubyid_org'>org</span><span class='period'>.</span><span class='id identifier rubyid_jrubyparser'>jrubyparser</span><span class='period'>.</span><span class='id identifier rubyid_util'>util</span><span class='period'>.</span><span class='id identifier rubyid_diff'>diff</span><span class='period'>.</span><span class='const'>NodeDiff</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_nodeA'>nodeA</span><span class='comma'>,</span> <span class='ivar'>@code_one</span><span class='comma'>,</span> <span class='id identifier rubyid_nodeB'>nodeB</span><span class='comma'>,</span> <span class='ivar'>@code_two</span><span class='rparen'>)</span>
701
+ <span class='id identifier rubyid_nd'>nd</span><span class='period'>.</span><span class='id identifier rubyid_deep_diff'>deep_diff</span>
702
+ <span class='kw'>end</span>
703
+ <span class='kw'>end</span></pre>
704
+ </td>
705
+ </tr>
706
+ </table>
707
+ </div>
708
+
709
+ <div class="method_details ">
710
+ <h3 class="signature " id="parse-instance_method">
711
+
712
+ - (<tt>Object</tt>) <strong>parse</strong>(code_to_parse, file_name)
713
+
714
+
715
+
716
+
717
+
718
+ </h3><table class="source_code">
719
+ <tr>
720
+ <td>
721
+ <pre class="lines">
722
+
723
+
724
+ 34
725
+ 35
726
+ 36</pre>
727
+ </td>
728
+ <td>
729
+ <pre class="code"><span class="info file"># File 'lib/smart_diff.rb', line 34</span>
730
+
731
+ <span class='kw'>def</span> <span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_code_to_parse'>code_to_parse</span><span class='comma'>,</span> <span class='id identifier rubyid_file_name'>file_name</span><span class='rparen'>)</span>
732
+ <span class='const'>JRubyParser</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_code_to_parse'>code_to_parse</span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='symbol'>:filename</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_file_name'>file_name</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
733
+ <span class='kw'>end</span></pre>
734
+ </td>
735
+ </tr>
736
+ </table>
737
+ </div>
738
+
739
+ <div class="method_details ">
740
+ <h3 class="signature " id="read-instance_method">
741
+
742
+ - (<tt>Object</tt>) <strong>read</strong>(file_name)
743
+
744
+
745
+
746
+
747
+
748
+ </h3><table class="source_code">
749
+ <tr>
750
+ <td>
751
+ <pre class="lines">
752
+
753
+
754
+ 25
755
+ 26
756
+ 27
757
+ 28
758
+ 29
759
+ 30
760
+ 31
761
+ 32</pre>
762
+ </td>
763
+ <td>
764
+ <pre class="code"><span class="info file"># File 'lib/smart_diff.rb', line 25</span>
765
+
766
+ <span class='kw'>def</span> <span class='id identifier rubyid_read'>read</span><span class='lparen'>(</span><span class='id identifier rubyid_file_name'>file_name</span><span class='rparen'>)</span>
767
+ <span class='id identifier rubyid_path'>path</span> <span class='op'>=</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_file_name'>file_name</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span>
768
+ <span class='kw'>if</span> <span class='id identifier rubyid_path'>path</span><span class='period'>.</span><span class='id identifier rubyid_exist?'>exist?</span>
769
+ <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span> <span class='id identifier rubyid_path'>path</span>
770
+ <span class='kw'>else</span>
771
+ <span class='id identifier rubyid_raise'>raise</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'> not found. Check the path.</span><span class='tstring_end'>&quot;</span></span>
772
+ <span class='kw'>end</span>
773
+ <span class='kw'>end</span></pre>
774
+ </td>
775
+ </tr>
776
+ </table>
777
+ </div>
778
+
779
+ </div>
780
+
781
+ </div>
782
+
783
+ <div id="footer">
784
+ Generated on Fri Sep 13 17:10:49 2013 by
785
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
786
+ 0.8.6.1 (ruby-2.0.0).
787
+ </div>
788
+
789
+ </body>
790
+ </html>