percheron 0.7.5 → 0.7.6

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: 60e75ad43ed6c18a865ea07d76f9fa2b1d893eed
4
- data.tar.gz: 54207bfa168a15d727ba18bba758bf40d4d885f6
3
+ metadata.gz: ca4e159e1d216215067cbfa7373ae6dbda91fd85
4
+ data.tar.gz: c8ce94ce02c64514de86526cdc5447912b6acac0
5
5
  SHA512:
6
- metadata.gz: af2d8a877d52f2a51b76c69b809b6773b26d7a22ac3e6acbb4dcce2673257d9302fc9d2079d5af7564f9e92ce8150d859ed16d4c512195f5832ca89bc7ba9afd
7
- data.tar.gz: ad859eabacf9550306947c969dff212fb7aa9b2bb888ab87acc20bb6a4ed1e208f303a04a6cf55a27cc6d75f84df48a92d76e85ffa048e335e1569a3c0fb0a30
6
+ metadata.gz: 84e0e88ff4a08b0af7e009b1c67d2b2f19755d063be8e0b81308f4ae174a238d8ce3fb645d93b47215a688ae6121c3666a6b263e9d24976b26b22e1aae36ca59
7
+ data.tar.gz: ed372015a2a72aec541b29f5263e053eab8c3e00a0d8dbe69456e9e991d56ec16a84a0a265a49ee80cc8e0b2a06eb074b56f9eb1df7f2595ca27f52b68f3fca0
@@ -39,15 +39,16 @@ module Percheron
39
39
  end
40
40
 
41
41
  def extra_docker_opts
42
- if cert_path
43
- {
44
- client_cert: File.join(cert_path, 'cert.pem'),
45
- client_key: File.join(cert_path, 'key.pem'),
46
- ssl_ca_file: File.join(cert_path, 'ca.pem')
47
- }
48
- else
49
- {}
50
- end
42
+ return {} unless cert_path
43
+ {
44
+ client_cert: cert_path_for('cert.pem'),
45
+ client_key: cert_path_for('key.pem'),
46
+ ssl_ca_file: cert_path_for('ca.pem')
47
+ }
48
+ end
49
+
50
+ def cert_path_for(file)
51
+ File.join(cert_path, file)
51
52
  end
52
53
 
53
54
  end
@@ -35,24 +35,22 @@ module Percheron
35
35
  end
36
36
 
37
37
  def rows
38
- resp = {}
39
- queue_jobs(resp)
38
+ queue_jobs
40
39
  process_queue!
41
- sort_rows(resp)
42
40
  end
43
41
 
44
- def queue_jobs(resp)
45
- stack.containers.map do |_, container|
46
- queue << Thread.new { resp[Time.now.to_f] = row_for(container) }
47
- end
42
+ def queue_jobs
43
+ stack.containers.map { |_, container| queue << row_for(container) }
48
44
  end
49
45
 
50
46
  def process_queue!
51
- queue.length.times { queue.pop.join }
52
- end
53
-
54
- def sort_rows(resp)
55
- resp.sort.map { |_, row| row.flatten }
47
+ resp = []
48
+ 4.times.map do
49
+ Thread.new do
50
+ queue.size.times { resp << queue.pop(true) }
51
+ end
52
+ end.map(&:join)
53
+ resp
56
54
  end
57
55
 
58
56
  def row_for(container)
@@ -1,3 +1,3 @@
1
1
  module Percheron
2
- VERSION = '0.7.5'
2
+ VERSION = '0.7.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: percheron
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.5
4
+ version: 0.7.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ash McKenzie