Class: Renegade::ConflictMarkers
- Inherits:
-
Object
- Object
- Renegade::ConflictMarkers
- Defined in:
- lib/renegade/conflict_markers.rb
Overview
Prevent merge artifacts from getting committed
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
-
#initialize ⇒ ConflictMarkers
constructor
A new instance of ConflictMarkers.
- #run(markers) ⇒ Object
Constructor Details
#initialize ⇒ ConflictMarkers
Returns a new instance of ConflictMarkers.
9 10 11 12 |
# File 'lib/renegade/conflict_markers.rb', line 9 def initialize @label = 'No merge artifacts' @errors = [] end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
7 8 9 |
# File 'lib/renegade/conflict_markers.rb', line 7 def errors @errors end |
Instance Method Details
#run(markers) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/renegade/conflict_markers.rb', line 14 def run(markers) # markers = `git diff-index --check --cached HEAD --` if markers == '' Status.report(@label, true) else Status.report(@label, false) @errors.push('Merge artifacts were found!' + "\n" + markers) end end |