Initial import
This commit is contained in:
11
lib/picop/scanner.rb
Normal file
11
lib/picop/scanner.rb
Normal 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
|
||||
Reference in New Issue
Block a user