From ca502754b652c0cec40dd621c2f72c65aed08664 Mon Sep 17 00:00:00 2001 From: Vitalii Elenhaupt Date: Wed, 24 Jan 2018 14:02:18 +0200 Subject: [PATCH] Allow to inspect a directory --- src/ameba/runner.cr | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ameba/runner.cr b/src/ameba/runner.cr index 26e5d54f..bd64dfbb 100644 --- a/src/ameba/runner.cr +++ b/src/ameba/runner.cr @@ -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