Module: CLIProgressBar

Defined in:
lib/cli_progress_bar/item_progress_bar.rb,
lib/cli_progress_bar.rb,
lib/cli_progress_bar/version.rb,
lib/cli_progress_bar/percent_progress_bar.rb

Overview

Progress bar for percentages, where you increment or set the current progress as a percentage and specify which percentages are to be logged to the stream.

Defined Under Namespace

Classes: ItemProgressBar, PercentProgressBar, ProgressBar

Constant Summary collapse

LOG_AT_ALL_PERCENTS =
(1..100).to_a.freeze
LOG_AT_FIVE_PERCENTS =
[5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100].freeze
LOG_AT_TEN_PERCENTS =
[10, 20, 30, 40, 50, 60, 70, 80, 90, 100].freeze
LOG_AT_QUARTER_PERCENTS =
[25, 50, 75, 100].freeze
BAR_LENGTH =
60.freeze
LINE_CHAR =
"-".freeze
STD_OUT =
$stdout
VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.new(*args, **kwargs) ⇒ Object



17
18
19
# File 'lib/cli_progress_bar.rb', line 17

def self.new(*args, **kwargs)
  new_percent_bar(*args, **kwargs)
end

.new_item_bar(*args, **kwargs) ⇒ Object



25
26
27
# File 'lib/cli_progress_bar.rb', line 25

def self.new_item_bar(*args, **kwargs)
  ItemProgressBar.new(*args, **kwargs)
end

.new_percent_bar(*args, **kwargs) ⇒ Object



21
22
23
# File 'lib/cli_progress_bar.rb', line 21

def self.new_percent_bar(*args, **kwargs)
  PercentProgressBar.new(*args, **kwargs)
end