owners 0.0.2 → 0.0.3

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
  SHA1:
3
- metadata.gz: d94ac158a395b3d6032f898cbd8bf71758cfe415
4
- data.tar.gz: 1c2e72fe393c988b077028866b47c94f57804fc3
3
+ metadata.gz: f2c5d1368d6ed27a906ece70e3a6edf976a9b0ac
4
+ data.tar.gz: 8c1436b5ed74e1fbfcef72b046f861ba2d9bb889
5
5
  SHA512:
6
- metadata.gz: 79ca73ab78b0ab0503e2a78c17fb9d5a32607eef4c3cacfa33071669db8126f6f6a56c65b860610925812093e00fc31e2595b0755187db5b6650a7cd333fd92b
7
- data.tar.gz: bca896ff7b7912e506e7460f5f530645e51d7c43eae4e418e66b3a0d1d1f9d39c94a922822bd60e36dd83d38e6faef6fdb2a607151161a2574b0acbc09582a36
6
+ metadata.gz: 0d4d45161eea9276c36647ab495ab5390d94b92a52532469094f53eead63a1f4e95010dd9ce77b0b1b27e7cc87d94cf7292818be4f705355c509167f5846e89b
7
+ data.tar.gz: 867e795bb099861807809d7248eb6224cc66a40f828fc34d0b81a0492795a16ffab4d24acfa39df9ccc3ca3827187aefc616feeff2b2a12b0d268d231b690789
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- owners (0.0.2)
4
+ owners (0.0.3)
5
5
  thor
6
6
 
7
7
  GEM
@@ -1,3 +1,6 @@
1
1
  data@example.com
2
2
  @blogger ^blog\.rb$
3
3
  @whitespace post.rb
4
+
5
+ @owner comment.rb
6
+ @duplicate comment.rb
@@ -5,7 +5,7 @@ module Owners
5
5
  # @api private
6
6
  class Config
7
7
  def initialize(file)
8
- @config = file.read
8
+ @contents = file.read
9
9
  @root = file.dirname.to_s
10
10
  end
11
11
 
@@ -28,7 +28,7 @@ module Owners
28
28
  end
29
29
 
30
30
  def subscriptions
31
- @config.split("\n").reject(&:empty?)
31
+ @contents.split("\n").reject(&:empty?)
32
32
  end
33
33
  end
34
34
  end
@@ -38,7 +38,10 @@ module Owners
38
38
  end
39
39
 
40
40
  def paths
41
- @files.map { |file| Pathname.new(file) }
41
+ @files.map do |file|
42
+ file.prepend("./") unless file =~ /^\.?\//
43
+ Pathname.new(file)
44
+ end
42
45
  end
43
46
  end
44
47
  end
@@ -1,3 +1,3 @@
1
1
  module Owners
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -52,5 +52,13 @@ RSpec.describe Owners do
52
52
  expect(subject).to eq(["@org/blog", "@whitespace", "data@example.com"])
53
53
  end
54
54
  end
55
+
56
+ context "with multiple owners" do
57
+ let(:paths) { ["example/app/models/comment.rb"] }
58
+
59
+ it "parses owners correctly" do
60
+ expect(subject).to eq(["@duplicate", "@org/blog", "@owner", "data@example.com"])
61
+ end
62
+ end
55
63
  end
56
64
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: owners
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Huber
@@ -59,6 +59,7 @@ files:
59
59
  - example/app/controllers/users_controller.rb
60
60
  - example/app/models/OWNERS
61
61
  - example/app/models/blog.rb
62
+ - example/app/models/comment.rb
62
63
  - example/app/models/post.rb
63
64
  - example/app/models/user.rb
64
65
  - lib/owners.rb