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
cybrid_api_bank_ruby-0.62.47 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_id_ruby-0.62.47 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_organization_ruby-0.62.47 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
ory-client-1.1.19 vendor/bundle/ruby/2.5.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
ory-client-1.1.18 vendor/bundle/ruby/2.5.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
primary_connect_proto-0.20.0 vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
primary_connect_proto-0.20.0 vendor/bundle/ruby/3.0.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_bank_ruby-0.62.46 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_id_ruby-0.62.46 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_organization_ruby-0.62.46 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_bank_ruby-0.62.45 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_id_ruby-0.62.45 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_organization_ruby-0.62.45 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
devcycle-ruby-server-sdk-2.0.0 vendor/bundle/ruby/3.0.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
zilla-0.2.0 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
ory-keto-client-0.11.0.alpha0 vendor/bundle/ruby/2.5.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_id_ruby-0.62.44 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_organization_ruby-0.62.44 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_bank_ruby-0.62.44 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
mux_ruby-3.9.0 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb