• Stars
    star
    415
  • Rank 100,468 (Top 3 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 9 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Display a single or multiple progress bars in the terminal.
TTY Toolkit logo

TTY::ProgressBar Gitter

Gem Version Actions CI Build status Maintainability Coverage Status Inline docs

A flexible and extensible progress bar for terminal applications.

TTY::ProgressBar provides independent progress bar component for TTY toolkit.

Features

  • Customisable. Choose from many configuration options to get the behaviour you want.
  • Flexible. Describe bar format and pick from many predefined tokens and bar styles.
  • Extensible. Define custom tokens to fit your needs.
  • Powerful. Display multi progress bars in parallel.
  • Show an unbounded operation with indeterminate progress.
  • Pause and resume progress at any time.
  • Include Unicode characters in progress bar.
  • Works on all ECMA-48 compatible terminals.

Installation

Add this line to your application's Gemfile:

gem "tty-progressbar"

And then execute:

$ bundle

Or install it yourself as:

$ gem install tty-progressbar

Contents

1. Usage

TTY::ProgressBar requires only a format string with :bar token and total number of steps to completion:

bar = TTY::ProgressBar.new("downloading [:bar]", total: 30)

Once initialized, use advance method to indicated progress:

30.times do
  sleep(0.1)
  bar.advance  # by default increases by 1
end

This would produce the following animation in your terminal:

# downloading [=======================       ]

You can further change a progress bar behaviour and display by changing configuration options and using many predefined tokens and bar formats.

When you don't know the total yet, you can set it to nil to switch to indeterminate progress:

# downloading [       <=>                    ]

Use TTY::ProgressBar::Multi to display multiple parallel progress bars.

Declare a top level bar and then register child bars:

bars = TTY::ProgressBar::Multi.new("main [:bar] :percent")

bar1 = bars.register("one [:bar] :percent", total: 15)
bar2 = bars.register("two [:bar] :percent", total: 15)

Then progress the child bars in parallel:

bars.start  # starts all registered bars timers

th1 = Thread.new { 15.times { sleep(0.1); bar1.advance } }
th2 = Thread.new { 15.times { sleep(0.1); bar2.advance } }

[th1, th2].each { |t| t.join }

A possible terminal output may look like this:

# โ”Œ main [===============               ] 50%
# โ”œโ”€โ”€ one [=====          ] 34%
# โ””โ”€โ”€ two [==========     ] 67%

2. TTY::ProgressBar API

2.1 advance

Once you have TTY::ProgressBar instance, you can progress the display by calling advance method. By default, it will increase by 1 but you can pass any number of steps, for instance, a number of bytes for a downloaded file:

bar.advance(1024)

You can also pass negative steps if you wish to backtrack the progress:

bar.advance(-1)

Note: If a progress bar has already finished then any negative steps will not set it back to desired value.

2.2 iterate

To simplify progressing over an enumerable you can use iterate which as a first argument accepts an Enumerable and as a second the amount to progress the bar with.

First, create a progress bar without a total which will be automatically updated for you once iteration starts:

bar = TTY::ProgressBar.new("[:bar]")

Then, either directly iterate over a collection by yielding values to a block:

bar.iterate(30.times) { |v| ... }

Or return an Enumerator:

progress = bar.iterate(30.times)
# => #<Enumerator: #<Enumerator::Generator:0x...:each>

By default, progress bar is advanced by 1 but you can change it by passing second argument:

bar.iterate(30.times, 5)

One particularly useful application of iterate are Ruby infamous lazy enumerators, or slowly advancing enumerations, representing complex processes.

For example, an Enumerator that downloads content from a remote server chunk at a time:

downloader = Enumerator.new do |y|
  start = 0
  loop do
    yield(download_from_server(start, CHUNK_SIZE))
    raise StopIteration if download_finished?
    start += CHUNK_SIZE
  end
end

Would be used with progress bar with the total size matching the content size like so:

bar = TTY::ProgressBar.new("[:bar]", total: content_size)
# you need to provide the total for the iterate to avoid calling enumerator.count
response = bar.iterate(downloader, CHUNK_SIZE).to_a.join

This would result in progress bar advancing after each chunk up until all content has been downloaded, returning the result of the download in response variable.

Please run slow_process example to see this in action.

2.3 current=

A progress doesn't have to start from zero. You can set it to a given value using current= method:

bar.current = 50

Note: If a progress bar has already finished then setting current value will not have any effect.

2.4 ratio=

In order to update overall completion of a progress bar as an exact percentage use the ratio= method. The method accepts values between 0 and 1 inclusive. For example, a ratio of 0.5 will attempt to set the progress bar halfway:

bar.ratio = 0.5

2.5 width=

You can set how many terminal columns will the :bar actually span excluding any other tokens and/or text.

For example, if you need the bar to be always 20 columns wide do:

bar.width = 20

Or with configuration options:

bar = TTY::ProgressBar.new("[:bar]", width: 20)

2.6 start

By default the timer for internal time estimation is started automatically when the advance method is called. However, if you require control on when the progression timer is started use start call:

bar.start  # => sets timer and draws initial progress bar

2.7 update

Once a progress bar has been started, you can change its configuration option(s) by calling update:

bar.update(complete: "+", frequency: 10)

2.8 finish

In order to immediately stop and finish progress of a bar call finish. This will finish drawing the progress by advancing it to 100% and returning to a new line.

bar.finish

2.9 stop

In order to immediately stop a bar in the current position and thus prevent any further progress use stop:

bar.stop

2.10 pause

A running progress bar can be paused at the current position using pause method:

bar.pause

A paused progress bar will stop accumulating any time measurements like elapsed time. It also won't return to a new line, so a progress animation can be smoothly resumed.

2.11 reset

In order to reset currently running or finished progress bar to its original configuration and initial position use reset like so:

bar.reset

After resetting a progress bar, if you wish to draw and start a bar and its timers use start call.

2.12 resume

When a bar is stopped or paused, you can continue its progression using the resume method.

bar.resume

A resumed progression will continue accumulating the total elapsed time without including time intervals for pausing or stopping.

2.13 complete?

During progression you can check whether a bar is finished or not by calling complete?. The bar will only return true if the progression finished successfully, otherwise false will be returned.

bar.complete? # => false

2.14 paused?

To check whether a progress bar is paused or not use paused?:

bar.paused? # => true

2.15 stopped?

To check whether a progress bar is stopped or not use stopped?:

bar.stopped? # => true

2.16 indeterminate?

You can make a progress bar indeterminate by setting :total to nil. In this state, a progress bar animation is displayed to show unbounded task. You can check whether the progress bar is indeterminate with the indeterminate? method:

bar.indeterminate? # => false

2.17 resize

If you want to change a progress bar's current width, use resize and pass in a new desired length. However, if you don't provide any width the resize will use terminal current width as its base for scaling.

bar.resize      # determine terminal width and scale accordingly
bar.resize(50)  # will resize bar proportionately from this point onwards

To handle automatic resizing you can trap :WINCH signal:

trap(:WINCH) { bar.resize }

2.18 on

A progress bar fires events when it is progressing, paused, stopped or finished. You can register to listen for these events using the on message.

Every time an advance is called the :progress event gets fired which you can listen for inside a block. A first yielded argument is the actual amount of progress:

bar.on(:progress) { |amount| ... }

When a progress bar finishes and completes then the :done event is fired. You can listen for this event:

bar.on(:done) { ... }

Alternatively, when a progress bar gets stopped the :stopped event is fired. You can listen for this event:

bar.on(:stopped) { ... }

Anytime a progress bar is paused the :paused event will be fired. To listen for this event do:

bar.on(:paused) { ... }

3. Configuration

There are number of configuration options that can be provided:

  • :total - the total number of steps to completion.
  • :width - the number of terminal columns for displaying a bar excluding other tokens. Defaults to total steps.
  • :complete - the completion character, by default =.
  • :incomplete - the incomplete character, by default single space.
  • :head - the head character, by default =.
  • :unknown - the character(s) used to show indeterminate progress, defaults to <=>.
  • :bar_format - the predefined bar format, by default :classic.
  • :output - the output stream defaulting to stderr.
  • :frequency - used to throttle the output, by default 0.
  • :interval - the time interval used to measure rate, by default 1 sec.
  • :hide_cursor - whether to hide the console cursor or not, defaults to false.
  • :clear - whether to clear the finished bar or not, defaults to false.
  • :clear_head - whether to clear the head character when the progress is done or not, defaults to false.

All the above options can be passed in as hash options or block parameters:

bar = TTY::ProgressBar.new("[:bar]") do |config|
  config.total = 30
  config.frequency = 10
  config.clear = true
end

The progress bar's configuration can also be changed at runtime with configure:

bar.configure do |config|
  config.total = 100   # takes precedence over the original value
  config.frequency = 20
end

Or with the update method:

bar.update(total: 100, frequency: 20)

3.1 :total

The :total option determines the final value at which the progress bar fills up and stops.

TTY::ProgressBar.new("[:bar]", total: 30)

Setting :total to nil or leaving it out will cause the progress bar to switch to indeterminate mode. Instead of showing completeness for a task, it will render animation like <=> that moves left and right:

# [                    <=>                 ]

The indeterminate mode is useful to show time-consuming and unbounded task.

Run examples/indeterminate to see indeterminate progress animation in action.

3.2 :width

The progress bar width defaults to the total value and is capped at the maximum terminal width minus all the labels. If you want to enforce the bar to have a specific length use the :width option:

TTY::ProgressBar.new("[:bar]", width: 30)

3.3 :complete

By default, the = character is used to mark progression but this can be changed with :complete option:

TTY::ProgressBar.new("[:bar]", complete: "x")

Then the output could look like this:

# [xxxxxxxx      ]

3.4 :incomplete

By default no characters are shown to mark the remaining progress in the :classic bar format. Other bar styles often have incomplete character. You can change this with :incomplete option:

TTY::ProgressBar.new("[:bar]", incomplete: "_")

A possible output may look like this:

# [======_________]

3.5 :head

If you prefer for the animated bar to display a specific character for a head of progression then use :head option:

TTY::ProgressBar.new("[:bar]", head: ">")

This could result in output like this:

# [=======>      ]

3.6 :unknown

By default, a progress bar shows indeterminate progress using <=> characters:

# [     <=>      ]

Other bar formats use different characters.

You can change this with the :unknown option:

TTY::ProgressBar.new("[:bar]", unknown: "<?>")

This may result in the following output:

# [     <?>      ]

3.7 :bar_format

There are number of preconfigured bar formats you can choose from.

Name Determinate Indeterminate
:arrow โ–ธโ–ธโ–ธโ–ธโ–ธโ–นโ–นโ–นโ–นโ–น โ—‚โ–ธ
:asterisk โœฑโœฑโœฑโœฑโœฑโœณโœณโœณโœณโœณ โœณโœฑโœณ
:blade โ–ฐโ–ฐโ–ฐโ–ฐโ–ฐโ–ฑโ–ฑโ–ฑโ–ฑโ–ฑ โ–ฑโ–ฐโ–ฑ
:block โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘ โ–ˆ
:box โ– โ– โ– โ– โ– โ–กโ–กโ–กโ–กโ–ก โ–กโ– โ–ก
:bracket โญโญโญโญโญโญโญโญโญโญ โฌ=โญ
:burger โ‰กโ‰กโ‰กโ‰กโ‰กโ‰กโ‰กโ‰กโ‰กโ‰ก <โ‰ก>
:button โฆฟโฆฟโฆฟโฆฟโฆฟโฆพโฆพโฆพโฆพโฆพ โฆพโฆฟโฆพ
:chevron โ€บโ€บโ€บโ€บโ€บโ€บโ€บโ€บโ€บโ€บ โ€น=โ€บ
:circle โ—โ—โ—โ—โ—โ—‹โ—‹โ—‹โ—‹โ—‹ โ—‹โ—โ—‹
:classic ========== <=>
:crate โ–ฃโ–ฃโ–ฃโ–ฃโ–ฃโฌšโฌšโฌšโฌšโฌš โฌšโ–ฃโฌš
:diamond โ™ฆโ™ฆโ™ฆโ™ฆโ™ฆโ™ขโ™ขโ™ขโ™ขโ™ข โ™ขโ™ฆโ™ข
:dot ๏ฝฅ๏ฝฅ๏ฝฅ๏ฝฅ๏ฝฅ๏ฝฅ๏ฝฅ๏ฝฅ๏ฝฅ๏ฝฅ ๏ฝฅ๏ฝฅ๏ฝฅ
:heart โ™ฅโ™ฅโ™ฅโ™ฅโ™ฅโ™กโ™กโ™กโ™กโ™ก โ™กโ™ฅโ™ก
:rectangle โ–ฎโ–ฎโ–ฎโ–ฎโ–ฎโ–ฏโ–ฏโ–ฏโ–ฏโ–ฏ โ–ฏโ–ฎโ–ฏ
:square โ–ชโ–ชโ–ชโ–ชโ–ชโ–ซโ–ซโ–ซโ–ซโ–ซ โ–ซโ–ชโ–ซ
:star โ˜…โ˜…โ˜…โ˜…โ˜…โ˜†โ˜†โ˜†โ˜†โ˜† โ˜†โ˜…โ˜†
:track โ–ฌโ–ฌโ–ฌโ–ฌโ–ฌโ•โ•โ•โ•โ• โ•โ–ฌโ•
:tread โฑโฑโฑโฑโฑโฑโฑโฑโฑโฑ โฐ=โฑ
:triangle โ–ถโ–ถโ–ถโ–ถโ–ถโ–ทโ–ทโ–ทโ–ทโ–ท โ—€โ–ถ
:wave ~~~~~_____ <~>

For example, you can specify :box format with the :bar_format option:

TTY::ProgressBar.new("[:bar]", bar_format: :box)

This will result in output like this:

# [โ– โ– โ– โ– โ– โ–กโ–กโ–กโ–กโ–กโ–กโ–กโ–กโ–กโ–ก]

You can overwrite :complete, :incomplete, :head and :unknown characters:

TTY::ProgressBar.new("[:bar]", bar_format: :box, incomplete: " ", unknown: "?")

This will display the following when total is given:

# [โ– โ– โ– โ– โ–           ]

And for the unknown progress the ? character will move from left to right:

# [   ?           ]

3.8 :output

A progress bar only outputs to a console. When the output is, for example, redirected to a file or a pipe, the progress bar doesn't get printed. This is so, for example, your error logs do not overflow with progress bar output.

You can change where console output is streamed with :output option:

bar = TTY::ProgressBar.new(output: $stdout)

The output stream defaults to stderr.

3.9 :frequency

Each time the advance is called it causes the progress bar to repaint. In cases when there is a huge number of updates per second, you may need to limit the rendering process by using the frequency option.

The frequency option accepts integer representing number of Hz units, for instance, frequency of 2 will mean that the progress will be updated maximum 2 times per second.

TTY::ProgressBar.new("[:bar]", total: 30, frequency: 10) # 10 Hz

3.10 :interval

Every time advance method is called, a time sample is taken for speed measurement. By default, all the samples are grouped in second intervals to provide a rate of speed. You can change this by passing the interval option.

The interval option is an integer that represents the number of seconds, for example, interval of 60 would mean that speed is measured per 1 minute.

TTY::ProgressBar.new(":rate/minute", total: 100, interval: 60) # 1 minute

TTY::ProgressBar.new(":rate/hour", total: 100, interval: 3600) # 1 hour

3.11 :hide_cursor

By default the cursor is visible during progress bar rendering. If you wish to hide it, you can do so with the :hide_cursor option.

Please note that hiding cursor changes user's terminal and you need to ensure that the cursor is made visible after your code finishes. This means also handling premature interrupt signals and other unpredictable events.

One solution is to wrap your progress rendering inside the begin and ensure like so:

progress = TTY::ProgressBar.new("[:bar]", hide_cursor: true)

begin
  # logic to advance progress bar
ensure
  progress.stop # or progress.finish
  # both methods will ensure that cursor is made visible again
end

3.12 :clear

By default, when a progress bar finishes it returns to a new line leaving the last progress output behind.

If you prefer to erase a progress bar when it is finished use :clear option:

TTY::ProgressBar.new("[:bar]", clear: true)

3.13 :clear_head

When a progress bar finishes and its animation includes :head character, the character will remain in the output:

# [=============>]

To replace a head character when a progress bar is finished use :clear_head option:

TTY::ProgressBar.new("[:bar]", clear_head: true)

This will result in the following output:

# [==============]

4. Formatting

Every TTY::ProgressBar instance requires a format string, which apart from regular characters accepts special tokens to display dynamic information. For instance, a format to measure download progress could be:

"downloading [:bar] :elapsed :percent"

4.1 Tokens

These are the tokens that are currently supported:

  • :bar the progress bar
  • :current the current progress number
  • :current_byte the current progress in bytes
  • :total the total progress number
  • :total_byte the total progress in bytes
  • :percent the completion percentage
  • :elapsed the elapsed time in seconds
  • :eta the estimated time to completion in seconds
  • :eta_time the estimated time of day at completion
  • :rate the current rate of progression per second
  • :byte_rate the current rate of progression in bytes per second
  • :mean_rate the averaged rate of progression per second
  • :mean_byte the averaged rate of progression in bytes per second

In the indeterminate mode, the progress bar displays - for tokens that cannot be calculated like :total, :total_byte, :percent and :eta. The following format:

"[:bar] :current/:total :total_byte :percent ET::elapsed ETA::eta :rate/s"

Will result in:

# [                 <=>                    ] 23/- -B -% ET: 1s ETA:--s 18.01/s

4.2 Custom Formatters

If the provided tokens do not meet your needs, you can write your own formatter and instrument formatting pipeline to use a formatter you prefer. This option is preferred if you are going to rely on progress bar internal data such as rate, current etc. which will all be available on the passed in progress bar instance.

For example, let's say you want to add :time token. First, start by creating a custom formatter class called TimeFormatter that will dynamically update :time token in the formatted string. In order for the TimeFormatter to recognise the :time token, you'll need to include the TTY::ProgressBar::Formatter module with a regular expression matching the token like so:

class TimeFormatter
  include TTY::ProgressBar::Formatter[/:time/i]
  ...
end

Next, add call method that will substitute the matched token with an actual value. For example, to see the time elapsed since the start do:

class TimeFormatter
  include TTY::ProgressBar::Formatter[/:time/i]

  def call(value)  # specify how display string is formatted
    # access current progress bar instance to read start time
    elapsed = (Time.now - progress.start_time).to_s
    value.gsub(matcher, elapsed)   # replace :time token with a value
  end
end

Notice that you have access to all the configuration options inside the formatter by simply invoking them on the progress instance.

Create TTY::ProgressBar instance using the new token:

bar = TTY::ProgressBar.new(":time", total: 30)

Then add TimeFormatter to the pipeline like so:

bar.use TimeFormatter

Then invoke progression:

bar.advance

4.3 Custom Tokens

You can define custom tokens by passing pairs name: value to advance method in order to dynamically update formatted bar. This option is useful for lightweight content replacement such as titles that doesn't depend on the internal data of a progress bar. For example:

bar = TTY::ProgressBar.new("(:current) :title", total: 4)
bar.advance(title: "Hello Piotr!")
bar.advance(3, title: "Bye Piotr!")

This will output:

# (1) Hello Piotr!
# (4) Bye Piotr!

4.4 Unicode

The format string as well as :complete, :head, :incomplete and :unknown configuration options can contain Unicode characters that aren't monospaced.

For example, you can specify complete bar progression character to be Unicode non-monospaced:

bar = TTY::ProgressBar.new("Unicode [:bar]", total: 30, complete: "ใ‚")

Advancing above progress bar to completion will fit ใ‚ characters in 30 terminal columns:

# Unicode [ใ‚ใ‚ใ‚ใ‚ใ‚ใ‚ใ‚ใ‚ใ‚ใ‚ใ‚ใ‚ใ‚ใ‚ใ‚]

Similarly, the formatted string can include Unicode characters:

bar = TTY::ProgressBar.new("ใ‚ใ‚ใ‹ใ‚“ใ‚€ใ‚Š[:bar]", total: 20)

A finished progress bar will also fit within allowed width:

# ใ‚ใ‚ใ‹ใ‚“ใ‚€ใ‚Š[==    ]

5. Logging

If you want to print messages out to terminal along with the progress bar use the log method. The messages will appear above the progress bar and will continue scrolling up as more are logged out.

bar.log("Piotrrrrr")
bar.advance

This could result in the following output:

# Piotrrrrr
# downloading [=======================       ]

6. TTY::ProgressBar::Multi API

6.1 new

The multi progress bar can be created in two ways. If you simply want to group multiple progress bars together, you can create multi bar without a format string like so:

TTY::ProgressBar::Multi.new

However, if you want a top level multibar that tracks progress of all the registered progress bars then you need to provide a formatted string:

TTY::ProgressBar::Multi.new("main [:bar] :percent")

6.2 register

To create a TTY::ProgressBar under the multibar use register like so:

multibar = TTY::ProgressBar::Multi.new
bar = multibar.register("[:bar]", total: 30)

The register call returns the newly created progress bar that can be changed using all the available progress bar API methods.

Note: Remember to specify total value for each registered progress bar, either when sending register message or when using update to dynamically assign the total value.

6.3 advance

Once multi progress bar has been created you can advance each registered progress bar individually, either by executing them one after the other synchronously or by placing them in separate threads thus progressing each bar asynchronously. The multi bar handles synchronization and display of all bars as they continue their respective rendering.

For example, to display two bars asynchronously, first register them with the multi bar:

bar1 = multibar.register("one [:bar]", total: 20)
bar2 = multibar.register("two [:bar]", total: 30)

Next place the progress behaviour in separate process or thread:

th1 = Thread.new { 20.times { expensive_work(); bar1.advance } }
th2 = Thread.new { 30.times { expensive_work(); bar2.advance } }

Finally, wait for the threads to finish:

[th1, th2].each { |t| t.join }

6.4 start

By default the top level multi bar will be rendered as the first bar and have its timer started when one of the registered bars advances. However, if you wish to start timers and draw the top level multi bar do:

multibar.start  # => sets timer and draws top level multi progress bar

6.5 finish

In order to finish all progress bars call finish. This will finish the top level progress bar, if it exists, and any registered progress bar still in progress.

multibar.finish

6.6 stop

Use stop to terminate immediately all progress bars registered with the multibar.

multibar.stop

6.7 pause

All running progress bars can be paused at their current positions using the pause method:

multibar.pause

6.8 resume

When one or more registered progress bar is stopped or paused, they can be resumed all at once using the resume method:

multibar.resume

6.9 complete?

To check if all registered progress bars have been successfully finished use complete?

multibar.complete? # => true

6.10 paused?

To check whether all progress bars are paused or not use paused?:

multibar.paused? # => true

6.11 stopped?

To check whether all progress bars are stopped or not use stopped?:

multibar.stopped? # => true

6.12 on

Similar to TTY::ProgressBar the multi bar fires events when it is progressing, stopped or finished. You can register to listen for events using the on message.

Every time any of the registered progress bars progresses the :progress event is fired which you can listen for:

multibar.on(:progress) { ... }

When all the registered progress bars finish and complete then the :done event is fired. You can listen for this event:

multibar.on(:done) { ... }

When any of the progress bars gets stopped the :stopped event is fired. You can listen for this event:

multibar.on(:stopped) { ... }

Anytime a registered progress bar pauses, a :paused event will be fired. To listen for this event do:

multibar.on(:paused) { ... }

6.13 :style

In addition to all configuration options you can style multi progress bar:

TTY::ProgressBar::Multi.new("[:bar]", style: {
  top: ". ",
  middle: "|-> ",
  bottom: "|__ "
})

7. Examples

This section demonstrates some of the possible uses for the TTY::ProgressBar, for more please see examples folder in the source directory.

7.1 Colors

Creating a progress bar that displays in color is as simple as coloring the :complete and :incomplete character options. In order to help with coloring you can use pastel library like so:

require "pastel"

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

And then pass in the colored strings as options to TTY::ProgressBar:

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

To see how a progress bar is reported in terminal you can do:

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

7.2 Speed

Commonly a progress bar is utilized to measure download speed per second. This can be done like so:

TTY::ProgressBar.new("[:bar] :byte_rate/s") do |config|
  config.total = 300000
  config.interval = 1     # => 1 sec
end

This will result in output similar to:

# downloading [=======================       ] 4.12MB/s

Contributing

  1. Fork it ( https://github.com/piotrmurach/tty-progressbar/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

Code of Conduct

Everyone interacting in the TTY::ProgressBar project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

Copyright

Copyright (c) 2014 Piotr Murach. See LICENSE for further details.

More Repositories

1

tty

Toolkit for developing sleek command line apps.
Ruby
2,472
star
2

tty-prompt

A beautiful and powerful interactive command line prompt
Ruby
1,418
star
3

github

Ruby interface to GitHub API
Ruby
1,132
star
4

finite_machine

A minimal finite state machine with a straightforward syntax.
Ruby
802
star
5

pastel

Terminal output styling with intuitive and clean API.
Ruby
628
star
6

rspec-benchmark

Performance testing matchers for RSpec
Ruby
584
star
7

tty-spinner

A terminal spinner for tasks that have non-deterministic time frame.
Ruby
421
star
8

loaf

Manages and displays breadcrumb trails in Rails app - lean & mean.
Ruby
404
star
9

tty-command

Execute shell commands with pretty output logging and capture stdout, stderr and exit status.
Ruby
397
star
10

tty-markdown

Convert a markdown document or text into a terminal friendly output.
Ruby
303
star
11

tty-logger

A readable, structured and beautiful logging for the terminal
Ruby
291
star
12

github_cli

GitHub on your command line. Use your terminal, not the browser.
Ruby
264
star
13

tty-table

A flexible and intuitive table generator
Ruby
183
star
14

tty-box

Draw various frames and boxes in your terminal window
Ruby
177
star
15

awesome-ruby-cli-apps

A curated list of awesome command-line applications in Ruby.
Ruby
159
star
16

rack-policy

Rack middleware for the EU ePrivacy Directive compliance in Ruby Web Apps
Ruby
147
star
17

tty-pie

Draw pie charts in your terminal window
Ruby
138
star
18

necromancer

Conversion from one object type to another with a bit of black magic.
Ruby
135
star
19

strings

A set of useful functions for transforming strings.
Ruby
127
star
20

coinpare

Compare cryptocurrency trading data across multiple exchanges and blockchains in the comfort of your terminal
Ruby
109
star
21

tty-exit

Terminal exit codes.
Ruby
100
star
22

strings-case

Convert strings between different cases.
Ruby
95
star
23

tty-reader

A set of methods for processing keyboard input in character, line and multiline modes.
Ruby
85
star
24

tty-option

A declarative command-line parser
Ruby
84
star
25

merkle_tree

A merkle tree is a data structure used for efficiently summarizing sets of data, often one-time signatures.
Ruby
83
star
26

tty-screen

Terminal screen detection - cross platform, major ruby interpreters
Ruby
83
star
27

verse

[DEPRECATED] Text transformations
Ruby
71
star
28

tty-cursor

Terminal cursor movement and manipulation of cursor properties such as visibility
Ruby
68
star
29

supervision

Write distributed systems that are resilient and self-heal.
Ruby
66
star
30

tty-file

File manipulation utility methods
Ruby
65
star
31

tty-config

A highly customisable application configuration interface for building terminal tools.
Ruby
61
star
32

benchmark-trend

Measure performance trends of Ruby code
Ruby
59
star
33

tty-font

Terminal fonts
Ruby
58
star
34

lex

Lex is an implementation of lex tool in Ruby.
Ruby
56
star
35

tty-tree

Print directory or structured data in a tree like format
Ruby
56
star
36

strings-truncation

Truncate strings with fullwidth characters and ANSI codes.
Ruby
49
star
37

tty-pager

Terminal output paging - cross-platform, major ruby interpreters
Ruby
39
star
38

tty-color

Terminal color capabilities detection
Ruby
35
star
39

slideck

Present Markdown-powered slide decks in the terminal.
Ruby
34
star
40

strings-inflection

Convert between singular and plural forms of English nouns
Ruby
31
star
41

tty-link

Hyperlinks in your terminal
Ruby
31
star
42

tty-platform

Operating system detection
Ruby
29
star
43

tty-sparkline

Sparkline charts for terminal applications.
Ruby
29
star
44

tty-editor

Opens a file or text in the user's preferred editor
Ruby
27
star
45

communist

Library for mocking CLI calls to external APIs
Ruby
25
star
46

splay_tree

A self-balancing binary tree optimised for fast access to frequently used nodes.
Ruby
24
star
47

equatable

Allows ruby objects to implement equality comparison and inspection methods.
Ruby
24
star
48

minehunter

Terminal mine hunting game.
Ruby
23
star
49

rotation.js

Responsive and mobile enabled jQuery plugin to help create rotating content.
JavaScript
22
star
50

strings-numeral

Express numbers as string numerals
Ruby
20
star
51

strings-ansi

Handle ANSI escape codes in strings
Ruby
19
star
52

benchmark-malloc

Trace memory allocations and collect stats
Ruby
19
star
53

tty-which

Cross-platform implementation of Unix `which` command
Ruby
17
star
54

tty-runner

A command routing tree for terminal applications
Ruby
12
star
55

benchmark-perf

Benchmark execution time and iterations per second
Ruby
12
star
56

impact

Ruby backend for Impact.js framework
Ruby
8
star
57

queen

English language linter to hold your files in high esteem.
Ruby
8
star
58

pastel-cli

CLI tool for intuitive terminal output styling
Ruby
7
star
59

dotfiles

Configuration files for Unix tools
Vim Script
7
star
60

tty-markdown-cli

CLI tool for displaying nicely formatted Markdown documents in the terminal
Ruby
7
star
61

static_deploy

Automate deployment of static websites
Ruby
6
star
62

tenpin

Terminal tenpin bowling game
Ruby
4
star
63

tytus

Helps you manage page titles in your Rails app.
Ruby
3
star
64

tty.github.io

TTY toolkit website.
SCSS
2
star
65

peter-murach.github.com

Personal webpage
JavaScript
2
star
66

wc.rb

A Ruby clone of Unix wc utility.
Ruby
2
star
67

exportable

Rails plugin to ease exporting tasks.
Ruby
1
star
68

capistrano-git-stages

Multistage capistrano git tags
Ruby
1
star
69

tabster

Ruby
1
star
70

leek

Cucumber steps and RSpec expectations for command line apps
Ruby
1
star
71

unicorn.github.io

Website for the github_api and github_cli ruby gems.
CSS
1
star
72

tty-color-cli

CLI tool for terminal color capabilities detection
Ruby
1
star
73

finite_machine.github.io

Website for finite_machine Ruby gem
SCSS
1
star
74

strings-wrapping

Wrap strings with fullwidth characters and ANSI codes
Ruby
1
star