We can certainly do it by
string.chomp+"\r\n"
but I'm wondering is there an elegant way to do it.
Not that I'm aware of.
This prior answer seems to suggest use of gsub (regex replacement)
Normalizing line endings in Ruby