Sha256: a449a446dd83fa6a78a6d2d61476fc2d29e1dfb14985cd2ea93971faf12ec4c4
Contents?: true
Size: 592 Bytes
Versions: 7
Compression:
Stored size: 592 Bytes
Contents
module Pione module Util module LastTime # Return last time of data locations. The criteria of last time is # location's mtime and ctime. def self.get(locations) locations.inject(nil) do |last_time, location| mtime = location.mtime # mtime should be supported ctime = location.ctime rescue nil # ctime may be not supported # get newer time this_time = [mtime, ctime].max # compare (last_time.nil? or last_time < this_time) ? this_time : last_time end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems