code_manifest 1.5.0 → 1.6.1
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 +4 -4
- data/README.md +1 -1
- data/lib/code_manifest/manifest.rb +6 -2
- data/lib/code_manifest/rule.rb +11 -11
- data/lib/code_manifest/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 866e5e7d09033a08f9b5f15406e9e068d9a4a89281ca9db08ecf07e818f99f8f
|
4
|
+
data.tar.gz: '028bc4cdddc7bf719f320ecdd267250fb07de2428a30a61836751a040d853962'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efe594dbcd73712bdf96bfb5ff51810556f91a0aacbcc11bb1d00aa2b650309cd70964859a89554cd629e7bfbb1c225c05a324cc7d3f90575b9a61a21ac74649
|
7
|
+
data.tar.gz: c4866e6c9d40160fd00e4325a2df8b8659c64d4a680e6fb155736c43cf345e76d757408b67f015b40b6cd8dcc9826e4824ee8f8e42bde10816e7c431f4cab7d7
|
data/README.md
CHANGED
@@ -11,13 +11,13 @@ module CodeManifest
|
|
11
11
|
|
12
12
|
def initialize(patterns)
|
13
13
|
@rules ||= Array(patterns).map do |pattern|
|
14
|
-
Rule.new(
|
14
|
+
Rule.new(pattern)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
18
|
def files
|
19
19
|
@files ||= begin
|
20
|
-
inclusion_files = Dir.glob(inclusion_rules.map(&:glob), GLOB_OPTIONS)
|
20
|
+
inclusion_files = Dir.glob(inclusion_rules.map(&:glob), GLOB_OPTIONS, base: CodeManifest.root)
|
21
21
|
inclusion_files.delete_if do |file|
|
22
22
|
exclusion_rules.any? { |rule| rule.match?(file) }
|
23
23
|
end
|
@@ -43,6 +43,10 @@ module CodeManifest
|
|
43
43
|
result_paths.sort!
|
44
44
|
end
|
45
45
|
|
46
|
+
def matches_all?(paths)
|
47
|
+
matches(paths) == paths
|
48
|
+
end
|
49
|
+
|
46
50
|
private
|
47
51
|
|
48
52
|
def inclusion_rules
|
data/lib/code_manifest/rule.rb
CHANGED
@@ -4,27 +4,27 @@ module CodeManifest
|
|
4
4
|
class Rule
|
5
5
|
attr_reader :exclude, :glob
|
6
6
|
|
7
|
-
def initialize(
|
8
|
-
@root = root
|
7
|
+
def initialize(pattern)
|
9
8
|
@exclude = false
|
10
|
-
@glob =
|
9
|
+
@glob = pattern
|
11
10
|
|
12
|
-
if
|
11
|
+
if glob.start_with?("!")
|
13
12
|
@exclude = true
|
14
|
-
|
13
|
+
@glob = glob.delete_prefix("!")
|
15
14
|
end
|
16
15
|
|
17
|
-
if
|
18
|
-
|
16
|
+
if File.absolute_path?(glob)
|
17
|
+
@glob = glob.delete_prefix(File::SEPARATOR)
|
19
18
|
else
|
20
|
-
@glob =
|
19
|
+
@glob = File.join("**", glob)
|
21
20
|
end
|
22
|
-
|
23
|
-
@glob = @glob.join(pattern).to_s
|
24
21
|
end
|
25
22
|
|
26
23
|
def match?(file)
|
27
|
-
|
24
|
+
if File.absolute_path?(file)
|
25
|
+
prefix = File.join(CodeManifest.root, "/")
|
26
|
+
file = file.delete_prefix(prefix)
|
27
|
+
end
|
28
28
|
|
29
29
|
File.fnmatch?(glob, file, Manifest::GLOB_OPTIONS)
|
30
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: code_manifest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gusto Engineers
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -42,7 +42,7 @@ metadata:
|
|
42
42
|
homepage_uri: https://github.com/rubyatscale/code_manifest
|
43
43
|
source_code_uri: https://github.com/rubyatscale/code_manifest
|
44
44
|
changelog_uri: https://github.com/rubyatscale/code_manifest/releases
|
45
|
-
post_install_message:
|
45
|
+
post_install_message:
|
46
46
|
rdoc_options: []
|
47
47
|
require_paths:
|
48
48
|
- lib
|
@@ -57,8 +57,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
57
57
|
- !ruby/object:Gem::Version
|
58
58
|
version: '0'
|
59
59
|
requirements: []
|
60
|
-
rubygems_version: 3.3.
|
61
|
-
signing_key:
|
60
|
+
rubygems_version: 3.3.13
|
61
|
+
signing_key:
|
62
62
|
specification_version: 4
|
63
63
|
summary: A code manifest
|
64
64
|
test_files: []
|