Sha256: b7301573551de5aa2cdf1fab28459e79c30730f43f4d55da0da2bffe6ca8b961
Contents?: true
Size: 730 Bytes
Versions: 7
Compression:
Stored size: 730 Bytes
Contents
module Pakyow module Presenter class ViewStoreLoader include Singleton def initialize @last_mod = {} end def modified?(name, paths) paths = Array.ensure(paths) if !@last_mod.key?(name) modified(name) return true end paths.each do |path| Dir.walk(path) do |p| next if FileTest.directory?(p) if File.mtime(p) > @last_mod[name] modified(name) return true end end end false end def reset @last_mod = {} end private def modified(name) @last_mod[name] = Time.now end end end end
Version data entries
7 entries across 7 versions & 1 rubygems