Sha256: 157036982abe7a927055daddf56a5994a667434dacd32e6bdf7fc415dda97f94
Contents?: true
Size: 838 Bytes
Versions: 11
Compression:
Stored size: 838 Bytes
Contents
module MasterView class TemplateWatcher # check all the templates in the MIOTree to see if their mtimes # is newer than what we have saved in @@template_mtimes. # If newer, then run block and add path to array to be returned # If filename_pattern is specified then it will filter the results # returns array of paths that were newer def self.check_updated(template_mio_tree, filename_pattern, &block) template_paths_run = [] template_mio_tree.find(:pattern => filename_pattern) do |mio| mtime = mio.mtime @@template_mtimes ||= {} unless @@template_mtimes[mio.pathname.to_s] == mtime yield mio @@template_mtimes[mio.pathname.to_s] = mtime template_paths_run << mio.pathname.to_s end end template_paths_run end end end
Version data entries
11 entries across 11 versions & 1 rubygems