code_owners 1.0.7 → 1.0.8

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
- SHA256:
3
- metadata.gz: cd7998397d45dc60a1fb77fad414a119a9df181a61f5aa7b135ee674ebce9008
4
- data.tar.gz: 3c3e4a62f8fb6a7650c90c7ac1975faf93edb91503092fa4f9a3092687e34587
2
+ SHA1:
3
+ metadata.gz: 0c170835202aa29d1d863ac544a039dfa2aaca9b
4
+ data.tar.gz: 732f6a87815efa4092ea1404b55180d9bde78f39
5
5
  SHA512:
6
- metadata.gz: c635ae7dbc19ee970e7d8701545839437c20b8121af692d43c1b835693d53163f70fe5291984d28cbe4e41aecb9ce59dd43d75d33f3994b0e810e05dc87d26c9
7
- data.tar.gz: fa2c93f8181119b3dc6a5d08ebaba882c9875c92835917de40a6e6650ec6e108aaedfb028d1843d695da537eaaf2a7f877828c3d0383003730ec512ca140a020
6
+ metadata.gz: b205789714617196c0e067504e8beae29dc585a6601a79279475a3a17cc36b249d61e896c6972d8d2fc2b4780e5df406a86c92226ef6013fd6fb262087733ae6
7
+ data.tar.gz: 4e7766d5ee8b1adf676974e8dce8345ce93d2b4b9e868d4295578d35b5656897621c0dcf00e227377024946e2d7429c695e2bf86539fbd24a5992fdce2c9e4fd
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- code_owners (1.0.7)
4
+ code_owners (1.0.8)
5
5
  rake
6
6
 
7
7
  GEM
8
8
  remote: http://rubygems.org/
9
9
  specs:
10
10
  diff-lcs (1.3)
11
- rake (12.3.3)
11
+ rake (13.0.6)
12
12
  rspec (3.8.0)
13
13
  rspec-core (~> 3.8.0)
14
14
  rspec-expectations (~> 3.8.0)
@@ -31,4 +31,4 @@ DEPENDENCIES
31
31
  rspec
32
32
 
33
33
  BUNDLED WITH
34
- 1.17.2
34
+ 1.17.3
data/README.md CHANGED
@@ -5,6 +5,12 @@ Install
5
5
 
6
6
  gem install code_owners
7
7
 
8
+ Requirements
9
+ ============
10
+
11
+ * Ruby
12
+ * Git
13
+
8
14
  Usage
9
15
  =====
10
16
 
@@ -24,12 +30,12 @@ Development
24
30
 
25
31
  Maybe put it in a cleanliness test, like:
26
32
 
