Class: Bugwatch::Diff
Defined Under Namespace
Classes: Content
Class Method Summary collapse
Instance Method Summary collapse
- #content ⇒ Object
- #identify(line_number) ⇒ Object
-
#initialize(attributes = {}) ⇒ Diff
constructor
A new instance of Diff.
- #modifications ⇒ Object
Methods included from Attrs
Constructor Details
#initialize(attributes = {}) ⇒ Diff
Returns a new instance of Diff.
49 50 51 |
# File 'lib/bugwatch/diff.rb', line 49 def initialize(attributes={}) @attributes = attributes end |
Class Method Details
.from_grit(grit_diff) ⇒ Object
42 43 44 45 46 47 |
# File 'lib/bugwatch/diff.rb', line 42 def self.from_grit(grit_diff) new path: String(grit_diff.b_path || grit_diff.a_path), diff: -> { grit_diff.diff }, a_blob: -> { blob_data(grit_diff.a_blob) }, b_blob: -> { blob_data(grit_diff.b_blob) } end |
Instance Method Details
#content ⇒ Object
61 62 63 |
# File 'lib/bugwatch/diff.rb', line 61 def content Content.new(path, a_blob, b_blob) end |
#identify(line_number) ⇒ Object
53 54 55 |
# File 'lib/bugwatch/diff.rb', line 53 def identify(line_number) DiffParser.new(diff, b_blob).modifications(line_number..line_number) end |
#modifications ⇒ Object
57 58 59 |
# File 'lib/bugwatch/diff.rb', line 57 def modifications DiffParser.new(diff, b_blob).modifications end |