Sha256: c38c68707f87671a9aae528ecc886b1751fedfe8d1cf8ed09b83ff404fb99359
Contents?: true
Size: 806 Bytes
Versions: 19
Compression:
Stored size: 806 Bytes
Contents
module Pronto module Git Patch = Struct.new(:patch, :repo) do extend Forwardable def_delegators :patch, :delta, :hunks, :stat def additions stat[0] end def deletions stat[1] end def blame(lineno) repo.blame(new_file_path, lineno) end def lines @lines ||= begin hunks.flat_map do |hunk| hunk.lines.map { |line| Line.new(line, self, hunk) } end end end def added_lines lines.select(&:addition?) end def deleted_lines lines.select(&:deletion?) end def new_file_full_path repo.path.join(new_file_path) end private def new_file_path delta.new_file[:path] end end end end
Version data entries
19 entries across 19 versions & 1 rubygems