Class: Planter::ProgressBar
- Inherits:
-
Object
- Object
- Planter::ProgressBar
- Defined in:
- lib/planter/progress_bar.rb
Overview
Builds progress bars for seed runs.
Defined Under Namespace
Classes: NullProgressBar
Constant Summary collapse
- FORMAT =
The format string used by visible progress bars.
"%t |%B| %p%% %c/%C"
Class Method Summary collapse
-
.create(title:, total:, output: $stdout) ⇒ ProgressBar, NullProgressBar
Create a visible progress bar, or a null progress bar when disabled.
Class Method Details
.create(title:, total:, output: $stdout) ⇒ ProgressBar, NullProgressBar
Create a visible progress bar, or a null progress bar when disabled.
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/planter/progress_bar.rb', line 32 def self.create(title:, total:, output: $stdout) return NullProgressBar.new unless enabled?(total) ::ProgressBar.create( title: title, total: total, output: output, format: FORMAT ) end |