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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e788b0e4f387c4644af1b2cdf2e3807d418bcc68
4
- data.tar.gz: 53efe316b90f9c352c02e676a602c23462969920
3
+ metadata.gz: ca1dbd921b5d79d0ec3ece5ad278ba4e5f06416f
4
+ data.tar.gz: aba073a0c18c20be741892f32ba0ff7c2421a50a
5
5
  SHA512:
6
- metadata.gz: 3c5a98ef6c7ee6fe67a2f78e8d9ff040fb9d460b920af5b7b164ec5a086e6b17ccae4f4094d1550496eec6b2ce60780a0f0ce9626d03d500dd9e8687dbbce135
7
- data.tar.gz: 6746b969db1b1abf34c3b5fbf216b9e9f3de482fd3953c1cff36503931f5d43e2dff4897f6b9c789769a31f73d8449725c83c4a9e4973c05ded6b75e3abd786c
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 title = options[:progress]
204
+ if progress_options = options[:progress]
205
205
  raise "Progressbar and producers don't mix" if items.producer?
206
206
  require 'ruby-progressbar'
207
- progress = ProgressBar.create(
208
- :title => title,
209
- :total => items.size,
210
- :format => '%t |%E | %B | %a'
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
@@ -1,3 +1,3 @@
1
1
  module Parallel
2
- VERSION = Version = '1.4.0'
2
+ VERSION = Version = '1.4.1'
3
3
  end
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.0
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-02-16 00:00:00.000000000 Z
11
+ date: 2015-03-01 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: michael@grosser.it