27
- ```
28
- it "does not introduce new unowned files" do
29
- unowned_files = CodeOwners.ownerships.select { |f| f[:owner] == "UNOWNED" }
30
- # this number should only decrease, never increase!
31
- assert_equal 12345, unowned_files.count, "Claim ownership of your new files in .github/CODEOWNERS to fix this test!"
32
- end
33
+ ```ruby
34
+ it "does not introduce new unowned files" do
35
+ unowned_files = CodeOwners.ownerships.select { |f| f[:owner] == CodeOwners::NO_OWNER }
36
+ # this number should only decrease, never increase!
37
+ assert_equal 12345, unowned_files.count, "Claim ownership of your new files in .github/CODEOWNERS to fix this test!"
38
+ end
33
39
  ```
34
40
 
35
41
  Author
data/bin/code_owners CHANGED
@@ -1,7 +1,18 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ unless system('git --version > /dev/null')
4
+ STDERR.puts 'Git does not appear to be installed.'
5
+ exit 2
6
+ end
7
+
8
+ unless system('git rev-parse --is-inside-work-tree > /dev/null')
9
+ STDERR.puts 'The current working directory must be a Git repo.'
10
+ exit 3
11
+ end
12
+
3
13
  $LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib')
4
14
  require 'code_owners'
15
+ require 'code_owners/version'
5
16
  require 'optparse'
6
17
 
7
18
  options = {}
@@ -13,6 +24,10 @@ OptionParser.new do |opts|
13
24
  opts.on('-e', '--error-unowned', TrueClass, 'Exit with error status if any files are unowned') do |e|
14
25
  options[:error_unowned] = e
15
26
  end
27
+ opts.on('-v', '--version', TrueClass, 'Display the version of the gem') do |_|
28
+ puts "Version: #{CodeOwners::VERSION}"
29
+ exit 0
30
+ end
16
31
  end.parse!
17
32
 
18
33
  unowned_error = false
data/code_owners.gemspec CHANGED
@@ -8,10 +8,10 @@ Gem::Specification.new name, CodeOwners::VERSION do |s|
8
8
  s.description = "utility gem for .github/CODEOWNERS introspection"
9
9
  s.authors = "Jonathan Cheatham"
10
10
  s.email = "coaxis@gmail.com"
11
- s.homepage = "http://github.com/jcheatham/#{s.name}"
11
+ s.homepage = "https://github.com/jcheatham/#{s.name}"
12
12
  s.licenses = "MIT"
13
13
 
14
- s.files = `git ls-files`.split("\n")
14
+ s.files = `git -c "core.quotepath=off" ls-files`.split("\n")
15
15
  s.bindir = 'bin'
16
16
  s.test_files = `git ls-files -- test/*`.split("\n")
17
17
  s.require_paths = ["lib"]
@@ -1,3 +1,3 @@
1
1
  module CodeOwners
2
- VERSION = "1.0.7"
2
+ VERSION = "1.0.8"
3
3
  end
data/lib/code_owners.rb CHANGED
@@ -77,7 +77,7 @@ module CodeOwners
77
77
  Tempfile.open('codeowner_patterns') do |file|
78
78
  file.write(patterns.join("\n"))
79
79
  file.rewind
80
- `cd #{current_repo_path} && git ls-files | xargs -- git -c \"core.excludesfile=#{file.path}\" check-ignore --no-index -v -n`
80
+ `cd #{current_repo_path} && git -c \"core.quotepath=off\" ls-files | xargs -- git -c \"core.quotepath=off\" -c \"core.excludesfile=#{file.path}\" check-ignore --no-index -v -n`
81
81
  end
82
82
  end
83
83
 
@@ -87,4 +87,16 @@ CODEOWNERS
87
87
  expect(raw_ownership).to match(/^(?:.*:\d*:.*\t.*\n)+$/)
88
88
  end
89
89
  end
90
+
91
+ describe "code_owners" do
92
+ VERSION_REGEX = /Version: \d+\.\d+\.\d+(-[a-z0-9]+)?/i
93
+
94
+ it "prints a version number with the short option" do
95
+ expect(`bin#{File::SEPARATOR}code_owners -v`).to match VERSION_REGEX
96
+ end
97
+
98
+ it "prints a version number with the short option" do
99
+ expect(`bin#{File::SEPARATOR}code_owners --version`).to match VERSION_REGEX
100
+ end
101
+ end
90
102
  end
@@ -0,0 +1 @@
1
+ ☃☃☃☃☃☃☃☃☃
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: code_owners
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Cheatham
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2018-03-29 00:00:00.000000000 Z
@@ -57,11 +57,12 @@ files:
57
57
  - lib/code_owners.rb
58
58
  - lib/code_owners/version.rb
59
59
  - spec/code_owners_spec.rb
60
- homepage: http://github.com/jcheatham/code_owners
60
+ - spec/files/☃.txt
61
+ homepage: https://github.com/jcheatham/code_owners
61
62
  licenses:
62
63
  - MIT
63
64
  metadata: {}
64
- post_install_message:
65
+ post_install_message:
65
66
  rdoc_options: []
66
67
  require_paths:
67
68
  - lib
@@ -76,8 +77,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
77
  - !ruby/object:Gem::Version
77
78
  version: '0'
78
79
  requirements: []
79
- rubygems_version: 3.0.1
80
- signing_key:
80
+ rubyforge_project:
81
+ rubygems_version: 2.5.2.3
82
+ signing_key:
81
83
  specification_version: 4
82
84
  summary: ".github/CODEOWNERS introspection utility gem"
83
85
  test_files: []