Skip to content
100% |***********************************************************************|
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example
lib/terminal
test
.gitignore
.travis.yml
.yardopts
Gemfile
MIT-LICENSE
README.md
Rakefile
terminal-progress_bar.gemspec

README.md

terminal-progress_bar

Build Status Gem Version Dependency Status

Description

100% |***********************************************************************|

Features

  • Pure Ruby :)

Usage

Try below senario and yor imaginations on REPL(irb/pry).

Setup

require 'terminal/progressbar'

Flexible handling

Terminal::ProgressBar.run mark: '*' do |bar|
  50.times do
    sleep 0.1
    bar.increment!
  end
  bar.pointer = 15
  bar.flush
  sleep 2

  30.times do
    sleep 0.1
    bar.increment! 2
  end

  30.times do
    sleep 0.1
    bar.decrement! 2
  end

  bar.pointer = 70
  bar.flush
  sleep 2
end

Auto printing under declared interval

Terminal::ProgressBar.auto 0.2, mark: '*' do |bar|
  50.times do
    sleep 0.1
    bar.increment
  end

  sleep 0.1
  bar.pointer = 15

  30.times do
    sleep 0.1
    bar.increment
  end
end

Requirements

Install

$ gem install terminal-progress_bar

Link

License

The MIT X11 License
Copyright (c) 2012 Kenichi Kamiya
See MIT-LICENSE for further details.

You can’t perform that action at this time.