From ef233bba9a0770ada1ebb45c804a319777bbff45 Mon Sep 17 00:00:00 2001 From: Edouard CHIN <edouard.chin@shopify.com> Date: Mon, 11 Jan 2016 02:42:23 -0500 Subject: CodeStatistic will now ignore hidden files: - Modify the default regex to not match hidden files --- railties/lib/rails/code_statistics.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/lib') diff --git a/railties/lib/rails/code_statistics.rb b/railties/lib/rails/code_statistics.rb index 8e9097e1ef..0997414482 100644 --- a/railties/lib/rails/code_statistics.rb +++ b/railties/lib/rails/code_statistics.rb @@ -33,7 +33,7 @@ class CodeStatistics #:nodoc: Hash[@pairs.map{|pair| [pair.first, calculate_directory_statistics(pair.last)]}] end - def calculate_directory_statistics(directory, pattern = /.*\.(rb|js|coffee|rake)$/) + def calculate_directory_statistics(directory, pattern = /^(?!\.).*?\.(rb|js|coffee|rake)$/) stats = CodeStatisticsCalculator.new Dir.foreach(directory) do |file_name| -- cgit v1.2.3