smart_diff 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/doc/Utils.html CHANGED
@@ -106,7 +106,7 @@
106
106
  <li class="public ">
107
107
  <span class="summary_signature">
108
108
 
109
- <a href="#get_install_path-class_method" title="get_install_path (class method)">+ (Object) <strong>get_install_path</strong> </a>
109
+ <a href="#get_install_path-class_method" title="get_install_path (class method)">+ (Pathname) <strong>get_install_path</strong> </a>
110
110
 
111
111
 
112
112
 
@@ -120,7 +120,9 @@
120
120
 
121
121
 
122
122
 
123
- <span class="summary_desc"><div class='inline'></div></span>
123
+ <span class="summary_desc"><div class='inline'>
124
+ <p>Where in the file-system is smart_diff installed?.</p>
125
+ </div></span>
124
126
 
125
127
  </li>
126
128
 
@@ -128,7 +130,7 @@
128
130
  <li class="public ">
129
131
  <span class="summary_signature">
130
132
 
131
- <a href="#inside_anchor%3F-class_method" title="inside_anchor? (class method)">+ (Boolean) <strong>inside_anchor?</strong>(tags, nd_start, nd_end) </a>
133
+ <a href="#inside_anchor%3F-class_method" title="inside_anchor? (class method)">+ (TrueClass, FalseClass) <strong>inside_anchor?</strong>(tags, nd_start, nd_end) </a>
132
134
 
133
135
 
134
136
 
@@ -142,7 +144,10 @@
142
144
 
143
145
 
144
146
 
145
- <span class="summary_desc"><div class='inline'></div></span>
147
+ <span class="summary_desc"><div class='inline'>
148
+ <p>Determines if the node beginning with nd_start and ending with nd_end falls
149
+ inside an anchor.</p>
150
+ </div></span>
146
151
 
147
152
  </li>
148
153
 
@@ -150,7 +155,7 @@
150
155
  <li class="public ">
151
156
  <span class="summary_signature">
152
157
 
153
- <a href="#node_end-class_method" title="node_end (class method)">+ (Object) <strong>node_end</strong>(node) </a>
158
+ <a href="#node_end-class_method" title="node_end (class method)">+ (Fixnum) <strong>node_end</strong>(node) </a>
154
159
 
155
160
 
156
161
 
@@ -164,7 +169,9 @@
164
169
 
165
170
 
166
171
 
167
- <span class="summary_desc"><div class='inline'></div></span>
172
+ <span class="summary_desc"><div class='inline'>
173
+ <p>Get a node&#39;s end position.</p>
174
+ </div></span>
168
175
 
169
176
  </li>
170
177
 
@@ -172,7 +179,7 @@
172
179
  <li class="public ">
173
180
  <span class="summary_signature">
174
181
 
175
- <a href="#node_start-class_method" title="node_start (class method)">+ (Object) <strong>node_start</strong>(node) </a>
182
+ <a href="#node_start-class_method" title="node_start (class method)">+ (Fixnum) <strong>node_start</strong>(node) </a>
176
183
 
177
184
 
178
185
 
@@ -186,7 +193,9 @@
186
193
 
187
194
 
188
195
 
189
- <span class="summary_desc"><div class='inline'></div></span>
196
+ <span class="summary_desc"><div class='inline'>
197
+ <p>Get a node&#39;s start position,.</p>
198
+ </div></span>
190
199
 
191
200
  </li>
192
201
 
@@ -203,26 +212,55 @@
203
212
  <div class="method_details first">
204
213
  <h3 class="signature first" id="get_install_path-class_method">
205
214
 
206
- + (<tt>Object</tt>) <strong>get_install_path</strong>
215
+ + (<tt>Pathname</tt>) <strong>get_install_path</strong>
207
216
 
208
217
 
209
218
 
210
219
 
211
220
 
212
- </h3><table class="source_code">
221
+ </h3><div class="docstring">
222
+ <div class="discussion">
223
+
224
+ <p>Where in the file-system is smart_diff installed?</p>
225
+
226
+
227
+ </div>
228
+ </div>
229
+ <div class="tags">
230
+
231
+ <p class="tag_title">Returns:</p>
232
+ <ul class="return">
233
+
234
+ <li>
235
+
236
+
237
+ <span class='type'>(<tt>Pathname</tt>)</span>
238
+
239
+
240
+
241
+ &mdash;
242
+ <div class='inline'>
243
+ <p>the path to the installation of smart_diff</p>
244
+ </div>
245
+
246
+ </li>
247
+
248
+ </ul>
249
+
250
+ </div><table class="source_code">
213
251
  <tr>
