Class: Mutest::Diff Private
- Inherits:
-
Object
- Object
- Mutest::Diff
- Includes:
- Adamantium::Flat
- Defined in:
- lib/mutest/diff.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Class to create diffs from source code
Constant Summary collapse
- ADDITION =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'+'.freeze
- DELETION =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'-'.freeze
- NEWLINE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
"\n".freeze
Class Method Summary collapse
-
.build(old, new) ⇒ Diff
private
Build new object from source strings.
Instance Method Summary collapse
-
#colorized_diff ⇒ String?
private
Colorized unified source diff between old and new.
-
#diff ⇒ String?
private
Unified source diff between old and new.
Class Method Details
.build(old, new) ⇒ Diff
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Build new object from source strings
43 44 45 |
# File 'lib/mutest/diff.rb', line 43 def self.build(old, new) new(lines(old), lines(new)) end |
Instance Method Details
#colorized_diff ⇒ String?
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Colorized unified source diff between old and new
31 32 33 34 |
# File 'lib/mutest/diff.rb', line 31 def colorized_diff return unless diff diff.lines.map(&self.class.method(:colorize_line)).join end |
#diff ⇒ String?
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Unified source diff between old and new
17 18 19 20 21 |
# File 'lib/mutest/diff.rb', line 17 def diff return if diffs.empty? minimized_hunk.diff(:unified) << NEWLINE end |