Sha256: 0092e0d86b563f5564dd0acd2f3492788a994a31b14fd79d7f66804ee123575e

Contents?: true

Size: 462 Bytes

Versions: 118

Compression:

Stored size: 462 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_given?

    chain.each(&block)
  end
end
end
end
end

Version data entries

118 entries across 72 versions & 21 rubygems

Version Path
paynow_sdk-0.1.4 vendor/cache/ruby/2.7.0/gems/paynow_sdk-0.1.0/vendor/cache/ruby/2.7.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/refinements/enumerator.rb
paynow_sdk-0.1.4 vendor/cache/ruby/2.7.0/gems/paynow_sdk-0.1.2/vendor/cache/ruby/2.7.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/refinements/enumerator.rb
paynow_sdk-0.1.4 vendor/cache/ruby/2.7.0/gems/paynow_sdk-0.1.3/vendor/cache/ruby/2.7.0/gems/paynow_sdk-0.1.0/vendor/cache/ruby/2.7.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/refinements/enumerator.rb
paynow_sdk-0.1.4 vendor/cache/ruby/2.7.0/gems/paynow_sdk-0.1.3/vendor/cache/ruby/2.7.0/gems/paynow_sdk-0.1.2/vendor/cache/ruby/2.7.0/gems/paynow_sdk-0.1.0/vendor/cache/ruby/2.7.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/refinements/enumerator.rb
paynow_sdk-0.1.4 vendor/cache/ruby/2.7.0/gems/paynow_sdk-0.1.3/vendor/cache/ruby/2.7.0/gems/paynow_sdk-0.1.2/vendor/cache/ruby/2.7.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/refinements/enumerator.rb
paynow_sdk-0.1.4 vendor/cache/ruby/2.7.0/gems/paynow_sdk-0.1.3/vendor/cache/ruby/2.7.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/refinements/enumerator.rb
paynow_sdk-0.1.4 vendor/cache/ruby/2.7.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/refinements/enumerator.rb
paynow_sdk-0.1.2 vendor/cache/ruby/2.7.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/refinements/enumerator.rb
paynow_sdk-0.1.2 vendor/cache/ruby/2.7.0/gems/paynow_sdk-0.1.0/vendor/cache/ruby/2.7.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/refinements/enumerator.rb
paynow_sdk-0.1.1 vendor/cache/ruby/2.7.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/refinements/enumerator.rb
paynow_sdk-0.1.1 vendor/cache/ruby/2.7.0/gems/paynow_sdk-0.1.0/vendor/cache/ruby/2.7.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/refinements/enumerator.rb
paynow_sdk-0.1.0 vendor/cache/ruby/2.7.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/refinements/enumerator.rb
files.com-1.0.1 vendor/bundle/ruby/2.5.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/refinements/enumerator.rb
chikari_palindrome-0.1.0 vendor/cache/ruby/2.7.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/refinements/enumerator.rb
chikari_palindrome-0.1.0 vendor/cache/ruby/2.7.0/gems/chikari_palindrome-0.1.0/vendor/cache/ruby/2.7.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/refinements/enumerator.rb
talon_one-2.0.0 vendor/bundle/ruby/2.7.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/refinements/enumerator.rb
talon_one-2.0.0 vendor/bundle/ruby/2.3.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/refinements/enumerator.rb
hirohig_palindrome-0.2.0 vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/refinements/enumerator.rb
hirohig_palindrome-0.1.0 vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/refinements/enumerator.rb
grape-extra_validators-1.0.0 vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.10.1/lib/ruby-progressbar/refinements/enumerator.rb