214
252
  <td>
215
253
  <pre class="lines">
216
254
 
217
255
 
218
- 6
219
- 7
220
- 8
221
- 9
222
- 10</pre>
256
+ 11
257
+ 12
258
+ 13
259
+ 14
260
+ 15</pre>
223
261
  </td>
224
262
  <td>
225
- <pre class="code"><span class="info file"># File 'lib/smart_diff/utils.rb', line 6</span>
263
+ <pre class="code"><span class="info file"># File 'lib/smart_diff/utils.rb', line 11</span>
226
264
 
227
265
  <span class='kw'>def</span> <span class='id identifier rubyid_get_install_path'>get_install_path</span>
228
266
  <span class='id identifier rubyid_utils_path'>utils_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='kw'>__FILE__</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_dirname'>dirname</span>
@@ -237,7 +275,7 @@
237
275
  <div class="method_details ">
238
276
  <h3 class="signature " id="inside_anchor?-class_method">
239
277
 
240
- + (<tt>Boolean</tt>) <strong>inside_anchor?</strong>(tags, nd_start, nd_end)
278
+ + (<tt>TrueClass</tt>, <tt>FalseClass</tt>) <strong>inside_anchor?</strong>(tags, nd_start, nd_end)
241
279
 
242
280
 
243
281
 
@@ -246,20 +284,91 @@
246
284
  </h3><div class="docstring">
247
285
  <div class="discussion">
248
286
 
287
+ <p>Determines if the node beginning with nd_start and ending with nd_end falls
288
+ inside an anchor. In other words, is the current node inside another node
289
+ <em>which also changed</em> and has a match in the other file. (If it is an
290
+ insertion or deletion it gets wrapped in a span so we aren&#39;t concerned
291
+ with those.)</p>
292
+
293
+ <p>In a pair of tags, the opening tag only has some of the position
294
+ information, so they are marked with a meaningless -1. But the closing tags
295
+ have the information needed- start and end offsets.</p>
296
+
297
+ <p>Subnodes were added to the array after the outer nodes, so we check them
298
+ here, once, against each tag, and decide how to process them as we generate
299
+ the HTML.</p>
300
+
249
301
 
250
302
  </div>
251
303
  </div>
252
304
  <div class="tags">
305
+ <p class="tag_title">Parameters:</p>
306
+ <ul class="param">
253
307
 
308
+ <li>
309
+
310
+ <span class='name'>tags</span>
311
+
312
+
313
+ <span class='type'>(<tt>Array</tt>)</span>
314
+
315
+
316
+
317
+ &mdash;
318
+ <div class='inline'>
319
+ <p>A list of all tags so far recorded.</p>
320
+ </div>
321
+
322
+ </li>
323
+
324
+ <li>
325
+
326
+ <span class='name'>nd_start</span>
327
+
328
+
329
+ <span class='type'>(<tt>Fixnum</tt>)</span>
330
+
331
+
332
+
333
+ &mdash;
334
+ <div class='inline'>
335
+ <p>Number representing the node&#39;s starting position.</p>
336
+ </div>
337
+
338
+ </li>
339
+
340
+ <li>
341
+
342
+ <span class='name'>nd_end</span>
343
+
344
+
345
+ <span class='type'>(<tt>Fixnum</tt>)</span>
346
+
347
+
348
+
349
+ &mdash;
350
+ <div class='inline'>
351
+ <p>Number representing the node&#39;s ending position.</p>
352
+ </div>
353
+
354
+ </li>
355
+
356
+ </ul>
357
+
254
358
  <p class="tag_title">Returns:</p>
255
359
  <ul class="return">
256
360
 
257
361
  <li>
258
362
 
259
363
 
260
- <span class='type'>(<tt>Boolean</tt>)</span>
364
+ <span class='type'>(<tt>TrueClass</tt>, <tt>FalseClass</tt>)</span>
365
+
261
366
 
