cleo_codeowners 0.2.0 → 0.3.0
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/lib/cleo_codeowners/version.rb +1 -1
- data/lib/codeowners/glob.rb +6 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9ab9ff74ae21e83712d2331afa49e4a58fb361afb592489c608662d190adfaac
|
|
4
|
+
data.tar.gz: af9b4ec93a30218aef50319329d3594ca97cff39c4b203282abf7ab763ed968b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bcf8aebdba6312e71130c7ddcd9cf66f39c6e90c7b63d66fb57dd59d0410391938a676e895f9f82245543acfec10fa44acc4db30b49cdc794619c7bfa4cb0ee6
|
|
7
|
+
data.tar.gz: 87892f76e750c5ebbbead2dabf13ac1727e6c6fc1104e5ea237b06f4c22e05fb0038f6bbfe66bb73b1ae1a22384c2a756e162927f6fd114f9d405cd678f13601
|
data/lib/codeowners/glob.rb
CHANGED
|
@@ -25,21 +25,24 @@ module Codeowners
|
|
|
25
25
|
# Does this glob match the given filepath?
|
|
26
26
|
# @param [String] filepath to match against
|
|
27
27
|
# @note
|
|
28
|
+
# Use `FNM_PATHNAME` so a single `*` stays within one path segment.
|
|
29
|
+
# Use `FNM_DOTMATCH` so `*` still matches dotfiles/dot-dirs e.g.
|
|
30
|
+
# `.github`, as GitHub does.
|
|
28
31
|
# Don't use `FNM_CASEFOLD`, GitHub uses a case sensitive file system.
|
|
29
32
|
# Don't use `FNM_EXTGLOB`, GitHub CODEOWNERS files don't support it.
|
|
30
|
-
# Don't use `FNM_PATHNAME`, we want to match `*` against '/'.
|
|
31
33
|
#
|
|
32
34
|
# @see https://docs.ruby-lang.org/en/3.3/File.html#method-c-fnmatch
|
|
33
35
|
# @return [Boolean]
|
|
34
36
|
def match?(filepath)
|
|
35
|
-
|
|
37
|
+
# Bitwise OR is how we combine flags.
|
|
38
|
+
fnmatch(pattern, filepath, File::FNM_PATHNAME | File::FNM_DOTMATCH)
|
|
36
39
|
end
|
|
37
40
|
|
|
38
41
|
private
|
|
39
42
|
|
|
40
43
|
def normalize_string(string)
|
|
41
44
|
string.to_s.delete_prefix('/') # remove leading slashes
|
|
42
|
-
.gsub(%r{/\Z}, '
|
|
45
|
+
.gsub(%r{/\Z}, '/**/*') # replace trailing slash with a recursive wildcard
|
|
43
46
|
end
|
|
44
47
|
end
|
|
45
48
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cleo_codeowners
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- "@agentAngelope"
|
|
@@ -97,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
97
97
|
- !ruby/object:Gem::Version
|
|
98
98
|
version: '0'
|
|
99
99
|
requirements: []
|
|
100
|
-
rubygems_version: 4.0.
|
|
100
|
+
rubygems_version: 4.0.15
|
|
101
101
|
specification_version: 4
|
|
102
102
|
summary: Cleo CODEOWNERS tooling
|
|
103
103
|
test_files: []
|