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

Version Path
avalara_sdk-24.12.2 vendor/bundle/ruby/2.7.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
avalara_sdk-24.12.1 vendor/bundle/ruby/2.7.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
avalara_sdk-24.12.0 vendor/bundle/ruby/2.7.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
mux_ruby-3.20.0 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
mux_ruby-3.19.0 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
mux_ruby-3.18.0 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
mux_ruby-3.17.0 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
mux_ruby-3.15.0 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
avalara_sdk-24.2.29 vendor/bundle/ruby/2.7.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
mux_ruby-3.14.0 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
mux_ruby-3.13.0 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
mux_ruby-3.12.0 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
mux_ruby-3.11.1 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
mux_ruby-3.11.0 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_organization_ruby-0.62.69 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/refinements/enumerator.rb