From 624b11861658478e9dcd75728f4f3e9d91e8c03d Mon Sep 17 00:00:00 2001 From: thedarkone Date: Mon, 25 Jul 2011 17:01:30 +0200 Subject: Use shorter class-level File methods instead of going through File.stat. --- railties/lib/rails/code_statistics.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties') diff --git a/railties/lib/rails/code_statistics.rb b/railties/lib/rails/code_statistics.rb index 770c23ae41..e6822b75b7 100644 --- a/railties/lib/rails/code_statistics.rb +++ b/railties/lib/rails/code_statistics.rb @@ -30,7 +30,7 @@ class CodeStatistics #:nodoc: stats = { "lines" => 0, "codelines" => 0, "classes" => 0, "methods" => 0 } Dir.foreach(directory) do |file_name| - if File.stat(directory + "/" + file_name).directory? and (/^\./ !~ file_name) + if File.directory?(directory + "/" + file_name) and (/^\./ !~ file_name) newstats = calculate_directory_statistics(directory + "/" + file_name, pattern) stats.each { |k, v| stats[k] += newstats[k] } end -- cgit v1.2.3