codeowners 0.0.3 → 0.0.4

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: 790787fbbbface03dca93e7ee9fb70818d736b55b5b46feba832bb5d1d1cacde
4
- data.tar.gz: 5cf3d0d5b9612527ac8e3d5416442dcb0442e1d69180b85df1b25752871e9d9e
3
+ metadata.gz: a72c0c2917eaac74c58a98ad2ef7a1d7e9d47f6a5dae33fda9b9be6a4188bd98
4
+ data.tar.gz: c1db100813840cb7986353467b55c6dc522fe302ef012bccb1ebbf49adcc01d6
5
5
  SHA512:
6
- metadata.gz: 9728df04569e092a74db19feec631cb0f4031da24ab1bf7e127b6a728206c21026fc7a2988ff0c81f66b894a895350521a9f956236859e682eaa8be2f79194a3
7
- data.tar.gz: 594590f13fe02ea9c8e7f5831e2d716a48779e7309f063caeb194c884a42d69037fed8ca64b6703ad88db7765f25258fa58d9d45e12b3eabb00875a016b1fb3a
6
+ metadata.gz: d202a2ca205b4c4ce45cfcac0717a35a6658bd0bf44d8acecf18fb6a0f56c54ce0a633e974928a4e3c5907401f92ea1d9e14cd8ec4a152f0d36a618203d5fffb
7
+ data.tar.gz: 81f3a9cada8c72cebcd70b9c134bebb7bc3294688ac6aad52073939a244ac3b65b5918dac34c3179ee7253c7cf05dca6950ee14c3cbc371bee02a93c742c722c
@@ -0,0 +1,42 @@
1
+ name: ci
2
+
3
+ "on":
4
+ push:
5
+ paths:
6
+ - ".github/workflows/ci.yml"
7
+ - "lib/**"
8
+ - "*.gemspec"
9
+ - "spec/**"
10
+ - "Rakefile"
11
+ - "Gemfile"
12
+ - ".rubocop.yml"
13
+ pull_request:
14
+ branches:
15
+ - master
16
+ create:
17
+
18
+ jobs:
19
+ tests:
20
+ runs-on: ubuntu-latest
21
+ strategy:
22
+ fail-fast: false
23
+ matrix:
24
+ ruby:
25
+ - "3.0"
26
+ - "2.7"
27
+ - "2.6"
28
+ steps:
29
+ - uses: actions/checkout@v1
30
+ - name: Install package dependencies
31
+ run: "[ -e $APT_DEPS ] || sudo apt-get install -y --no-install-recommends $APT_DEPS"
32
+ - name: Set up Ruby
33
+ uses: ruby/setup-ruby@v1
34
+ with:
35
+ ruby-version: ${{matrix.ruby}}
36
+ - name: Install latest bundler
37
+ run: |
38
+ gem install bundler --no-document
39
+ - name: Bundle install
40
+ run: bundle install --jobs 4 --retry 3
41
+ - name: Run all tests
42
+ run: bundle exec rake
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # Codeowners
2
2
  Simple CLI to interact with GitHub CODEOWNERS
3
3
 
4
+ ## v0.0.4 - 2021-05-21
5
+ ### Fixed
6
+ - [Luca Guidi] Make `codeowners list` compatible with [CODEOWNERS spec](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-code-owners#codeowners-syntax)
7
+
4
8
  ## v0.0.3 - 2020-07-22
5
9
  ### Added
6
10
  - [Luca Guidi] Added `codeowners guess`
data/Rakefile CHANGED
@@ -1,4 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "rake"
3
4
  require "bundler/gem_tasks"
4
- task default: :spec
5
+ require "rspec/core/rake_task"
6
+
7
+ RSpec::Core::RakeTask.new(:spec) do |task|
8
+ file_list = FileList["spec/**/*_spec.rb"]
9
+
10
+ task.pattern = file_list
11
+ end
12
+
13
+ task default: "spec"
data/codeowners.gemspec CHANGED
@@ -26,8 +26,9 @@ Gem::Specification.new do |spec|
26
26
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
27
  spec.require_paths = ["lib"]
28
28
 
29
- spec.add_runtime_dependency "dry-cli", "~> 0.6"
29
+ spec.add_runtime_dependency "dry-cli", "~> 0.7"
30
30
  spec.add_runtime_dependency "excon", "~> 0.75"
31
+ spec.add_development_dependency "rspec"
31
32
  spec.add_development_dependency "rubocop"
32
33
  spec.add_development_dependency "byebug"
33
34
  end
@@ -10,16 +10,38 @@ module Codeowners
10
10
  end
11
11
 
12
12
  def call(file)
13
+ result = Result.new
14
+
13
15
  ::File.open(@codeowners, "r").each_line do |line|
14
16
  line = line.chomp
15
17
  next if line.empty? || line.match?(/[[:space:]]*#/)
16
18
 
17
19
  pattern, *owners = line.split(/[[:space:]]+/)
18
20
 
19
- return Result.new(pattern, owners) if File.fnmatch(pattern, file)
21
+ result = Result.new(pattern, owners) if match?(pattern, file)
20
22
  end
21
23
 
22
- Result.new
24
+ result
25
+ end
26
+
27
+ private
28
+
29
+ def match?(pattern, file)
30
+ pattern = normalize_pattern(pattern)
31
+ flags = match_flags_for(pattern)
32
+
33
+ File.fnmatch(pattern, file, flags)
34
+ end
35
+
36
+ def normalize_pattern(pattern)
37
+ pattern += "**" if pattern.end_with?(::File::SEPARATOR)
38
+ pattern
39
+ end
40
+
41
+ def match_flags_for(pattern)
42
+ return File::FNM_PATHNAME if pattern.end_with?(::File::SEPARATOR + "*")
43
+
44
+ 0
23
45
  end
24
46
  end
25
47
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Codeowners
4
- VERSION = "0.0.3"
4
+ VERSION = "0.0.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codeowners
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca Guidi
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-22 00:00:00.000000000 Z
11
+ date: 2021-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-cli
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.6'
19
+ version: '0.7'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.6'
26
+ version: '0.7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: excon
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0.75'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rubocop
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -75,7 +89,9 @@ executables:
75
89
  extensions: []
76
90
  extra_rdoc_files: []
77
91
  files:
92
+ - ".github/workflows/ci.yml"
78
93
  - ".gitignore"
94
+ - ".rspec"
79
95
  - ".rubocop.yml"
80
96
  - CHANGELOG.md
81
97
  - Gemfile
@@ -107,7 +123,7 @@ metadata:
107
123
  homepage_uri: https://lucaguidi.com
108
124
  source_code_uri: https://github.com/jodosha/codeowners
109
125
  changelog_uri: https://github.com/jodosha/codeowners/blob/master/CHANGELOG.md
110
- post_install_message:
126
+ post_install_message:
111
127
  rdoc_options: []
112
128
  require_paths:
113
129
  - lib
@@ -122,8 +138,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
138
  - !ruby/object:Gem::Version
123
139
  version: '0'
124
140
  requirements: []
125
- rubygems_version: 3.1.3
126
- signing_key:
141
+ rubygems_version: 3.2.4
142
+ signing_key:
127
143
  specification_version: 4
128
144
  summary: GitHub Codeowners check and guess
129
145
  test_files: []