0.0
Low commit activity in last 3 years
A long-lived project that still receives updates
non-fancy progress
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

> 1.10
~> 12.3.3
>= 0
 Project Readme

Fortschritt

  • no colors
  • no config
  • no tty stuff
  • no terminal size calculation
  • no dependencies

fortschritt

Installation

Add this line to your application's Gemfile:

gem 'fortschritt'

And then execute:

$ bundle

Or install it yourself as:

$ gem install fortschritt

Usage

Start a progress bar by calling with_fortschritt on an Enumerable or an ActiveRecord::Relation.

It will create a new progress bar, that will be incremented by calling Fortschritt.increment.

However, for convenience you can call #fortschritt on your iterated objects as well. It will call Fortschritt.increment and return self, so you can chain it up nicely.

User.all.with_fortschritt.find_each do |user|
  user.fortschritt.valid?
end

# will print something like this: 1616/145096 → 00:13:21 → ETA 2016-02-04 18:11:50

Silent

If no output is required or wanted invoke with_fortschritt with the silent: true option

User.all.with_fortschritt(silent: true).find_each do |user|
  user.fortschritt.valid?
end

# won't output any progress

Please note, within a Rails application fortschritt will detect the Rails.env.test? environment and silent itself automatically.

Fortschritt will also never output anything to a non-tty STDOUT.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/xijo/fortschritt.