class ActionController::Live::Buffer

def writeln(string)

Same as +write+ but automatically include a newline at the end of the string.
def writeln(string)
  write string.end_with?("\n") ? string : "#{string}\n"
end