262
367
 
368
+ &mdash;
369
+ <div class='inline'>
370
+ <p>Is it inside an anchor?</p>
371
+ </div>
263
372
 
264
373
  </li>
265
374
 
@@ -271,17 +380,17 @@
271
380
  <pre class="lines">
272
381
 
273
382
 
274
- 20
275
- 21
276
- 22
277
- 23
278
- 24
279
- 25
280
- 26
281
- 27</pre>
383
+ 60
384
+ 61
385
+ 62
386
+ 63
387
+ 64
388
+ 65
389
+ 66
390
+ 67</pre>
282
391
  </td>
283
392
  <td>
284
- <pre class="code"><span class="info file"># File 'lib/smart_diff/utils.rb', line 20</span>
393
+ <pre class="code"><span class="info file"># File 'lib/smart_diff/utils.rb', line 60</span>
285
394
 
286
395
  <span class='kw'>def</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>
287
396
  <span class='id identifier rubyid_tags'>tags</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_t'>t</span><span class='op'>|</span>
@@ -299,24 +408,73 @@
299
408
  <div class="method_details ">
300
409
  <h3 class="signature " id="node_end-class_method">
301
410
 
302
- + (<tt>Object</tt>) <strong>node_end</strong>(node)
411
+ + (<tt>Fixnum</tt>) <strong>node_end</strong>(node)
303
412
 
304
413
 
305
414
 
306
415
 
307
416
 
308
- </h3><table class="source_code">
417
+ </h3><div class="docstring">
418
+ <div class="discussion">
419
+
420
+ <p>Get a node&#39;s end position.</p>
421
+
422
+
423
+ </div>
424
+ </div>
425
+ <div class="tags">
426
+ <p class="tag_title">Parameters:</p>
427
+ <ul class="param">
428
+
429
+ <li>
430
+
431
+ <span class='name'>node</span>
432
+
433
+
434
+ <span class='type'>(<tt>org.jrubyparser.Node</tt>)</span>
435
+
436
+
437
+
438
+ &mdash;
439
+ <div class='inline'>
440
+ <p>a node in an abstract syntax tree</p>
441
+ </div>
442
+
443
+ </li>
444
+
445
+ </ul>
446
+
447
+ <p class="tag_title">Returns:</p>
448
+ <ul class="return">
449
+
450
+ <li>
451
+
452
+
453
+ <span class='type'>(<tt>Fixnum</tt>)</span>
454
+
455
+
456
+
457
+ &mdash;
458
+ <div class='inline'>
459
+ <p>Number representing the node&#39;s end offset.</p>
460
+ </div>
461
+
462
+ </li>
463
+
464
+ </ul>
465
+
466
+ </div><table class="source_code">
309
467
  <tr>
310
468
  <td>
311
469
  <pre class="lines">
312
470
 
313
471
 
314
- 16
315
- 17
316
- 18</pre>
472
+ 35
473
+ 36
474
+ 37</pre>
317
475
  </td>
318
476
  <td>
319
- <pre class="code"><span class="info file"># File 'lib/smart_diff/utils.rb', line 16</span>
477
+ <pre class="code"><span class="info file"># File 'lib/smart_diff/utils.rb', line 35</span>
320
478
 
321
479
  <span class='kw'>def</span> <span class='id identifier rubyid_node_end'>node_end</span><span class='lparen'>(</span><span class='id identifier rubyid_node'>node</span><span class='rparen'>)</span>
322
480
  <span class='id identifier rubyid_node'>node</span><span class='period'>.</span><span class='id identifier rubyid_position'>position</span><span class='period'>.</span><span class='id identifier rubyid_end_offset'>end_offset</span>
@@ -329,24 +487,73 @@
329
487
  <div class="method_details ">
330
488
  <h3 class="signature " id="node_start-class_method">
331
489
 
332
- + (<tt>Object</tt>) <strong>node_start</strong>(node)
490
+ + (<tt>Fixnum</tt>) <strong>node_start</strong>(node)
333
491
 
334
492
 
335
493
 
336
494
 
337
495
 
