progressbar 1.12.0 → 1.13.0rc1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fed7ad39c43e9cf2fc85b87d1ffa94981e94e7e796ab8526f1357be3e186eab2
4
- data.tar.gz: 91f458a9dc472ffad2bc83bcc5c9d65902c90dc9a4cf4587da51bcdd5874f37c
3
+ metadata.gz: 600c4958d5a0334a7b8c57e026f018d2fbbb16e5dd03b9abc1a989a36b008466
4
+ data.tar.gz: 895e70eb9b8cc7ca96d86f06e8cc8f6dd36171faa2ea61cd868541b748fdb975
5
5
  SHA512:
6
- metadata.gz: 5c708755ac0db269805376f4f4285377b24cbbc78e765a9ef7f83fe469bc9f85cdd552c4d62f76fc4005e70b8e7b5e4517aa945fcd0adbeedef1d93c983baff2
7
- data.tar.gz: a9d7ebd15e82250a46cf6dd8c41c88e239aa5fbf43c1544b6f629aa3b383c28f3984aba1ff3b7b3d255058237bce401a7092f1b1ac026b04d8a832ad2063c819
6
+ metadata.gz: cd5be8205221bd7701b32a2174465bab687195e3b764d19c1ccfa1f6a748162eaed3f2259b21f06f8d4a1070c899ef6cfc262f02e6cd7409990b7ac4295fcfe3
7
+ data.tar.gz: e470d4c737a328d6aad8dbb58796408256b63c4d5efd21ef2e730141cd3ce817b6a4c0d14dec4db2165b6f73d02dcf6ee221f54432a7abd226864dd4416fcd75
checksums.yaml.gz.sig CHANGED
Binary file
@@ -0,0 +1,28 @@
1
+ class ProgressBar
2
+ module Refinements
3
+ module Enumerator
4
+ ARITY_ERROR_MESSAGE = 'Only two arguments allowed to be passed to ' \
5
+ 'with_progressbar (item, progress_bar)'.freeze
6
+
7
+ refine ::Enumerator do
8
+ def with_progressbar(options = {}, &block)
9
+ progress_bar = ProgressBar.create(options.merge(:starting_at => 0, :total => size))
10
+
11
+ each do |item|
12
+ progress_bar.increment
13
+
14
+ next unless block
15
+
16
+ yielded_args = []
17
+ yielded_args << item if block.arity > 0
18
+ yielded_args << progress_bar if block.arity > 1
19
+
20
+ fail ::ArgumentError, ARITY_ERROR_MESSAGE if block.arity > 2
21
+
22
+ yield(*yielded_args)
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -1 +1 @@
1
- require 'ruby-progressbar/refinements/enumerator'
1
+ require 'ruby-progressbar/refinements/progress_enumerator'
@@ -1,3 +1,3 @@
1
1
  class ProgressBar
2
- VERSION = '1.12.0'.freeze
2
+ VERSION = '1.13.0rc1'.freeze
3
3
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: progressbar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.0
4
+ version: 1.13.0rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - thekompanee
@@ -125,7 +125,7 @@ files:
125
125
  - lib/ruby-progressbar/outputs/tty.rb
126
126
  - lib/ruby-progressbar/progress.rb
127
127
  - lib/ruby-progressbar/refinements.rb
128
- - lib/ruby-progressbar/refinements/enumerator.rb
128
+ - lib/ruby-progressbar/refinements/progress_enumerator.rb
129
129
  - lib/ruby-progressbar/throttle.rb
130
130
  - lib/ruby-progressbar/time.rb
131
131
  - lib/ruby-progressbar/timer.rb
@@ -136,7 +136,7 @@ licenses:
136
136
  metadata:
137
137
  bug_tracker_uri: https://github.com/jfelchner/ruby-progressbar/issues
138
138
  changelog_uri: https://github.com/jfelchner/ruby-progressbar/blob/master/CHANGELOG.md
139
- documentation_uri: https://github.com/jfelchner/ruby-progressbar/tree/releases/v1.12.0
139
+ documentation_uri: https://github.com/jfelchner/ruby-progressbar/tree/releases/v1.13.0rc1
140
140
  homepage_uri: https://github.com/jfelchner/ruby-progressbar
141
141
  source_code_uri: https://github.com/jfelchner/ruby-progressbar
142
142
  wiki_uri: https://github.com/jfelchner/ruby-progressbar/wiki
@@ -151,9 +151,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
151
151
  version: '0'
152
152
  required_rubygems_version: !ruby/object:Gem::Requirement
153
153
  requirements:
154
- - - ">="
154
+ - - ">"
155
155
  - !ruby/object:Gem::Version
156
- version: '0'
156
+ version: 1.3.1
157
157
  requirements: []
158
158
  rubygems_version: 3.1.6
159
159
  signing_key:
metadata.gz.sig CHANGED
Binary file
@@ -1,23 +0,0 @@
1
- class ProgressBar
2
- module Refinements
3
- module Enumerator
4
- refine ::Enumerator do
5
- def with_progressbar(options = {}, &block)
6
- chain = ::Enumerator.new do |yielder|
7
- progress_bar = ProgressBar.create(options.merge(:starting_at => 0, :total => size))
8
-
9
- each do |*args|
10
- yielder.yield(*args).tap do
11
- progress_bar.increment
12
- end
13
- end
14
- end
15
-
16
- return chain unless block
17
-
18
- chain.each(&block)
19
- end
20
- end
21
- end
22
- end
23
- end