Skip to content

Instantly share code, notes, and snippets.

@unnu
Created June 14, 2010 08:10
Show Gist options
  • Save unnu/437422 to your computer and use it in GitHub Desktop.
Save unnu/437422 to your computer and use it in GitHub Desktop.
Dotted progress bar for shell scripts
require 'stringio'
class Progress
def initialize(show)
@device = StringIO.new unless show
end
def device
@device ||= $stdout
end
def message(msg)
device << msg
device << "\n"
device.flush
end
def put(token = '.')
device << token
device.flush
end
end
@unnu
Copy link
Author

unnu commented Jun 14, 2010

Interface for displaying simple progress data for import or calculation scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment