Similar::UnifiedDiff(T)
Unified diff formatter.
Example:
old_text = "Hello\nWorld"
new_text = "Hello\nCrystal"
diff = TextDiff.from_lines(old_text, new_text)
puts diff.unified_diff.header("old.txt", "new.txt")
Constructors
Instance methods
context_radius(n : Int32) : self
Changes the context radius.
The context radius is the number of lines between changes that should
be emitted. This defaults to 3.
Sets a header to the diff.
a and b are the file names that are added to the top of the unified
file format. The names are accepted verbatim which lets you encode
a timestamp into it when separated by a tab (\t).
Internal method to set header optionally.