class Owners::Owner

Represents a unique “owner” across any number of OWNERS files.

It is a simple wrapper around a {String} with some useful methods for inspecting an owner’s type and subscriptions.

@api public

Public Instance Methods

paths() click to toggle source
   # File lib/owners/owner.rb
 9 def paths
10   subscriptions.keys
11 end
subscriptions() click to toggle source
   # File lib/owners/owner.rb
13 def subscriptions
14   @subscriptions ||= Hash.new { |hash, key| hash[key] = [] }
15 end
type() click to toggle source
   # File lib/owners/owner.rb
17 def type
18   case to_s
19   when /^!/
20     :alert
21   when /^[\w+\-.]+@[a-z\d\-]+(\.[a-z]+)*\.[a-z]+$/i
22     :email
23   when /^@.+\/[^@]+$/
24     :group
25   when /^@/
26     :mention
27   when /^#/
28     :tag
29   else
30     :label
31   end
32 end