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_id_ruby-0.62.54 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_organization_ruby-0.62.54 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_id_ruby-0.62.53 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_bank_ruby-0.62.53 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_organization_ruby-0.62.53 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_bank_ruby-0.62.52 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_id_ruby-0.62.52 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_organization_ruby-0.62.52 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_organization_ruby-0.62.51 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_bank_ruby-0.62.51 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_id_ruby-0.62.51 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_id_ruby-0.62.50 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_bank_ruby-0.62.50 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_organization_ruby-0.62.50 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_bank_ruby-0.62.49 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_organization_ruby-0.62.49 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_id_ruby-0.62.49 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_bank_ruby-0.62.48 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_id_ruby-0.62.48 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb
cybrid_api_organization_ruby-0.62.48 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/refinements/enumerator.rb