Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bar-of-progress

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bar-of-progress

  • 0.1.3
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

bar-of-progress

Build Status Code Climate

Everyone knows that progress bars are one of the hard, unsolved problems of computer science, so I decided to give it a shot.

xkcd rocks

API

Default progress bars

require 'bar-of-progress'

bar = BarOfProgress.new #=> defaults to completeness == "100"  

bar.progress #=> "[◌◌◌◌◌◌◌◌◌◌]"

bar.progress(50) #=> "[●●●●●◌◌◌◌◌]"

bar.progress(49) #=> "[●●●●◍◌◌◌◌◌]"

Custom progress bars

require 'bar-of-progress'

bar = BarOfProgress.new(
  :total => 115.5,              #=> default (will be converted to BigDecimal): 100
  :length => 14,                #=> default (will be converted to Fixnum): 10
  :braces => %w{( )},           #=> default: ["[", "]"]
  :complete_indicator => "■",   #=> default: "●"
  :partial_indicator => "▤",    #=> default: "◍"
  :incomplete_indicator => "□", #=> default: "◌"
  :precision => 18              #=> default (determines what is considered 'partial'): 20
)

bar.progress(30) #=> "(■■■▤□□□□□□□□□□)"

FAQs

Package last updated on 02 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc