lib/reek/source/source_locator.rb in reek-3.0.0 vs lib/reek/source/source_locator.rb in reek-3.0.1

- old
+ new

@@ -29,11 +29,11 @@ @paths.map do |given_path| print_no_such_file_error(given_path) && next unless path_exists?(given_path) Find.find(given_path) do |path| pathname = Pathname.new(path) if pathname.directory? - exclude_path?(pathname) ? Find.prune : next + exclude_path?(pathname) || hidden_directory?(pathname) ? Find.prune : next else relevant_paths << pathname end end end @@ -48,9 +48,13 @@ Pathname.new(path).exist? end def print_no_such_file_error(path) $stderr.puts "Error: No such file - #{path}" + end + + def hidden_directory?(pathname) + pathname.basename.to_s.start_with? '.' end end end end