class Pronto::Punchlist::FileClassifier

Classify whether files are relevant to punchlist

Public Class Methods

new(source_file_globber: SourceFinder::SourceFileGlobber.new) click to toggle source
# File lib/pronto/punchlist/file_classifier.rb, line 7
def initialize(source_file_globber: SourceFinder::SourceFileGlobber.new)
  @source_file_globber = source_file_globber
end

Public Instance Methods

non_binary?(path) click to toggle source
# File lib/pronto/punchlist/file_classifier.rb, line 11
def non_binary?(path)
  # https://ruby-doc.org/core-2.5.1/File.html#method-c-fnmatch
  # EXTGLOB enables ',' as part of glob language
  File.fnmatch?(@source_file_globber.source_and_doc_files_glob,
                path,
                File::FNM_EXTGLOB)
end