class ChefCLI::Policyfile::Differ
def diff_lines(old_lines, new_lines)
def diff_lines(old_lines, new_lines) file_length_difference = INITIAL_FILE_LENGTH_DIFFERENCE previous_hunk = nil diffs = Diff::LCS.diff(old_lines, new_lines) ui.print("\n") diffs.each do |piece| hunk = Diff::LCS::Hunk.new(old_lines, new_lines, piece, LINES_OF_CONTEXT, file_length_difference) file_length_difference = hunk.file_length_difference maybe_contiguous_hunks = (previous_hunk.nil? || hunk.merge(previous_hunk)) unless maybe_contiguous_hunks print_color_diff("#{previous_hunk.diff(FORMAT)}\n") end previous_hunk = hunk end print_color_diff("#{previous_hunk.diff(FORMAT)}\n") unless previous_hunk.nil? ui.print("\n") end