web_translate_it 2.1.4 → 2.1.5

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: c8f1709ba300f3590336b4bb2784be4b2a892e7d
4
- data.tar.gz: f91e276b15ff4abeb8a549af23c2d410170aaf7e
3
+ metadata.gz: ab701d78f58fb19e9558b5629385213f9c00c714
4
+ data.tar.gz: 0c72991d950ecad7e590541de0492fc010b73f8a
5
5
  SHA512:
6
- metadata.gz: ecf00b1a30d4229d478bb7b9200a56a9ea585a389f997b81ac854043b51d4c95012b9b4336a5e6cb894e704c5ca0c0b45ce6b0c5e480083acf0cbbeceb79e3bc
7
- data.tar.gz: f3a5d8b2e562517e47da0f52fb77ac9b297870a1d1098a15e14a4a4660db4c0d02730a95adf0fb2c2a418a0d430bd7bf0d2808b416b97daf5bd33866bb154d66
6
+ metadata.gz: 9bb26f6986c7ad7823b6cecf2056a129913ffc6b882c4df8122ade59f5335c5d85df1f4e4059bd58d1ecc1abf185eef90e72aec8e1c2e8c82be2d384a05b9b03
7
+ data.tar.gz: 0466cefbe3af9abc642772539d88f13cf6626c2fc329fde8cb83ca5ee75fe8b8b72dcae2370914c37807e2e34bc07a83da76a46e6eda367c199b824ec458c713
data/history.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## Version 2.1.5 / 2013-07-01
2
+
3
+ * Tweak `wti pull` to use up to 10 threads.
4
+
1
5
  ## Version 2.1.4 / 2013-07-01
2
6
 
3
7
  * Update `WebTranslateIt.fetch_translations`.
@@ -44,7 +44,8 @@ module WebTranslateIt
44
44
  # Now actually pulling files
45
45
  time = Time.now
46
46
  threads = []
47
- ArrayUtil.chunk(files, 2).each do |file_array|
47
+ n_threads = (files.size.to_f/3).ceil >= 10 ? 10 : (files.size.to_f/3).ceil
48
+ ArrayUtil.chunk(files, n_threads).each do |file_array|
48
49
  unless file_array.empty?
49
50
  threads << Thread.new(file_array) do |file_array|
50
51
  WebTranslateIt::Connection.new(configuration.api_key) do |http|
@@ -57,7 +58,7 @@ module WebTranslateIt
57
58
  end
58
59
  threads.each { |thread| thread.join }
59
60
  time = Time.now - time
60
- puts "Pulled #{files.size} files at #{(files.size/time).round} files/sec."
61
+ puts "Pulled #{files.size} files at #{(files.size/time).round} files/sec, using #{n_threads} threads."
61
62
  `#{configuration.after_pull}` if configuration.after_pull
62
63
  end
63
64
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: web_translate_it
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.4
4
+ version: 2.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edouard Briere