dapp 0.24.8 → 0.24.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 06c42cce69580f08832c3a7e1bbcd1cf9e2eb8bc
4
- data.tar.gz: 77449a953f827b4d6af23c7e6785e07ea7a3eb09
3
+ metadata.gz: 1b440e9acd2b5f064542280a357a1dec5a4ccd76
4
+ data.tar.gz: 2431741ec03503767ba515e97e942992f8eb0c9c
5
5
  SHA512:
6
- metadata.gz: af7b59b06964e7395343e8d051664043f3cfa77f818b9e9feb9b362f86b74f0a8653d158d1aec754b6f0c403b79de73e2fb286e03565d7ad7e0e128950f105ad
7
- data.tar.gz: 1062f6f13d694ceaa1523e4bba93a90e8b346437990664a84405eddc4623c18e550c96ec27bd6207ce576d77f4282d90b9da6bc8a64a0969d36d2aeef2cc6a58
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
- verifiable_artifact[:include_paths].each do |verifiable_path|
142
- potential_conflicts = artifact[:include_paths].select { |path| path.start_with?(verifiable_path) }
143
- validate_artifact_path!(verifiable_artifact, potential_conflicts)
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
- end
147
+ cases << verifiable_artifact[:include_paths].empty? && artifact[:include_paths].empty?
154
148
 
155
- def validate_artifact_path!(verifiable_artifact, potential_conflicts)
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
@@ -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
@@ -1,4 +1,4 @@
1
1
  module Dapp
2
- VERSION = "0.24.8"
3
- BUILD_CACHE_VERSION = 26
2
+ VERSION = "0.24.9"
3
+ BUILD_CACHE_VERSION = 26.1
4
4
  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.24.8
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-01 00:00:00.000000000 Z
11
+ date: 2018-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-shellout