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_organization_ruby-0.62.63 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_id_ruby-0.62.63 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_id_ruby-0.62.62 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_bank_ruby-0.62.62 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_organization_ruby-0.62.62 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_id_ruby-0.62.61 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_bank_ruby-0.62.61 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_organization_ruby-0.62.61 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_bank_ruby-0.62.60 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_id_ruby-0.62.60 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_organization_ruby-0.62.60 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_bank_ruby-0.62.58 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_id_ruby-0.62.58 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_organization_ruby-0.62.58 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
ory-client-1.1.21 vendor/bundle/ruby/2.5.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
ory-client-1.1.20 vendor/bundle/ruby/2.5.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_bank_ruby-0.62.55 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_id_ruby-0.62.55 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_organization_ruby-0.62.55 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_bank_ruby-0.62.54 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb