Allow to inspect a directory

This commit is contained in:
Vitalii Elenhaupt 2018-01-24 14:02:18 +02:00
parent a8c6ac6efd
commit ca502754b6
No known key found for this signature in database
GPG key ID: 7558EF3A4056C706

View file

@ -83,10 +83,11 @@ module Ameba
end
private def load_sources(config)
config.files
.map { |wildcard| Dir[wildcard] }
.flatten
.map { |path| Source.new File.read(path), path }
config.files.map do |wildcard|
wildcard += "/**/*.cr" if File.directory?(wildcard)
Dir[wildcard]
end.flatten
.map { |path| Source.new File.read(path), path }
end
end
end