Sha256: 2a08b6284f93040d0553ab81f0e8e79a042147c0f9881e734c102efbad9eba77
Contents?: true
Size: 455 Bytes
Versions: 2583
Compression:
Stored size: 455 Bytes
Contents
class ProgressBar module Refinements module Enumerator refine ::Enumerator do def with_progressbar(options = {}, &block) chain = ::Enumerator.new do |yielder| progress_bar = ProgressBar.create(options.merge(:starting_at => 0, :total => size)) each do |*args| yielder.yield(*args).tap do progress_bar.increment end end end return chain unless block chain.each(&block) end end end end end
Version data entries
2,583 entries across 2,580 versions & 23 rubygems