338
- </h3><table class="source_code">
496
+ </h3><div class="docstring">
497
+ <div class="discussion">
498
+
499
+ <p>Get a node&#39;s start position,</p>
500
+
501
+
502
+ </div>
503
+ </div>
504
+ <div class="tags">
505
+ <p class="tag_title">Parameters:</p>
506
+ <ul class="param">
507
+
508
+ <li>
509
+
510
+ <span class='name'>node</span>
511
+
512
+
513
+ <span class='type'>(<tt>org.jrubyparser.Node</tt>)</span>
514
+
515
+
516
+
517
+ &mdash;
518
+ <div class='inline'>
519
+ <p>a node in an abstract syntax tree</p>
520
+ </div>
521
+
522
+ </li>
523
+
524
+ </ul>
525
+
526
+ <p class="tag_title">Returns:</p>
527
+ <ul class="return">
528
+
529
+ <li>
530
+
531
+
532
+ <span class='type'>(<tt>Fixnum</tt>)</span>
533
+
534
+
535
+
536
+ &mdash;
537
+ <div class='inline'>
538
+ <p>Number representing the node&#39;s start offset.</p>
539
+ </div>
540
+
541
+ </li>
542
+
543
+ </ul>
544
+
545
+ </div><table class="source_code">
339
546
  <tr>
340
547
  <td>
341
548
  <pre class="lines">
342
549
 
343
550
 
344
- 12
345
- 13
346
- 14</pre>
551
+ 24
552
+ 25
553
+ 26</pre>
347
554
  </td>
348
555
  <td>
349
- <pre class="code"><span class="info file"># File 'lib/smart_diff/utils.rb', line 12</span>
556
+ <pre class="code"><span class="info file"># File 'lib/smart_diff/utils.rb', line 24</span>
350
557
 
351
558
  <span class='kw'>def</span> <span class='id identifier rubyid_node_start'>node_start</span><span class='lparen'>(</span><span class='id identifier rubyid_node'>node</span><span class='rparen'>)</span>
352
559
  <span class='id identifier rubyid_node'>node</span><span class='period'>.</span><span class='id identifier rubyid_position'>position</span><span class='period'>.</span><span class='id identifier rubyid_start_offset'>start_offset</span>
@@ -361,7 +568,7 @@
361
568
  </div>
362
569
 
363
570
  <div id="footer">
364
- Generated on Fri Sep 13 17:10:49 2013 by
571
+ Generated on Mon Sep 16 03:40:00 2013 by
365
572
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
366
573
  0.8.6.1 (ruby-2.0.0).
367
574
  </div>
data/doc/_index.html CHANGED
@@ -140,7 +140,7 @@
140
140
  </div>
141
141
 
142
142
  <div id="footer">
143
- Generated on Fri Sep 13 17:10:37 2013 by
143
+ Generated on Mon Sep 16 03:39:58 2013 by
144
144
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
145
145
  0.8.6.1 (ruby-2.0.0).
146
146
  </div>
data/doc/file.README.html CHANGED
@@ -84,19 +84,24 @@ rather than comparing the text directly).</p>
84
84
 
85
85
  <p>This application should especially serve as an example of using the
86
86
  subdiff&#39;s produced by NodeDiff to improve the quality of the output.
87
- See <code>bin/smart_diff</code> .</p>
87
+ See <code>bin/smart_diff</code> or <a
88
+ href="http://rubydoc.info/gems/smart_diff/0.0.1/frames">check out the
89
+ docs</a>.</p>
90
+
91
+ <h2 id="label-Install">Install</h2>
92
+
93
+ <pre class="code ruby"><code class="ruby">$ jruby -S gem install smart_diff</code></pre>
88
94
 
89
95
  <h2 id="label-Usage">Usage</h2>
90
96
 
91
- <p>To run this, you&#39;ll need to have <code>JRuby</code> and the
92
- <code>jruby-parser</code> gem installed. Then run
93
- <code>bin/smart_diff</code> along with the paths to two versions of a ruby
97
+ <p>Run <code>smart_diff</code> along with the paths to two versions of a ruby
94
98
  source file.</p>
95
99
 
96
- <pre class="code ruby"><code class="ruby">bin/smart_diff example/bar.rb example/foo.rb</code></pre>
100
+ <pre class="code ruby"><code class="ruby">smart_diff example/bar.rb example/foo.rb</code></pre>
97
101
 
