dapp 0.7.22 → 0.7.23

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: e1d331bc07f3e624682ffd414440632af1539623
4
- data.tar.gz: fb78b3ad52f34339480699c0732f3257e591c679
3
+ metadata.gz: 0a274af8b41a35e353f391b7f9c7b0bde96981e5
4
+ data.tar.gz: 9b40b2671fe479229e8e4c0e3e923af694514255
5
5
  SHA512:
6
- metadata.gz: 2645b1233f00e1cdf09f22f42da53659df25b187e89e93541eb9a35f281bda3e1fa860396e36404671ddd5953c23e11677a41bf07a6a400abfc7c067304c7e6c
7
- data.tar.gz: d9360bf403e44a3c5dd96bd3d65c4c036b9e74c6f6f256f78c0aa4c34527e5274fee9b5d9bf343d2211785061b38f241d605ebb0e9f7d812c295586341290bea
6
+ metadata.gz: 34c747b33c7cf04d4509141c1d4ed8715854b61656fbc146dafb162eb62dcb6688c4da8206ca8a31a37d126e4099f0867edd2963c89211ade78fc73a409a052b
7
+ data.tar.gz: 1722b58dad85758d12405cfed80afbfe9eff1cfc4bfd7378e18f7c21da6efc8ca03156314cf30ce274bcf688f04daae53cf065428fbfa83f4eaf23023c883f7c
@@ -72,10 +72,6 @@ module Dapp
72
72
  def validate!
73
73
  raise Error::Config, code: :export_to_required if _to.nil?
74
74
  end
75
-
76
- def path_format(path)
77
- path.chomp('/')
78
- end
79
75
  end
80
76
 
81
77
  protected
@@ -12,6 +12,10 @@ module Dapp
12
12
  def clone_to_artifact
13
13
  clone
14
14
  end
15
+
16
+ def path_format(path)
17
+ path.to_s.chomp('/')
18
+ end
15
19
  end
16
20
  end
17
21
  end
@@ -41,8 +41,8 @@ module Dapp
41
41
  @_onbuild.concat(args)
42
42
  end
43
43
 
44
- def workdir(val)
45
- @_workdir = val
44
+ def workdir(path)
45
+ @_workdir = path_format(path)
46
46
  end
47
47
 
48
48
  def user(val)
@@ -8,17 +8,17 @@ module Dapp
8
8
 
9
9
  def initialize(to, **kwargs, &blk)
10
10
  raise Error::Config, code: :mount_to_absolute_path_required unless Pathname((to = to.to_s)).absolute?
11
- @_to = to
11
+ @_to = path_format(to)
12
12
 
13
13
  super(**kwargs, &blk)
14
14
  end
15
15
 
16
16
  protected
17
17
 
18
- def from(path_or_type)
19
- path_or_type = path_or_type.to_sym
20
- raise Error::Config, code: :mount_from_type_required unless [:tmp_dir, :build_dir].include? path_or_type
21
- @_type = path_or_type
18
+ def from(type)
19
+ type = type.to_sym
20
+ raise Error::Config, code: :mount_from_type_required unless [:tmp_dir, :build_dir].include? type
21
+ @_type = type
22
22
  end
23
23
  end
24
24
  end
@@ -95,15 +95,15 @@ module Dapp
95
95
 
96
96
  def proper_git_commit
97
97
  log_proper_git_commit do
98
- unproper_images = []
98
+ unproper_images_names = []
99
99
  project_images_detailed.each do |_, attrs|
100
100
  attrs['Config']['Labels'].each do |repo_name, commit|
101
101
  next if (repo = project_git_repositories[repo_name]).nil?
102
102
  git = repo.name == 'own' ? :git : :git_bare
103
- unproper_images.concat(image_hierarchy(attrs['Id'])) unless repo.send(git).exists?(commit)
103
+ unproper_images_names.concat(image_hierarchy_by_id(attrs['Id'])) unless repo.send(git).exists?(commit)
104
104
  end
105
105
  end
106
- remove_images(unproper_images.uniq)
106
+ remove_images(unproper_images_names.uniq)
107
107
  end
108
108
  end
109
109
 
@@ -117,12 +117,12 @@ module Dapp
117
117
  end
118
118
  end
119
119
 
120
- def image_hierarchy(image_id)
120
+ def image_hierarchy_by_id(image_id)
121
121
  hierarchy = []
122
122
  iids = [image_id]
123
123
 
124
124
  loop do
125
- hierarchy.concat(iids)
125
+ hierarchy.concat(project_images_detailed.map { |name, attrs| name if iids.include?(attrs['Id']) }.compact)
126
126
  break if begin
127
127
  iids.map! do |iid|
128
128
  project_images_detailed.map { |_, attrs| attrs['Id'] if attrs['Parent'] == iid }.compact
data/lib/dapp/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # Version
2
2
  module Dapp
3
- VERSION = '0.7.22'.freeze
3
+ VERSION = '0.7.23'.freeze
4
4
  BUILD_CACHE_VERSION = 6
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.22
4
+ version: 0.7.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Stolyarov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-20 00:00:00.000000000 Z
11
+ date: 2016-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-shellout