diff options
Diffstat (limited to 'railties/lib/rails/code_statistics.rb')
-rw-r--r-- | railties/lib/rails/code_statistics.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/lib/rails/code_statistics.rb b/railties/lib/rails/code_statistics.rb index 40416dd83a..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 @@ -104,4 +104,4 @@ class CodeStatistics #:nodoc: puts " Code LOC: #{code} Test LOC: #{tests} Code to Test Ratio: 1:#{sprintf("%.1f", tests.to_f/code)}" puts "" end - end +end |