class SoundCloud::Downloader::Helpers

Public Class Methods

progress_bar(char, end_char, position) click to toggle source

Public: Displays a progress bar

char - A unique Character, respresenting the progress in the progress bar. end_char - A unique Character, showed on the end of the progress bar. position - A Number, the current position.

Examples:

  SoundCloud::Downloader::Helpers.progress_bar('=', '>', 5)
  # =====>
  SoundCloud::Downloader::Helpers.progress_bar('=', '>', 10)
  # ==========>
# File lib/soundcloud-downloader.rb, line 32
def self.progress_bar(char, end_char, position)
  print "\r\e[0K" + (char * position) + end_char
  $stdout.flush
end