Class: Black::Git::Diff
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#newer ⇒ Object
readonly
Returns the value of attribute newer.
-
#older ⇒ Object
readonly
Returns the value of attribute older.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #diff_parsed ⇒ Object
- #each ⇒ Object
-
#initialize(path, sha, sha_previous, diff_output, filename, status) ⇒ Diff
constructor
A new instance of Diff.
Constructor Details
#initialize(path, sha, sha_previous, diff_output, filename, status) ⇒ Diff
Returns a new instance of Diff.
102 103 104 105 106 107 108 109 |
# File 'lib/black/git.rb', line 102 def initialize(path, sha, sha_previous, diff_output, filename, status) @path = path @sha = sha @sha_previous = sha_previous @diff_output = diff_output @filename = filename @status = status end |
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
100 101 102 |
# File 'lib/black/git.rb', line 100 def filename @filename end |
#newer ⇒ Object (readonly)
Returns the value of attribute newer.
100 101 102 |
# File 'lib/black/git.rb', line 100 def newer @newer end |
#older ⇒ Object (readonly)
Returns the value of attribute older.
100 101 102 |
# File 'lib/black/git.rb', line 100 def older @older end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
100 101 102 |
# File 'lib/black/git.rb', line 100 def status @status end |
Instance Method Details
#diff_parsed ⇒ Object
129 130 131 |
# File 'lib/black/git.rb', line 129 def diff_parsed Black::Diff::OutputParser.parse(@diff_output.enum_for(:lines)) end |
#each ⇒ Object
111 112 113 114 115 116 117 118 119 |
# File 'lib/black/git.rb', line 111 def each if block_given? diff_parsed.each do |line| yield line end else diff_parsed.enum_for(:each) end end |