dapp 0.26.7 → 0.26.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dapp/dimg/config/directive/dimg/validation.rb +21 -7
- data/lib/dapp/dimg/git_repo/base.rb +16 -0
- data/lib/dapp/helper/trivia.rb +0 -16
- data/lib/dapp/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6efd6e4823be7cddb1e21d5a7ff7ac3faa5c6a3b
|
4
|
+
data.tar.gz: 5fd4fc5e3e92d5d3ca76a6755c43901741025637
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 544564aaa7da8b80e5476c77877a87ffa7766c002892da3299ac13295aa938d58b762cb1b415d8f28334a66a3c0478463895ab2abbfa33eab82f8721931d41a0
|
7
|
+
data.tar.gz: de71ce126fac80dde41218166e3c8034877f04c9d0448c8ad8db0c47fd18d6ec8033f95dcef5041d6911e509e2741d8d9ca7559a4a3acf668ef7f9caf08b8ced
|
@@ -4,8 +4,6 @@ module Dapp
|
|
4
4
|
module Directive
|
5
5
|
class Dimg < Base
|
6
6
|
module Validation
|
7
|
-
include Helper::Trivia
|
8
|
-
|
9
7
|
def validate!
|
10
8
|
directives_validate!
|
11
9
|
validate_scratch!
|
@@ -141,13 +139,29 @@ module Dapp
|
|
141
139
|
end
|
142
140
|
|
143
141
|
def validate_artifact!(verifiable_artifact, artifact)
|
144
|
-
|
145
|
-
|
146
|
-
!
|
142
|
+
verifiable_artifact[:include_paths].each do |verifiable_path|
|
143
|
+
potential_conflicts = artifact[:include_paths].select { |path| path.start_with?(verifiable_path) }
|
144
|
+
validate_artifact_path!(verifiable_artifact, potential_conflicts)
|
145
|
+
end
|
146
|
+
|
147
|
+
if verifiable_artifact[:include_paths].empty?
|
148
|
+
if artifact[:include_paths].empty? || verifiable_artifact[:exclude_paths].empty?
|
149
|
+
raise ::Dapp::Error::Config, code: :artifact_conflict
|
150
|
+
else
|
151
|
+
validate_artifact_path!(verifiable_artifact, artifact[:include_paths])
|
152
|
+
end
|
147
153
|
end
|
148
|
-
|
154
|
+
end
|
149
155
|
|
150
|
-
|
156
|
+
def validate_artifact_path!(verifiable_artifact, potential_conflicts)
|
157
|
+
raise ::Dapp::Error::Config, code: :artifact_conflict unless begin
|
158
|
+
potential_conflicts.all? do |path|
|
159
|
+
loop do
|
160
|
+
break if verifiable_artifact[:exclude_paths].include?(path) || ((path = File.dirname(path)) == '.')
|
161
|
+
end
|
162
|
+
verifiable_artifact[:exclude_paths].include?(path)
|
163
|
+
end
|
164
|
+
end
|
151
165
|
end
|
152
166
|
|
153
167
|
def _associated_artifacts
|
@@ -227,6 +227,22 @@ module Dapp
|
|
227
227
|
paths.empty? || paths.any? { |p| check_path?(path, p) || check_subpath?(path, p) }
|
228
228
|
end
|
229
229
|
end
|
230
|
+
|
231
|
+
def ignore_path?(path, paths: [], exclude_paths: [])
|
232
|
+
ignore_path_base(path, exclude_paths: exclude_paths) do
|
233
|
+
paths.empty? ||
|
234
|
+
paths.any? do |p|
|
235
|
+
File.fnmatch?(p, path, File::FNM_PATHNAME|File::FNM_DOTMATCH) ||
|
236
|
+
File.fnmatch?(File.join(p, '**', '*'), path, File::FNM_PATHNAME|File::FNM_DOTMATCH)
|
237
|
+
end
|
238
|
+
end
|
239
|
+
end
|
240
|
+
|
241
|
+
def ignore_path_base(path, exclude_paths: [])
|
242
|
+
is_exclude_path = exclude_paths.any? { |p| check_path?(path, p) }
|
243
|
+
is_include_path = yield
|
244
|
+
is_exclude_path || !is_include_path
|
245
|
+
end
|
230
246
|
end
|
231
247
|
end
|
232
248
|
end
|
data/lib/dapp/helper/trivia.rb
CHANGED
@@ -28,22 +28,6 @@ module Dapp
|
|
28
28
|
Pathname.new(File.join(base.to_s, *path.compact.map(&:to_s)))
|
29
29
|
end
|
30
30
|
|
31
|
-
def ignore_path?(path, paths: [], exclude_paths: [])
|
32
|
-
ignore_path_base(path, exclude_paths: exclude_paths) do
|
33
|
-
paths.empty? ||
|
34
|
-
paths.any? do |p|
|
35
|
-
File.fnmatch?(p, path, File::FNM_PATHNAME|File::FNM_DOTMATCH) ||
|
36
|
-
File.fnmatch?(File.join(p, '**', '*'), path, File::FNM_PATHNAME|File::FNM_DOTMATCH)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
def ignore_path_base(path, exclude_paths: [])
|
42
|
-
is_exclude_path = exclude_paths.any? { |p| check_path?(path, p) }
|
43
|
-
is_include_path = yield
|
44
|
-
is_exclude_path || !is_include_path
|
45
|
-
end
|
46
|
-
|
47
31
|
def check_path?(path, format)
|
48
32
|
path_checker(path) { |checking_path| File.fnmatch(format, checking_path, File::FNM_PATHNAME|File::FNM_DOTMATCH) }
|
49
33
|
end
|
data/lib/dapp/version.rb
CHANGED
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.26.
|
4
|
+
version: 0.26.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Stolyarov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-02-
|
11
|
+
date: 2018-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-shellout
|