lib/cli_tools/console.rb
def putr( str = '' )
  # move cursor to beginning of line
  cr = "\r"

  # ANSI escape code to clear line from cursor to end of line
  # cf. http://en.wikipedia.org/wiki/ANSI_escape_code
  clear = "\e[0K"

  # reset lines
  reset = cr + clear

  print "#{reset}#{str}"
  $stdout.flush
end
# Replaces current line in the output with a new one.
#
Replaces current line in the output with a new one.
Replaces current line in the output with a new one .
def putr( str = '' )
  cr = "\r"
  clear = "\e[0K"
  reset = cr + clear
  print "#{reset}#{str}"
  $stdout.flush
end
def putr ( str = '' ) cr = "\r" clear = "\e[0K" reset = cr + clear print "#{reset}#{str}" $stdout . flush end
Replaces current line in the output with a new one.
Replaces current line in the output with a new one .
# move cursor to beginning of line # ANSI escape code to clear line from cursor to end of line # cf. http://en.wikipedia.org/wiki/ANSI_escape_code # reset lines
str