aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-07-25 08:13:21 -0700
committerJosé Valim <jose.valim@gmail.com>2011-07-25 08:13:21 -0700
commitb033a248146d53c65a1680cdeb76b2035e670dfd (patch)
treec1b1eff3f1547143574b1e2f064d619783e031a5 /railties
parent64affc9384e9e8845b0204b94c003265442bc3e2 (diff)
parent624b11861658478e9dcd75728f4f3e9d91e8c03d (diff)
downloadrails-b033a248146d53c65a1680cdeb76b2035e670dfd.tar.gz
rails-b033a248146d53c65a1680cdeb76b2035e670dfd.tar.bz2
rails-b033a248146d53c65a1680cdeb76b2035e670dfd.zip
Merge pull request #2258 from thedarkone/no-file-stat
Use shorter class-level File methods instead of going through File.stat
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/code_statistics.rb2
1 files changed, 1 insertions, 1 deletions
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