parallel 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +1 -1
- data/lib/parallel.rb +14 -0
- data/lib/parallel/version.rb +1 -1
- metadata +2 -2
- metadata.gz.sig +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b782b32cca741c787a2595a4692c1904604b6780
|
4
|
+
data.tar.gz: c53c54728e088a6fb4e22b53b4d0099f262dec07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1eb84cf76fe029ff5b93927d0e9ff943177e3e9ab122791e7bbb389d4980efa4251bec521560738a5ac82694ee02bab727790672c4bff4e6b858a8f67fe1bdbb
|
7
|
+
data.tar.gz: 09fa5d0d9689cdff82a3d34b81b06ca99e8b3ccfbe9415837ee73824b2993a6aebe251aa84e6f554ef9d455322bf9d8c955411ff5c334a8ff5c5a7d94acec008
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
p'/̭�'f����w�{�rW(�#c\T��v B� Sxq0��� bSmXCb�-��9�}܈h/t ]'����ś�e�g�M`��s�۟d�V����k�`r��6!b���ɐ���مfu
|
data/lib/parallel.rb
CHANGED
@@ -112,6 +112,8 @@ module Parallel
|
|
112
112
|
end
|
113
113
|
size = [array.size, size].min
|
114
114
|
|
115
|
+
add_progress_bar!(array, options)
|
116
|
+
|
115
117
|
if size == 0
|
116
118
|
work_direct(array, options, &block)
|
117
119
|
elsif method == :in_threads
|
@@ -121,6 +123,18 @@ module Parallel
|
|
121
123
|
end
|
122
124
|
end
|
123
125
|
|
126
|
+
def add_progress_bar!(array, options)
|
127
|
+
if (title = options[:progress]) && !options[:finish]
|
128
|
+
require 'ruby-progressbar'
|
129
|
+
progress = ProgressBar.create(
|
130
|
+
:title => title,
|
131
|
+
:total => array.size,
|
132
|
+
:format => '%t |%E | %B | %a'
|
133
|
+
)
|
134
|
+
options[:finish] = lambda { |item, i, result| progress.increment }
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
124
138
|
def map_with_index(array, options={}, &block)
|
125
139
|
map(array, options.merge(:with_index => true), &block)
|
126
140
|
end
|
data/lib/parallel/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parallel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
F5etKHZg0j3eHO31/i2HnswY04lqGImUu6aM5EnijFTB7PPW2KwKKM4+kKDYFdlw
|
31
31
|
/0WV1Ng2/Y6qsHwmqGg2VlYj2h4=
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2014-08-
|
33
|
+
date: 2014-08-12 00:00:00.000000000 Z
|
34
34
|
dependencies: []
|
35
35
|
description:
|
36
36
|
email: michael@grosser.it
|
metadata.gz.sig
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
���Ň$�Gf֪�R�y�~�J�����s�k�!�%���[��&�;��y�(�į;���9�ؼWA��U����{½7�fAƈ���<5���Pb
|
2
|
+
���e8O-�G�h�H�;���Z���bA��Z�|�x��!������g2j�d����E���N�ƅA�.�[A:���2���de��rU-5���dǟ��2d�U�����ͷ�j{ɝMUn!�)���>,:^�O#u*�2D*��(�g����N��~�
|