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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c63f568dd1ca8df56852f25c7df28cb462e7684f3681d7b2921905344947a4f0
4
- data.tar.gz: 4e6d293428da814ff5ab29f73a9095a1b4cb3bd8d37a856229b2829012be8462
3
+ metadata.gz: 9ab9ff74ae21e83712d2331afa49e4a58fb361afb592489c608662d190adfaac
4
+ data.tar.gz: af9b4ec93a30218aef50319329d3594ca97cff39c4b203282abf7ab763ed968b
5
5
  SHA512:
6
- metadata.gz: 6dff31a87fd703933fdcdb92da9428c4908f735b9d3d48a3b5bf06c86fd7ab0e73ebc2728bb009e9e784975a889056393620cb964fb087c78a08ffcd0066f157
7
- data.tar.gz: e1c87696a2ec2984d09152fac3cf5d54897ff59b8cee684a16e19f9e137e21f6f4a989da49add28a8d4381328c138b61ca6844a443b8bbc3e91dd6f814870e05
6
+ metadata.gz: bcf8aebdba6312e71130c7ddcd9cf66f39c6e90c7b63d66fb57dd59d0410391938a676e895f9f82245543acfec10fa44acc4db30b49cdc794619c7bfa4cb0ee6
7
+ data.tar.gz: 87892f76e750c5ebbbead2dabf13ac1727e6c6fc1104e5ea237b06f4c22e05fb0038f6bbfe66bb73b1ae1a22384c2a756e162927f6fd114f9d405cd678f13601
@@ -3,5 +3,5 @@
3
3
  ##
4
4
  # Root module for this gem
5
5
  module CleoCodeowners
6
- VERSION = '0.2.0'
6
+ VERSION = '0.3.0'
7
7
  end
@@ -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
- fnmatch(pattern, filepath, File::FNM_DOTMATCH)
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}, '/**') # replace trailing slash with a recursive wildcard
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.2.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.13
100
+ rubygems_version: 4.0.15
101
101
  specification_version: 4
102
102
  summary: Cleo CODEOWNERS tooling
103
103
  test_files: []