dapp 0.13.21 → 0.13.22
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 +4 -4
- data/lib/dapp/config/config.rb +0 -4
- data/lib/dapp/dapp/dappfile.rb +0 -1
- data/lib/dapp/dimg/config/config.rb +0 -4
- data/lib/dapp/dimg/config/directive/dimg/instance_methods.rb +0 -40
- data/lib/dapp/dimg/config/directive/dimg/validation.rb +5 -1
- data/lib/dapp/version.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 328339d676470a5b9dde9b652176c9832d2d9b5f
|
4
|
+
data.tar.gz: 6cb726ff189d3a830ed5a7a5951106df4f325c53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f60a9c036e8c459ff91738d1412bfe4477162357fa81765e71a253068291ec2dbca7102f82cea8aee3d8878b9d69081f10ee727216af8900f09f33ede304795
|
7
|
+
data.tar.gz: f3051c94f5b2b4f9ca13fec239e8ce8d44c2996f17752f742b3460074a2cd47b9ce9d3f67e1f831256ff04efd49e36b4479e789e9c140121d9b0a20a552f6879
|
data/lib/dapp/config/config.rb
CHANGED
data/lib/dapp/dapp/dappfile.rb
CHANGED
@@ -33,7 +33,6 @@ module Dapp
|
|
33
33
|
::Dapp::Config::Config.new(dapp: self).tap do |config|
|
34
34
|
begin
|
35
35
|
config.instance_eval File.read(dappfile_path), dappfile_path
|
36
|
-
config.after_parsing!
|
37
36
|
config.validate!
|
38
37
|
rescue SyntaxError, StandardError => e
|
39
38
|
backtrace = e.backtrace.find { |line| line.start_with?(dappfile_path) }
|
@@ -8,10 +8,6 @@ module Dapp
|
|
8
8
|
|
9
9
|
protected
|
10
10
|
|
11
|
-
def dimg_after_parsing!
|
12
|
-
_dimg.each(&:artifacts_after_parsing!)
|
13
|
-
end
|
14
|
-
|
15
11
|
def dimg_config_validate!
|
16
12
|
raise Error::Config, code: :dimg_name_required if _dimg.any? { |dimg| dimg._name.nil? } && _dimg.size > 1
|
17
13
|
_dimg.each(&:validate!)
|
@@ -130,10 +130,6 @@ module Dapp
|
|
130
130
|
end
|
131
131
|
end
|
132
132
|
|
133
|
-
def artifacts_after_parsing!
|
134
|
-
_artifacts_auto_excluding!
|
135
|
-
end
|
136
|
-
|
137
133
|
protected
|
138
134
|
|
139
135
|
def builder(type)
|
@@ -144,42 +140,6 @@ module Dapp
|
|
144
140
|
def passed_directives
|
145
141
|
[:@_chef, :@_shell, :@_docker, :@_git_artifact, :@_mount, :@_artifact_groups, :@_builder]
|
146
142
|
end
|
147
|
-
|
148
|
-
def _artifacts_auto_excluding!
|
149
|
-
path_to_relative = proc { |path| path.reverse.chomp('/').reverse }
|
150
|
-
|
151
|
-
all_artifacts.reduce({}) do |hash, artifact|
|
152
|
-
unless artifact._to.nil?
|
153
|
-
to_common = artifact._to[/^\/[^\/]*/]
|
154
|
-
hash[to_common] ||= []
|
155
|
-
hash[to_common] << artifact
|
156
|
-
end
|
157
|
-
hash
|
158
|
-
end.each do |to_common, artifacts|
|
159
|
-
include_paths_common = artifacts.reduce([]) do |arr, artifact|
|
160
|
-
arr << artifact._to.sub(to_common, '')
|
161
|
-
arr.concat(artifact._include_paths.map { |path| File.join(artifact._to.sub(to_common, ''), path) } )
|
162
|
-
arr
|
163
|
-
end.map(&path_to_relative).uniq
|
164
|
-
|
165
|
-
artifacts.each do |artifact|
|
166
|
-
artifact_include_shift = path_to_relative.call(artifact._to.sub(to_common, ''))
|
167
|
-
|
168
|
-
include_paths_common.each do |path|
|
169
|
-
next if artifact_include_shift.start_with? path
|
170
|
-
|
171
|
-
path = path_to_relative.call(path.sub(artifact_include_shift, ''))
|
172
|
-
unless artifact._exclude_paths.any? { |epath| path.start_with? epath }
|
173
|
-
artifact._exclude_paths << path
|
174
|
-
end
|
175
|
-
end
|
176
|
-
end
|
177
|
-
end
|
178
|
-
end
|
179
|
-
|
180
|
-
def all_artifacts
|
181
|
-
_artifact + _git_artifact._local + _git_artifact._remote
|
182
|
-
end
|
183
143
|
end # InstanceMethods
|
184
144
|
# rubocop:enable Metrics/ModuleLength
|
185
145
|
end # Dimg
|
@@ -67,7 +67,7 @@ module Dapp
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def validate_artifacts!
|
70
|
-
artifacts = validate_artifact_format(
|
70
|
+
artifacts = validate_artifact_format(validated_artifacts)
|
71
71
|
loop do
|
72
72
|
break if artifacts.empty?
|
73
73
|
verifiable_artifact = artifacts.shift
|
@@ -133,6 +133,10 @@ module Dapp
|
|
133
133
|
!(art._before.nil? && art._after.nil?)
|
134
134
|
end
|
135
135
|
end
|
136
|
+
|
137
|
+
def validated_artifacts
|
138
|
+
_artifact + _git_artifact._local + _git_artifact._remote
|
139
|
+
end
|
136
140
|
end # Validation
|
137
141
|
# rubocop:enable Metrics/ModuleLength
|
138
142
|
end # Dimg
|
data/lib/dapp/version.rb
CHANGED