class GitDiffParser::Patch

Overview

Parsed patch

Defined in:

git_diff_parser/patch.cr

Constant Summary

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

Instance Method Summary

Constructor Detail

def self.new(body, options = {} of String => String | Int32) #

[View source]

Instance Method Detail

def all_lines #

[View source]
def body : String #

[View source]
def body=(body : String) #

[View source]
def changed_line_numbers #

@return [Array] changed line numbers


[View source]
def changed_lines #

@return [Array] changed lines


[View source]
def collapsible? #

[View source]
def file : Int32 | String #

[View source]
def file=(file : Int32 | String) #

[View source]
def find_line_by_line_number(line_number) #

@param line_number [Integer] line number

@return [Integer, nil] patch position


[View source]
def find_removed_line_by_line_number(line_number) #

@param line_number [Integer] line number

@return [Integer, nil] patch position


[View source]
def removed_line_numbers #

@return [Array] removed line numbers


[View source]
def removed_lines #

@return [Array] removed lines


[View source]
def secure_hash : Int32 | String #

[View source]
def secure_hash=(secure_hash : Int32 | String) #

[View source]
def too_large? #

[View source]