Class: Linguist::Source::Diff::Delta
- Inherits:
-
Object
- Object
- Linguist::Source::Diff::Delta
- Defined in:
- lib/linguist/source/diff.rb
Overview
A Delta represents a single file’s before/after state in a diff.
Direct Known Subclasses
Instance Method Summary collapse
-
#binary? ⇒ Boolean
Public: determine whether the file delta is binary.
-
#new_file ⇒ Object
Public: get the metadata of the “after” file in the delta.
-
#old_file ⇒ Object
Public: get the metadata of the “before” file in the delta.
-
#status ⇒ Object
Public: get the status of the file’s “after” state as compared to “before”.
Instance Method Details
#binary? ⇒ Boolean
Public: determine whether the file delta is binary.
Returns true if the delta is binary, false otherwise.
34 35 36 |
# File 'lib/linguist/source/diff.rb', line 34 def binary? raise NotImplementedError end |
#new_file ⇒ Object
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.
58 59 60 |
# File 'lib/linguist/source/diff.rb', line 58 def new_file raise NotImplementedError end |
#old_file ⇒ Object
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.
46 47 48 |
# File 'lib/linguist/source/diff.rb', line 46 def old_file raise NotImplementedError end |
#status ⇒ Object
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.
27 28 29 |
# File 'lib/linguist/source/diff.rb', line 27 def status raise NotImplementedError end |