docker-api 1.33.3 → 1.33.4

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: 42767ab7e841489031343b1c14c4d532e7591dfc
4
- data.tar.gz: 077fe4007fe57982b97ca4a4b9c6cc420cd1ce83
3
+ metadata.gz: bc4cc0582b0d1790debfb8be47bb928f5c1a92c8
4
+ data.tar.gz: ec329aa7f8fcbdf7991faa44ca5a54cb962d8dc0
5
5
  SHA512:
6
- metadata.gz: 34340f2ca5efe8fd76ee137414d3ebcda7ad51e31bb15beb8974e679fc652fde4658119b106bffca1d606d58d1b9400c07c5bc102eaf6e1ec32d2768577e561f
7
- data.tar.gz: 288c5fd826ddce4c543d305cbabdf390e034b866f19b352c6368a08a441cbfc23ddd10c277f2728a4ef6fd6b00d63fb678734224f2e42d7af86b5e5e4eb3e1a5
6
+ metadata.gz: 707a35dfc34923c91c0f41971c1932749b932396a8a3f8b345630754a07113faa23be27a8af5b4838c4ed6b8f783e24e49d1e416fbfb9a98734f9ee9a246f7e1
7
+ data.tar.gz: c40703a85329908dc1ca5654fc4e59af856db02504e6b50029f2170f4e465d6d39984aee1b417abfe0c36145578ab2df9263b3b6c6362b4ea4fdb499e7d39a60
data/README.md CHANGED
@@ -339,6 +339,13 @@ container.kill(:signal => "SIGHUP")
339
339
  container.top
340
340
  # => [{"PID"=>"4851", "TTY"=>"pts/0", "TIME"=>"00:00:00", "CMD"=>"lxc-start"}]
341
341
 
342
+ # Same as above, but uses the original format
343
+ container.top(format: :hash)
344
+ # => {
345
+ # "Titles" => ["PID", "TTY", "TIME", "CMD"],
346
+ # "Processes" => [["4851", "pts/0", "00:00:00", "lxc-start"]]
347
+ # }
348
+
342
349
  # To expose 1234 to bridge
343
350
  # In Dockerfile: EXPOSE 1234/tcp
344
351
  # docker run resulting-image-name
@@ -17,11 +17,12 @@ class Docker::Container
17
17
 
18
18
  # Return a List of Hashes that represents the top running processes.
19
19
  def top(opts = {})
20
+ format = opts.delete(:format) { :array }
20
21
  resp = Docker::Util.parse_json(connection.get(path_for(:top), opts))
21
22
  if resp['Processes'].nil?
22
- []
23
+ format == :array ? [] : {}
23
24
  else
24
- resp['Processes'].map { |ary| Hash[resp['Titles'].zip(ary)] }
25
+ format == :array ? resp['Processes'].map { |ary| Hash[resp['Titles'].zip(ary)] } : resp
25
26
  end
26
27
  end
27
28
 
@@ -1,6 +1,6 @@
1
1
  module Docker
2
2
  # The version of the docker-api gem.
3
- VERSION = '1.33.3'
3
+ VERSION = '1.33.4'
4
4
 
5
5
  # The version of the compatible Docker remote API.
6
6
  API_VERSION = '1.16'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.33.3
4
+ version: 1.33.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Swipely, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-02 00:00:00.000000000 Z
11
+ date: 2017-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon