Class Amrita::TemplateFileWithCache
In: lib/amrita/template.rb
Parent: TemplateFile

Methods

Public Class methods

[Source]

# File lib/amrita/template.rb, line 379
    def TemplateFileWithCache::[](path)
      TemplateFileWithCache.new(path)
    end

[Source]

# File lib/amrita/template.rb, line 383
    def initialize(path)
      super
      @cache_manager = @@cache_manager if @@cache_manager
    end

CAUTION: be careful to prevent users to edit the cache file. It‘s YOUR resposibility to protect the cache files from crackers. Don‘t use TemplateFileWithCache::set_cache_dir if you don‘t understand this.

[Source]

# File lib/amrita/template.rb, line 368
    def TemplateFileWithCache::set_cache_dir(path)
      if path
        @@cache_manager = SourceCache.new(path)
      else
        @@cache_manager = nil
      end
    end

Public Instance methods

[Source]

# File lib/amrita/template.rb, line 388
    def cache_path
      @path
    end

[Source]

# File lib/amrita/template.rb, line 392
    def source_mtime
      File::stat(@path).mtime
    end

[Validate]