instance method
max_mtime
Ruby on Rails 4.0.13
Since v4.0.13 PrivateSignature
max_mtime(paths)
This method returns the maximum mtime of the files in paths, or nil if the array is empty.
Files with a mtime in the future are ignored. Such abnormal situation can happen for example if the user changes the clock by hand. It is healthy to consider this edge case because with mtimes in the future reloading is not triggered.
Parameters
-
pathsreq
Source
# File activesupport/lib/active_support/file_update_checker.rb, line 112
def max_mtime(paths)
time_now = Time.now
paths.map {|path| File.mtime(path)}.reject {|mtime| time_now < mtime}.max
end
Defined in activesupport/lib/active_support/file_update_checker.rb line 112
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::FileUpdateChecker