-
-
Notifications
You must be signed in to change notification settings - Fork 131
Options
bjmfactory edited this page Nov 18, 2014
·
6 revisions
If you would like to customize your prompt, you can pass options when you call .create
.
ProgressBar.create(:title => "Items", :starting_at => 20, :total => 200)
This will output:
Items: |======= |
The following are the list of options you can use:
-
:title
- (Defaults toProgress
) - The title of the progress bar. -
:total
- (Defaults to100
) The total number of the items that can be completed. -
:starting_at
- (Defaults to0
) The number of items that should be considered completed when the bar first starts. This is also the default number that the bar will be set to if#reset
is called. -
:progress_mark
- (Defaults to=
) The mark which indicates the amount of progress that has been made. -
:remainder_mark
- (Defaults to -
:format
- (Defaults to%t: |%B|
) The format string which determines how the bar is displayed. See Formatting below. -
:length
- (Defaults to full width if possible, otherwise80
) The preferred width of the entire progress bar including any format options. -
:output
- (Defaults toSTDOUT
) All output will be sent to this object. Can be any object which responds to.print
.flush
.tty?
.puts
. -
:smoothing
- (Defaults to0.1
) See Smoothing Out Estimated Time Jitters below. -
:throttle_rate
- (Defaults to0.01
) See Throttling below. -
:unknown_progress_animation_steps
- (Defaults to['=---', '-=--', '--=-', '---=']
) See Unknown Progress The graphical elements used to cycle when progress is changed but the total amount of items being processed is unknown.