Sha256: de46dbb60022b6af1d294d0140b531853883a1bbd81986a9c339987fbd77edd1
Contents?: true
Size: 786 Bytes
Versions: 1
Compression:
Stored size: 786 Bytes
Contents
# frozen_string_literal: true require "forwardable" module GitDiff class Hunk attr_reader :lines, :range_info def initialize(range_info) @range_info = range_info @lines = [] end def <<(string) Line.from_string(string).tap do |line| line_number_calculation.increment(line) lines << line end end def stats @stats ||= Stats.total(collector) end private def collector GitDiff::StatsCollector::Hunk.new(self) end def initial_line_number @initial_line_number ||= LineNumber.new(range_info.original_range.start, range_info.new_range.start) end def line_number_calculation @line_number_calculation ||= LineNumberCalculation.new(initial_line_number) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
git_diff-0.4.3 | lib/git_diff/hunk.rb |