Class: Linguist::Source::Diff::Delta

Inherits:
Object
  • Object
show all
Defined in:
lib/linguist/source/diff.rb

Overview

A Delta represents a single file’s before/after state in a diff.

Direct Known Subclasses

RuggedRepository::Diff::Delta

Instance Method Summary collapse

Instance Method Details

#binary?Boolean

Public: determine whether the file delta is binary.

Returns true if the delta is binary, false otherwise.

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


34
35
36
# File 'lib/linguist/source/diff.rb', line 34

def binary?
  raise NotImplementedError
end

#new_fileObject

Public: get the metadata of the “after” file in the delta. The metadata is represented as a Hash with the keys:

  • :path (string)

  • :oid (string)

  • :mode (integer)

Returns the entry metadata hash.

Raises:

  • (NotImplementedError)


58
59
60
# File 'lib/linguist/source/diff.rb', line 58

def new_file
  raise NotImplementedError
end

#old_fileObject

Public: get the metadata of the “before” file in the delta. The metadata is represented as a Hash with the keys:

  • :path (string)

  • :oid (string)

  • :mode (integer)

Returns the entry metadata hash.

Raises:

  • (NotImplementedError)


46
47
48
# File 'lib/linguist/source/diff.rb', line 46

def old_file
  raise NotImplementedError
end

#statusObject

Public: get the status of the file’s “after” state as compared to “before”. Valid status values include:

  • :added

  • :deleted

  • :modified

  • :renamed

  • :copied

  • :ignored

  • :untracked

  • :typechange

Returns the status.

Raises:

  • (NotImplementedError)


27
28
29
# File 'lib/linguist/source/diff.rb', line 27

def status
  raise NotImplementedError
end