docker-compose-api 1.1.6 → 1.1.8

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
  SHA256:
3
- metadata.gz: d197a1015b92d32a1ef737d833f74a3de2133d4e023349d6ea456757a91a4608
4
- data.tar.gz: d02c4c0d29247ee89c85a78064b7e679ada643313e4d49e3a4c08b9c7cf3ba6b
3
+ metadata.gz: 944f7aa6c4c9a99fde68b93f5acaf75b3b8c0ac36c5e3f1641898fa26f5fe998
4
+ data.tar.gz: e2a80de5052ed8410ac34a9399e7902f26edb665e5f8bb6c1b134222f959e0c1
5
5
  SHA512:
6
- metadata.gz: b97051bf7dbfe93e89ae64cb5e8f1fdb3ba953bbfb0139a82689f454459040125aa4009a6bf6707e51295e5ccd4825e4be5ff02270b6e2e9d4021b34e3e685df
7
- data.tar.gz: 73e311ba54b0d727210bd6f2548816878a0a9913190daf907bd4c3d36f18a649bcec26d6444362bb5e56856f55c1eb44f3d7d4bfb7dbd21ca0fe612141741300
6
+ metadata.gz: 81720111a8a5f758917d33fe021a820a9a6a2e47b0db6f3f43cb93e9955e2950977153b4e5e0dbfe1ffc3dfce142aee7becac849a2db74ed982b66d8ba807728
7
+ data.tar.gz: f632bda99f2c2928e42112f09d65fb67ab6be0ad2c8465f5d5210d3d0c5bb4892f3bf2ffe2c7eabd30c38d06cb800d74cfa4e87d9537af3fdbd170c2269c6b75
@@ -30,11 +30,18 @@ module ComposeUtils
30
30
  def self.format_image(image)
31
31
  base_image = nil
32
32
  tag = nil
33
+ repo = nil
33
34
 
34
35
  if image.nil?
35
36
  return nil
36
37
  end
37
38
 
39
+ unless image.index('/').nil?
40
+ path_split = image.rpartition('/')
41
+ image = path_split.last
42
+ repo = path_split.first + '/'
43
+ end
44
+
38
45
  if image.index(':').nil?
39
46
  base_image = image
40
47
  tag = 'latest'
@@ -44,7 +51,7 @@ module ComposeUtils
44
51
  tag = image_split[1]
45
52
  end
46
53
 
47
- "#{base_image}:#{tag}"
54
+ "#{repo}#{base_image}:#{tag}"
48
55
  end
49
56
 
50
57
  #
@@ -1,5 +1,5 @@
1
1
  module DockerCompose
2
2
  def self.version
3
- "1.1.6"
3
+ "1.1.8"
4
4
  end
5
5
  end
@@ -13,6 +13,11 @@ describe ComposeUtils do
13
13
  it 'should assign base image and tag when both are provided' do
14
14
  expect(ComposeUtils.format_image('ubuntu:11')).to eq('ubuntu:11')
15
15
  end
16
+
17
+ it 'should return valid tag if repository port specified' do
18
+ expect(ComposeUtils.format_image('localhost:5000/test')).to eq('localhost:5000/test:latest')
19
+ expect(ComposeUtils.format_image('localhost:5000/test:tag')).to eq('localhost:5000/test:tag')
20
+ end
16
21
  end
17
22
 
18
23
  context 'Format command' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker-compose-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.6
4
+ version: 1.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mauricio S. Klein
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-25 00:00:00.000000000 Z
11
+ date: 2018-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docker-api