parallel 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/parallel.rb +12 -6
- data/lib/parallel/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca1dbd921b5d79d0ec3ece5ad278ba4e5f06416f
|
4
|
+
data.tar.gz: aba073a0c18c20be741892f32ba0ff7c2421a50a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ed2cc642c77c45eb234d18f9a39a53891d16a3f55cde102a91167e8e1b0a0fe1120f9e33da692b08fabd676265d8c471fc6668f64b714fc6f4d93410cea4723
|
7
|
+
data.tar.gz: 74b5c077ffd1ae61e3bf4e1b8cf8f5662058b2bbe73adf8882f212a1c72a183545767eb86e2a7647ca1dbba422beabab5b76d5822dc1f3537a77be1f46ff4bb6
|
data/lib/parallel.rb
CHANGED
@@ -201,14 +201,20 @@ module Parallel
|
|
201
201
|
private
|
202
202
|
|
203
203
|
def add_progress_bar!(items, options)
|
204
|
-
if
|
204
|
+
if progress_options = options[:progress]
|
205
205
|
raise "Progressbar and producers don't mix" if items.producer?
|
206
206
|
require 'ruby-progressbar'
|
207
|
-
|
208
|
-
|
209
|
-
:
|
210
|
-
|
211
|
-
|
207
|
+
|
208
|
+
if progress_options.respond_to? :to_str
|
209
|
+
progress_options = { title: progress_options.to_str }
|
210
|
+
end
|
211
|
+
|
212
|
+
progress_options = {
|
213
|
+
total: items.size,
|
214
|
+
format: '%t |%E | %B | %a'
|
215
|
+
}.merge(progress_options)
|
216
|
+
|
217
|
+
progress = ProgressBar.create(progress_options)
|
212
218
|
old_finish = options[:finish]
|
213
219
|
options[:finish] = lambda do |item, i, result|
|
214
220
|
old_finish.call(item, i, result) if old_finish
|
data/lib/parallel/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parallel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: michael@grosser.it
|