docker_registry 0.0.2 → 0.0.3

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: 1f2ed171ee9e333166a46a5a08ce20838e90be03
4
- data.tar.gz: bd0a36b6367b3b4b35d03623638e8832862e3004
3
+ metadata.gz: cb7a6bead9882e3c98315038502c3cbd7398fd47
4
+ data.tar.gz: b5f5bb94d8d1e34714ae2f43567825b11110ab3e
5
5
  SHA512:
6
- metadata.gz: e552521f1f6483839fab7b61a28f4580088a257d7e112ab93192963a3f6f8b1dbcc46e634d28e462a58f1a82bb77bf0ded5e8c9d383a92e8e2a2781a112ed52d
7
- data.tar.gz: 98398e2381c08e6d2037ea47b8ff49d44ade3da210ecff9291068b21b2d96292f293346f1a19f9339cf4d2b02a1e0725716ec0565b67f18c801d1031e038a7a5
6
+ metadata.gz: a4bdce6ec246fc208521ea4b84f345de9cd5e26fb052212dbd2b72371982b4ad8cad0c36006b3a7073bf06551094a9fe5f5a64f6c3b1806bbc9e7d151abd3fef
7
+ data.tar.gz: 5b41c5c59121a53407f7213502c7d0efee708f1e2a92a1d5c8c8620d12b27f753c115af0a046f494e6b512c9a22229c7b3a944762a18c12240353946514ac535
@@ -26,7 +26,7 @@ class DockerRegistry::Client
26
26
  end
27
27
 
28
28
  def ping
29
- @faraday.get('/v1/_ping').body === true
29
+ @faraday.get('/v1/_ping').body
30
30
  end
31
31
 
32
32
  # @param [#to_s] query Seach query
@@ -38,6 +38,10 @@ class DockerRegistry::Client
38
38
  @faraday.get("/v1/repositories/#{name}/tags").body
39
39
  end
40
40
 
41
+ def repositry_tag(name, tag)
42
+ @faraday.get("/v1/repositories/#{name}/tags/#{tag}").body
43
+ end
44
+
41
45
  def delete_repository(name)
42
46
  @faraday.delete("/v1/repositories/#{name}/").status == 200
43
47
  end
@@ -35,12 +35,21 @@ class DockerRegistry::Registry
35
35
  end
36
36
  end
37
37
 
38
+ def [](name)
39
+ DockerRegistry::Repository.new({ name: name }, self)
40
+ end
41
+
38
42
  def repositry_tags(repository)
39
43
  (@client.repositry_tags(repository.name) || {}).map do |name, image_id|
40
44
  DockerRegistry::Tag.new(name, image_id, repository)
41
45
  end
42
46
  end
43
47
 
48
+ def repositry_tag(repository, tag)
49
+ image_id = (@client.repositry_tag(repository.name, tag) || "")
50
+ DockerRegistry::Tag.new(tag, image_id, repository)
51
+ end
52
+
44
53
  def delete_repository(repository)
45
54
  @client.delete_repository(repository.name)
46
55
  end
@@ -20,6 +20,10 @@ class DockerRegistry::Repository
20
20
  registry.repositry_tags(self)
21
21
  end
22
22
 
23
+ def [](tag)
24
+ registry.repositry_tag(self, tag)
25
+ end
26
+
23
27
  def delete!
24
28
  registry.delete_repository(self)
25
29
  end
@@ -1,3 +1,3 @@
1
1
  module DockerRegistry
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker_registry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sho Kusano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-20 00:00:00.000000000 Z
11
+ date: 2014-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler