docker-rails 0.5.4 → 0.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4bea08b80bfee7c817a0d284f58c74cc0e61638e
4
- data.tar.gz: f653e9e076dc95d265cb2c0ad6aefe2735f0bc2c
3
+ metadata.gz: 7eb88cd9b794b62bc7fedee59bcd268c70de4f1a
4
+ data.tar.gz: 6fb60e2193429ebc30293a1fb4749d6b96857afd
5
5
  SHA512:
6
- metadata.gz: 41d7d30694f656d154ab484fea66222188bd564516eb40fddbefc07dde15eed7971a600bdc6e0af5ce549b943cd15860ddef44c810b3c897e11ac7f9da54c595
7
- data.tar.gz: 980a7d3cd628c9100ef9fd6b0a65fd834a0a4b1c221a7c40004a42ad233ebcd01870333e54d8e922baa96b1fe8864b8e3cad85733b19e6b7ad03a411d2838d54
6
+ metadata.gz: 12a4b5f27c099df989887ebdc60e0d10575b5f4d56858eeb7844dd3c091fdb3a34b3c1a6597bde099d44c8c5c7737be08d45da3700fbc138441366fe6a500c30
7
+ data.tar.gz: c09b0928a79b8ed1e51a647f1ec94823d187d8c265ceb0c50caa97da7da13e35dd5c40e9fdd71837db732fa372370c82f2a36f7957ff9e131a92ec1b82215fb4
@@ -1,11 +1,27 @@
1
1
  class Docker::Container
2
2
 
3
- def name
4
- info['Names'][0].gsub(/^\//, '')
3
+ # Update the @info hash, which is the only mutable state in this object.
4
+ def refresh!
5
+ other = Docker::Container.all({all: true}, connection).find { |c|
6
+ c.id.start_with?(self.id) || self.id.start_with?(c.id)
7
+ }
8
+
9
+ info.merge!(self.json)
10
+ other && info.merge!(other.info)
11
+ self
5
12
  end
6
13
 
7
14
  def status
8
- info['Status']
15
+ # info is cached, return the first one otherwise retrieve a new container and get the status from it
16
+ refresh!
17
+
18
+ status = info['Status']
19
+ puts status
20
+ status
21
+ end
22
+
23
+ def name
24
+ info['Names'][0].gsub(/^\//, '')
9
25
  end
10
26
 
11
27
  def up?
@@ -1,5 +1,5 @@
1
1
  module Docker
2
2
  module Rails
3
- VERSION = '0.5.4'
3
+ VERSION = '0.5.5'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Ross
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-30 00:00:00.000000000 Z
11
+ date: 2015-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler