piotrmurach/tty-progressbar

View on GitHub
examples/color.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

require "pastel"

require_relative "../lib/tty-progressbar"

pastel = Pastel.new
green = pastel.on_green(" ")
red = pastel.on_red(" ")

bar = TTY::ProgressBar.new("|:bar|", total: 30, complete: green, incomplete: red)

30.times do
  sleep(0.1)
  bar.advance
end