A ruby function to keep printing on the same line on the console