Skip to content

Instantly share code, notes, and snippets.

@shigeyas
Created October 1, 2009 08:20
Show Gist options
  • Save shigeyas/198824 to your computer and use it in GitHub Desktop.
Save shigeyas/198824 to your computer and use it in GitHub Desktop.
# Display progress blip on console
def blip_reset(ratio1 = 100, ratio2 = nil)
@blip_count = 0
@blip_ratio1 = ratio1
@blip_ratio2 = ratio2
if @blip_ratio2 == nil
@blip_ratio2 = ratio1 * ratio1
end
end
def blip
@blip_count += 1
if (@blip_count % @blip_ratio1) == 0
if (@blip_count % @blip_ratio2) == 0
STDERR.print "[#{@blip_count}]"
else
STDERR.print "."
end
end
end
def blip_done
STDERR.puts ""
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment