dapp 0.24.8 → 0.24.9
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b440e9acd2b5f064542280a357a1dec5a4ccd76
|
4
|
+
data.tar.gz: 2431741ec03503767ba515e97e942992f8eb0c9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfc8c4040ba9513c701f05a5a7143e7ee262516be2d09426f593b617c91085fc1dbf8c7f5a999f3d94ecbdf5ad45cda8ae563926b84f4172d52f3a831e64e833
|
7
|
+
data.tar.gz: 8629e9a015c15f89e67f6c11966c7a3498b17d2a7ce44feef1a368886b0b2c239ba6f8e9a2b545a971678b297a67e4b56e8cffa8839e8a2597dfe50bfe1b5263
|
@@ -4,6 +4,8 @@ module Dapp
|
|
4
4
|
module Directive
|
5
5
|
class Dimg < Base
|
6
6
|
module Validation
|
7
|
+
include Helper::Trivia
|
8
|
+
|
7
9
|
def validate!
|
8
10
|
directives_validate!
|
9
11
|
validate_scratch!
|
@@ -138,29 +140,13 @@ module Dapp
|
|
138
140
|
end
|
139
141
|
|
140
142
|
def validate_artifact!(verifiable_artifact, artifact)
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
end
|
145
|
-
|
146
|
-
if verifiable_artifact[:include_paths].empty?
|
147
|
-
if artifact[:include_paths].empty? || verifiable_artifact[:exclude_paths].empty?
|
148
|
-
raise ::Dapp::Error::Config, code: :artifact_conflict
|
149
|
-
else
|
150
|
-
validate_artifact_path!(verifiable_artifact, artifact[:include_paths])
|
151
|
-
end
|
143
|
+
cases = []
|
144
|
+
cases << verifiable_artifact[:include_paths].any? do |verifiable_path|
|
145
|
+
!ignore_path?(verifiable_path, paths: artifact[:include_paths], exclude_paths: artifact[:exclude_paths])
|
152
146
|
end
|
153
|
-
|
147
|
+
cases << verifiable_artifact[:include_paths].empty? && artifact[:include_paths].empty?
|
154
148
|
|
155
|
-
|
156
|
-
raise ::Dapp::Error::Config, code: :artifact_conflict unless begin
|
157
|
-
potential_conflicts.all? do |path|
|
158
|
-
loop do
|
159
|
-
break if verifiable_artifact[:exclude_paths].include?(path) || ((path = File.dirname(path)) == '.')
|
160
|
-
end
|
161
|
-
verifiable_artifact[:exclude_paths].include?(path)
|
162
|
-
end
|
163
|
-
end
|
149
|
+
raise ::Dapp::Error::Config, code: :artifact_conflict if cases.any?
|
164
150
|
end
|
165
151
|
|
166
152
|
def _associated_artifacts
|
@@ -121,7 +121,7 @@ module Dapp
|
|
121
121
|
last_part_path = path_parts.shift
|
122
122
|
test_path = [test_path, last_part_path].compact.join('/')
|
123
123
|
|
124
|
-
non_match = !File.fnmatch(test_path, embedded_rel_path, File::FNM_PATHNAME)
|
124
|
+
non_match = !File.fnmatch(test_path, embedded_rel_path, File::FNM_PATHNAME|File::FNM_DOTMATCH)
|
125
125
|
part_for_all = (last_part_path == '**')
|
126
126
|
|
127
127
|
if non_match || part_for_all
|
@@ -227,22 +227,6 @@ 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) ||
|
236
|
-
File.fnmatch?(File.join(p, '**', '*'), path, File::FNM_PATHNAME)
|
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
|
246
230
|
end
|
247
231
|
end
|
248
232
|
end
|
data/lib/dapp/helper/trivia.rb
CHANGED
@@ -28,12 +28,28 @@ 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
|
+
|
31
47
|
def check_path?(path, format)
|
32
|
-
path_checker(path) { |checking_path| File.fnmatch(format, checking_path, File::FNM_PATHNAME) }
|
48
|
+
path_checker(path) { |checking_path| File.fnmatch(format, checking_path, File::FNM_PATHNAME|File::FNM_DOTMATCH) }
|
33
49
|
end
|
34
50
|
|
35
51
|
def check_subpath?(path, format)
|
36
|
-
path_checker(format) { |checking_path| File.fnmatch(checking_path, path, File::FNM_PATHNAME) }
|
52
|
+
path_checker(format) { |checking_path| File.fnmatch(checking_path, path, File::FNM_PATHNAME|File::FNM_DOTMATCH) }
|
37
53
|
end
|
38
54
|
|
39
55
|
def path_checker(path)
|
@@ -13,8 +13,8 @@ module Dapp
|
|
13
13
|
template_relative_path_pattern = Pathname(File.expand_path(template_path_pattern)).subpath_of(path('.helm'))
|
14
14
|
template_relative_path_pattern ||= template_path_pattern
|
15
15
|
|
16
|
-
File.fnmatch?(template_relative_path_pattern, template_path_without_chart_name, File::FNM_PATHNAME) ||
|
17
|
-
File.fnmatch?(template_relative_path_pattern, template_path, File::FNM_PATHNAME)
|
16
|
+
File.fnmatch?(template_relative_path_pattern, template_path_without_chart_name, File::FNM_PATHNAME|File::FNM_DOTMATCH) ||
|
17
|
+
File.fnmatch?(template_relative_path_pattern, template_path, File::FNM_PATHNAME|File::FNM_DOTMATCH)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
else
|
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.24.
|
4
|
+
version: 0.24.9
|
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-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-shellout
|