def end_with_nl(object)
    string = object.to_s
    needs_modifying = string.size > 0 && string[-1] != "\n"
    needs_modifying ? "#{string}\n" : string
  end
def end_with_nl(object)
    string = object.to_s
    needs_modifying = string.size > 0 && string[-1] != "\n"
    needs_modifying ? "#{string}\n" : string
  end
Reverse of String#chomp.
 Convert to string if not already a string.
 Append new line to string if the string is not empty and does not already end with one.
 This is to disable the Diffy warning message "No newline at end of file"