vendor/gems/diff-lcs-1.1.2/lib/diff/lcs/hunk.rb
def ed_diff(format)
    op_act = { "+" => 'a', "-" => 'd', "!" => "c" }
    warn "Expecting only one block in an old diff hunk!" if @blocks.size > 1

    if format == :reverse_ed
      s = "#{op_act[@blocks[0].op]}#{context_range(:old)}\n"
    else
      s = "#{context_range(:old).gsub(/,/, ' ')}#{op_act[@blocks[0].op]}\n"
    end

    unless @blocks[0].insert.empty?
      @data_new[@start_new .. @end_new].each { |e| s << "#{e}\n" }
      s << ".\n"
    end
    s
  end
# Create a hunk using references to both the old and new data, as well as
# the piece of data
Create a hunk using references to both the old and new data, as well as
the piece of data
Create a hunk using references to both the old and new data as well as the piece of data
def ed_diff(format)
    op_act = { "+" => 'a', "-" => 'd', "!" => "c" }
    warn "Expecting only one block in an old diff hunk!" if @blocks.size > 1
    if format == :reverse_ed
      s = "#{op_act[@blocks[0].op]}#{context_range(:old)}\n"
    else
      s = "#{context_range(:old).gsub(/,/, ' ')}#{op_act[@blocks[0].op]}\n"
    end
    unless @blocks[0].insert.empty?
      @data_new[@start_new .. @end_new].each { |e| s << "#{e}\n" }
      s << ".\n"
    end
    s
  end
def ed_diff ( format ) op_act = { "+" => 'a' , "-" => 'd' , "!" => "c" } warn "Expecting only one block in an old diff hunk!" if @blocks . size > 1 if format == :reverse_ed s = "#{op_act[@blocks[0].op]}#{context_range(:old)}\n" else s = "#{context_range(:old).gsub(/,/, ' ')}#{op_act[@blocks[0].op]}\n" end unless @blocks [ 0 ] . insert . empty? @data_new [ @start_new .. @end_new ] . each { | e | s << "#{e}\n" } s << ".\n" end s end
Create a hunk using references to both the old and new data, as well as
the piece of data
Create a hunk using references to both the old and new data as well as the piece of data
format