Class: Codeowners::CodeownersFile
- Inherits:
-
Object
- Object
- Codeowners::CodeownersFile
- Extended by:
- Forwardable
- Defined in:
- lib/codeowners/codeowners_file.rb
Overview
Parses a Codeowners file
Instance Method Summary collapse
- #globs ⇒ Object
-
#initialize(codeowners_source = File.read('./.github/CODEOWNERS')) ⇒ CodeownersFile
constructor
A new instance of CodeownersFile.
- #ownerships ⇒ Object
- #ownerships_reversed ⇒ Object
Constructor Details
#initialize(codeowners_source = File.read('./.github/CODEOWNERS')) ⇒ CodeownersFile
Returns a new instance of CodeownersFile.
20 21 22 |
# File 'lib/codeowners/codeowners_file.rb', line 20 def initialize(codeowners_source = File.read('./.github/CODEOWNERS')) @source = codeowners_source end |
Instance Method Details
#globs ⇒ Object
32 33 34 |
# File 'lib/codeowners/codeowners_file.rb', line 32 def globs @globs ||= lines.map { |line| Glob.new(line.to_s.split.first) } end |
#ownerships ⇒ Object
28 29 30 |
# File 'lib/codeowners/codeowners_file.rb', line 28 def ownerships @ownerships ||= lines.map { |line| Ownership.new(*line.to_s.split) } end |
#ownerships_reversed ⇒ Object
24 25 26 |
# File 'lib/codeowners/codeowners_file.rb', line 24 def ownerships_reversed @ownerships_reversed ||= ownerships.reverse end |