diff --git a/actionpack/lib/action_view/template/resolver.rb b/actionpack/lib/action_view/template/resolver.rb
index 2b9427ace53ec178e186e2df1954b39cce1021f9..5f7fe81bd5742f8f28d21f1186316a9cda42c54c 100644
--- a/actionpack/lib/action_view/template/resolver.rb
+++ b/actionpack/lib/action_view/template/resolver.rb
@@ -161,7 +161,7 @@ def build_query(path, details)
# Returns the file mtime from the filesystem.
def mtime(p)
- File.stat(p).mtime
+ File.mtime(p)
end
# Extract handler and formats from path. If a format cannot be a found neither
diff --git a/actionpack/test/template/asset_tag_helper_test.rb b/actionpack/test/template/asset_tag_helper_test.rb
index e88a3591d86069abbdb6441ffb1b8b357bcc2951..d93433deac0338403b3662035bacca487472c834 100644
--- a/actionpack/test/template/asset_tag_helper_test.rb
+++ b/actionpack/test/template/asset_tag_helper_test.rb
@@ -481,7 +481,7 @@ def test_audio_tag
end
def test_timebased_asset_id
- expected_time = File.stat(File.expand_path(File.dirname(__FILE__) + "/../fixtures/public/images/rails.png")).mtime.to_i.to_s
+ expected_time = File.mtime(File.expand_path(File.dirname(__FILE__) + "/../fixtures/public/images/rails.png")).to_i.to_s
assert_equal %(), image_tag("rails.png")
end
@@ -512,7 +512,7 @@ def test_image_tag_interpreting_email_adding_optional_alt_tag
def test_timebased_asset_id_with_relative_url_root
@controller.config.relative_url_root = "/collaboration/hieraki"
- expected_time = File.stat(File.expand_path(File.dirname(__FILE__) + "/../fixtures/public/images/rails.png")).mtime.to_i.to_s
+ expected_time = File.mtime(File.expand_path(File.dirname(__FILE__) + "/../fixtures/public/images/rails.png")).to_i.to_s
assert_equal %(), image_tag("rails.png")
end
diff --git a/activesupport/lib/active_support/file_update_checker.rb b/activesupport/lib/active_support/file_update_checker.rb
index a97e9d7dafd882725b70a99f451f37ddbf706303..f76ddff038707060d78407819e23e6adc2d472e0 100644
--- a/activesupport/lib/active_support/file_update_checker.rb
+++ b/activesupport/lib/active_support/file_update_checker.rb
@@ -22,7 +22,7 @@ def initialize(paths, calculate=false, &block)
end
def updated_at
- paths.map { |path| File.stat(path).mtime }.max
+ paths.map { |path| File.mtime(path) }.max
end
def execute_if_updated
diff --git a/railties/lib/rails/code_statistics.rb b/railties/lib/rails/code_statistics.rb
index 770c23ae4173e5f62c905e85e8a2a984ee4dc921..e6822b75b7a9575ffa3d63c2d928b7b2805f836c 100644
--- a/railties/lib/rails/code_statistics.rb
+++ b/railties/lib/rails/code_statistics.rb
@@ -30,7 +30,7 @@ def calculate_directory_statistics(directory, pattern = /.*\.rb$/)
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