Class: MasterView::MIO::MTimeStringHashMIOTree

Inherits:
StringHashMIOTree show all
Defined in:
lib/masterview/io.rb

Overview

MIOTree which works like StringHashMIO but uses MTimeTrackingHash to track mod times

Direct Known Subclasses

RailsErbCacheMIOTree

Constant Summary

Constants included from MasterViewIOTreeMixin

MasterView::MIO::MasterViewIOTreeMixin::DefaultExtensionInstances

Instance Attribute Summary

Attributes inherited from StringHashMIOTree

#string_hash

Instance Method Summary collapse

Methods inherited from StringHashMIOTree

#find

Methods included from MasterViewIOTreeMixin

#apply_filters, #cleanup_path_get_relative_pathname, #default_extension, #default_extension=, #default_mio_filter_block

Constructor Details

#initialize(default_extension = nil, options = {}, &block) ⇒ MTimeStringHashMIOTree

Returns a new instance of MTimeStringHashMIOTree.



184
185
186
# File 'lib/masterview/io.rb', line 184

def initialize(default_extension=nil, options={}, &block)
  super(MTimeTrackingHash.new, default_extension, options)
end

Instance Method Details

#path(path) ⇒ Object



188
189
190
191
192
193
# File 'lib/masterview/io.rb', line 188

def path(path)
  clean_path = Pathname.for_path(path).cleanpath
  mio = MTimeStringMIO.new(clean_path, @string_hash)
  mio.pathname = clean_path
  apply_filters(mio, @options, @new_mio_block)
end

#string_hash=(mtime_tracking_hash) ⇒ Object



195
196
197
198
# File 'lib/masterview/io.rb', line 195

def string_hash=(mtime_tracking_hash)
  raise "mtime_tracking_hash passed in does not respond_to mtime method call" unless mtime_tracking_hash.respond_to?(:mtime)
  @string_hash = mtime_tracking_hash
end