This is a very simple library to draw a commandline progress bar.
require'rubygems'require'procession'max_value=1000pb=Procession::Bar.new(max_value)max_value.timesdo |i|
pb.update(i)do |current_i|
"We are at #{i}"endsleep0.1endProcession.symbolThe symbol to draw the progres bar (Default: #)Procession.templateThe template of the output string (Default: "[%bar] %percent% %text")Procession.lengthThe number of symbols in the progress bar (Default: 20)
The template is a string that can contain certain special keys that will be replaced:
- %bar replaced by the progress bar
- %percent replaced by the percent number
- %text additional info added with the block to the update call
- %time remaining time of the execution