98
- <p>This will output an html file you can open in your browser. Check out
99
- <code>foo.rb-bar.rb.html</code> for a sample of the output.</p>
102
+ <p>This will output an html file you can open in your browser. Check out <a
103
+ href="http://edubkendo.github.io/smart_diff/file.Example.html">Example.html</a>
104
+ for a sample of the output.</p>
100
105
 
101
106
  <p>LICENSE</p>
102
107
 
@@ -118,7 +123,7 @@ href="http://www.gnu.org/licenses">www.gnu.org/licenses</a>/.</p>
118
123
  </div></div>
119
124
 
120
125
  <div id="footer">
121
- Generated on Fri Sep 13 17:10:44 2013 by
126
+ Generated on Mon Sep 16 03:40:00 2013 by
122
127
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
123
128
  0.8.6.1 (ruby-2.0.0).
124
129
  </div>
data/doc/index.html CHANGED
@@ -84,19 +84,24 @@ rather than comparing the text directly).</p>
84
84
 
85
85
  <p>This application should especially serve as an example of using the
86
86
  subdiff&#39;s produced by NodeDiff to improve the quality of the output.
87
- See <code>bin/smart_diff</code> .</p>
87
+ See <code>bin/smart_diff</code> or <a
88
+ href="http://rubydoc.info/gems/smart_diff/0.0.1/frames">check out the
89
+ docs</a>.</p>
90
+
91
+ <h2 id="label-Install">Install</h2>
92
+
93
+ <pre class="code ruby"><code class="ruby">$ jruby -S gem install smart_diff</code></pre>
88
94
 
89
95
  <h2 id="label-Usage">Usage</h2>
90
96
 
91
- <p>To run this, you&#39;ll need to have <code>JRuby</code> and the
92
- <code>jruby-parser</code> gem installed. Then run
93
- <code>bin/smart_diff</code> along with the paths to two versions of a ruby
97
+ <p>Run <code>smart_diff</code> along with the paths to two versions of a ruby
94
98
  source file.</p>
95
99
 
96
- <pre class="code ruby"><code class="ruby">bin/smart_diff example/bar.rb example/foo.rb</code></pre>
100
+ <pre class="code ruby"><code class="ruby">smart_diff example/bar.rb example/foo.rb</code></pre>
97
101
 
98
- <p>This will output an html file you can open in your browser. Check out
99
- <code>foo.rb-bar.rb.html</code> for a sample of the output.</p>
102
+ <p>This will output an html file you can open in your browser. Check out <a
103
+ href="http://edubkendo.github.io/smart_diff/file.Example.html">Example.html</a>
104
+ for a sample of the output.</p>
100
105
 
101
106
  <p>LICENSE</p>
102
107
 
@@ -118,7 +123,7 @@ href="http://www.gnu.org/licenses">www.gnu.org/licenses</a>/.</p>
118
123
  </div></div>
119
124
 
120
125
  <div id="footer">
121
- Generated on Fri Sep 13 17:10:44 2013 by
126
+ Generated on Mon Sep 16 03:39:59 2013 by
122
127
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
123
128
  0.8.6.1 (ruby-2.0.0).
124
129
  </div>
@@ -105,7 +105,7 @@
105
105
  </div>
106
106
 
107
107
  <div id="footer">
108
- Generated on Fri Sep 13 17:10:49 2013 by
108
+ Generated on Mon Sep 16 03:40:00 2013 by
109
109
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
110
110
  0.8.6.1 (ruby-2.0.0).
111
111
  </div>
@@ -6,7 +6,7 @@
6
6
 
7
7
  <style>
8
8
 
9
- .d { /* deleted */
9
+ .d { /* deleted */
10
10
  border: solid 1px #CC929A;
11
11
  border-radius: 3px;
12
12
  background-color: #FCBFBA;
@@ -103,7 +103,7 @@ p {
103
103
  -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5);
104
104
  }
105
105
 
106
-
106
+
107
107
  </style>
108
108
 
109
109
  <script type="text/javascript">
@@ -384,7 +384,7 @@ window.onload =
384
384
 
385
385
  }
386
386
 
387
-
387
+
388
388
  </script>
389
389
 
390
390
  </head>