Class Diff::LCS::Hunk
In: lib/diff/lcs/hunk.rb
Parent: Object

A Hunk is a group of Blocks which overlap because of the context surrounding each block. (So if we‘re not using context, every hunk will contain one block.) Used in the diff program (bin/diff).

Methods

diff   each_old   new   overlaps?   unshift  

Attributes

blocks  [R] 
end_new  [R] 
end_old  [R] 
file_length_difference  [R] 
flag_context  [RW]  Change the "start" and "end" fields to note that context should be added to this hunk
start_new  [R] 
start_old  [R] 

Public Class methods

Create a hunk using references to both the old and new data, as well as the piece of data

Public Instance methods

Is there an overlap between hunk arg0 and old hunk arg1? Note: if end of old hunk is one less than beginning of second, they overlap

[Validate]