Initial import

This commit is contained in:
Dan Milne
2025-01-19 10:42:59 +11:00
commit 05d55ca665
20 changed files with 439 additions and 0 deletions

11
lib/picop/scanner.rb Normal file
View File

@@ -0,0 +1,11 @@
module Picop
module Scanner
def self.scan(directory, pattern: "**/*")
Dir.glob(File.join(directory, pattern)).select do |file|
next unless File.file?(file)
content = File.read(file)
content.match?(SourceFile::METADATA_PATTERN)
end.map { |file| SourceFile.new(file) }
end
end
end