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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 11290960cd496e43b8e7c9314769ffc8a3554daa
4
- data.tar.gz: bfc4d8c942312266e0fbe3ebc66f0fd19923fffe
3
+ metadata.gz: b782b32cca741c787a2595a4692c1904604b6780
4
+ data.tar.gz: c53c54728e088a6fb4e22b53b4d0099f262dec07
5
5
  SHA512:
6
- metadata.gz: 90cd2a5f9af376e208f64483b416ea23cb92de3ac03eb8c5fbb2cf86576717d846dfaa8a3d0dd8a183a4543c855b81978829b09325e7b0e7f32283b8ff69dcfa
7
- data.tar.gz: 066e43a835be012a025536bbfcf0f2ff7ed8bd50a9295d760b44b3f10492be3496e36154ff816717126dd0dd3b53cd1152340b01db025b60e46a30609a65e9d3
6
+ metadata.gz: 1eb84cf76fe029ff5b93927d0e9ff943177e3e9ab122791e7bbb389d4980efa4251bec521560738a5ac82694ee02bab727790672c4bff4e6b858a8f67fe1bdbb
7
+ data.tar.gz: 09fa5d0d9689cdff82a3d34b81b06ca99e8b3ccfbe9415837ee73824b2993a6aebe251aa84e6f554ef9d455322bf9d8c955411ff5c334a8ff5c5a7d94acec008
Binary file
data.tar.gz.sig CHANGED
@@ -1 +1 @@
1
- 0;���+� T��i��9��|�!m<%��ig��k��i̐��ug��ր�9�����*�KɁ[��hC�$ՕQ{Lp��h�k�+±Qg?m� ^�qea��-')���丽T-�\��>�a�����4�|y[�@A5GJ�I��e��"���GKXӅ�78Xr����+�^Fb��=�ة��-�u'��'D���)H����?ڣ���ac�j#�������Ns��y�I;��۴
1
+ p'/̭�'f����w�{�rW(�#c\T��v B� Sxq0��� bSmXCb�-��9�}܈h/t ]'����ś �e�gM`��s�۟dV����k�`r��6!b���ɐ���مfu
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Parallel
2
- VERSION = Version = '1.2.0'
2
+ VERSION = Version = '1.2.1'
3
3
  end
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.0
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-07 00:00:00.000000000 Z
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
- gq��E�R}���cZ5CaEN8*���1����X�UPn'�<΁}f�$�� �Sbbo�R+���<��~B����>wL��w�<?��]\���k����{~`$g��Y�Eڑ�|�|9��C�0�4�:�H�T�8�P���t�W{��5��1.vbɹU��1<o�V�֮خiȇ��M:��/FT>͌�-ƣN�;5^ɮn��{�5Pؕb�&�ہ��tϮ8�S^���������QD�M�ɳB�t�ͬ���
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��~