Class: GitlabCodeownersChecker::Checkers::NoOwner

Inherits:
Object
  • Object
show all
Defined in:
lib/gitab_codeowners_checker/checkers/no_owner.rb

Instance Method Summary collapse

Constructor Details

#initialize(files:, codeowners:) ⇒ NoOwner

Returns a new instance of NoOwner.



8
9
10
11
# File 'lib/gitab_codeowners_checker/checkers/no_owner.rb', line 8

def initialize(files:, codeowners:)
  @files = files
  @codeowners = codeowners
end

Instance Method Details

#files_without_ownerObject



13
14
15
16
17
# File 'lib/gitab_codeowners_checker/checkers/no_owner.rb', line 13

def files_without_owner
  @files_without_owner ||= @files.each_with_object([]) do |f, acc|
    acc.push(f) unless @codeowners.patterns.find { |p| p.match?(f) }
  end
end