Skip to content

Commit

Permalink
Add lazy infinite enumerator with bounded progression in ref to issue #…
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrmurach committed Jan 15, 2018
1 parent 54c2498 commit 18af6ca
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/lazy.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
require_relative '../lib/tty-progressbar'

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

range = 1..Float::INFINITY
bar.iterate(range.lazy) { sleep(0.1) }

0 comments on commit 18af6ca

Please sign in to comment.