Module: Piggly::Util::File
- Defined in:
- lib/piggly/util/file.rb
Class Method Summary collapse
-
.stale?(target, *sources) ⇒ Boolean
True if target file is older (by mtime) than any source file.
Class Method Details
.stale?(target, *sources) ⇒ Boolean
True if target file is older (by mtime) than any source file
6 7 8 9 10 11 12 13 |
# File 'lib/piggly/util/file.rb', line 6 def self.stale?(target, *sources) if ::File.exists?(target) oldest = ::File.mtime(target) sources.any?{|x| ::File.mtime(x) > oldest } else true end end |