code_manifest 1.4.0 → 1.5.0

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
  SHA256:
3
- metadata.gz: 85dc605af26d3707bb98d61bf27ff898bb8582c5a11220b3b5d54bf17fc1f824
4
- data.tar.gz: 856aa8f8a5e703e076aedfa4c4676245e6786eaa7ad834f967bfa8864b00ecee
3
+ metadata.gz: 57ebc00567f59f24c5be818a88ecb8d117175474290653d734a311d7718802de
4
+ data.tar.gz: b7a582abfe21b8f1eaf5beed11fe1244c43307d9e034c9a68da64ab4e9ff53b5
5
5
  SHA512:
6
- metadata.gz: d36a050c65f13dac20af4a540007ad8ef5c8c396492c93a51541bcdffee3ec8413ce0e78d8b62e2c9c821f7a073817bad96f380058c4f5c2f02cc507c60269b0
7
- data.tar.gz: 597149b71d2a7514989de7843e75621124b15e883a7d5e8bb62e935b3a834f514fedb2cf00f78b13fcfa86790efa6c1e8dd428dd0f50ddbd92c12ead27a8c560
6
+ metadata.gz: 6793af62e46f89a33aed509ef44c9bccfd4e280ec483a1a39ec405d2145112ae8ff5531c7bd4e197f45e6b1973901182327eda7ea54f922930c172b63d21a083
7
+ data.tar.gz: 88387c161220a1142bbd69a8d6811fe8de84d8bdb8a7381db027c76f193e5461f34bdc5fda4b9b802e5d0fc3b7202329d015c942703236e5c0d386b14b2bb2eb
@@ -16,7 +16,13 @@ module CodeManifest
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,7 +37,7 @@ module CodeManifest
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!
@@ -39,18 +45,10 @@ module CodeManifest
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
@@ -1,5 +1,5 @@
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: code_manifest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gusto Engineers