class

GitDiffParser::Patch

Inherits Reference < Object

Parsed patch

Constants

DIFF_COLLAPSE_LIMIT = 10240

The maximum size before a diff is collapsed.

DIFF_SIZE_LIMIT = 102400

The maximum size of a diff to display.

MODIFIED_LINE = /^\+(?!\+|\+)/
NOT_MOD_REM_LINE = /^[^-+]/
NOT_REMOVED_LINE = /^[^-]/
RANGE_ADD_INFORMATION_LINE = /^@@ .+\+(?<line_number>\d+)/
RANGE_DEL_INFORMATION_LINE = /^@@ \-(?<line_number>\d+)/
REMOVED_LINE = /^[-]/

Constructors

new(body, options = {} of String => String | Int32)
Source

Instance methods

all_lines
Source
body
Source
body=(body : String)
Source
changed_line_numbers

@return [Array<Integer>] changed line numbers

Source
changed_lines

@return [Array<Line>] changed lines

Source
collapsible?
Source
file
Source
file=(file : Int32 | String)
Source
find_line_by_line_number(line_number)

@param line_number [Integer] line number

@return [Integer, nil] patch position

Source
find_removed_line_by_line_number(line_number)

@param line_number [Integer] line number

@return [Integer, nil] patch position

Source
removed_line_numbers

@return [Array<Integer>] removed line numbers

Source
removed_lines

@return [Array<Line>] removed lines

Source
secure_hash
Source
secure_hash=(secure_hash : Int32 | String)
Source
too_large?
Source