File tree Expand file tree Collapse file tree 3 files changed +10
-12
lines changed Expand file tree Collapse file tree 3 files changed +10
-12
lines changed Original file line number Diff line number Diff line change 1
1
PATH
2
2
remote: .
3
3
specs:
4
- code_manifest (1.4 .0 )
4
+ code_manifest (1.5 .0 )
5
5
6
6
GEM
7
7
remote: https://rubygems.org/
Original file line number Diff line number Diff line change @@ -16,7 +16,13 @@ def initialize(patterns)
16
16
end
17
17
18
18
def files
19
- @files ||= ( inclusion_files - exclusion_files ) . sort! . freeze
19
+ @files ||= begin
20
+ inclusion_files = Dir . glob ( inclusion_rules . map ( &:glob ) , GLOB_OPTIONS )
21
+ inclusion_files . delete_if do |file |
22
+ exclusion_rules . any? { |rule | rule . match? ( file ) }
23
+ end
24
+ files_with_relative_path ( inclusion_files ) . sort! . freeze
25
+ end
20
26
end
21
27
22
28
def digest
@@ -31,26 +37,18 @@ def matches(paths)
31
37
inclusion_rules . any? { |rule | rule . match? ( path ) }
32
38
end
33
39
result_paths . reject! do |path |
34
- exclusion_files . any? { |rule | rule . match? ( path ) }
40
+ exclusion_rules . any? { |rule | rule . match? ( path ) }
35
41
end
36
42
37
43
result_paths . sort!
38
44
end
39
45
40
46
private
41
47
42
- def inclusion_files
43
- @inclusion_files ||= files_with_relative_path ( Dir . glob ( inclusion_rules . map ( &:glob ) , GLOB_OPTIONS ) )
44
- end
45
-
46
48
def inclusion_rules
47
49
@inclusion_rules ||= rules . reject ( &:exclude )
48
50
end
49
51
50
- def exclusion_files
51
- @exclusion_files ||= files_with_relative_path ( Dir . glob ( exclusion_rules . map ( &:glob ) , GLOB_OPTIONS ) )
52
- end
53
-
54
52
def exclusion_rules
55
53
@exclusion_rules ||= rules . select ( &:exclude )
56
54
end
Original file line number Diff line number Diff line change 1
1
# frozen_string_literal: true
2
2
3
3
module CodeManifest
4
- VERSION = '1.4 .0'
4
+ VERSION = '1.5 .0'
5
5
end
You can’t perform that action at this time.
0 commit comments