class Codeowners::Checker::Whitelist
Manage CODEOWNERS_WHITELIST file reading
Public Class Methods
new(filename)
click to toggle source
# File lib/codeowners/checker/whitelist.rb, line 9 def initialize(filename) @filename = filename end
Public Instance Methods
exist?()
click to toggle source
# File lib/codeowners/checker/whitelist.rb, line 13 def exist? File.exist?(@filename) end
to_proc()
click to toggle source
# File lib/codeowners/checker/whitelist.rb, line 21 def to_proc proc { |item| whitelisted?(item) } end
whitelisted?(filename)
click to toggle source
# File lib/codeowners/checker/whitelist.rb, line 17 def whitelisted?(filename) pathspec.match(filename) end
Private Instance Methods
pathspec()
click to toggle source
# File lib/codeowners/checker/whitelist.rb, line 27 def pathspec @pathspec = if File.exist?(@filename) PathSpec.from_filename(@filename) else PathSpec.new([]) end end