Class: Amrita::TemplateFileWithCache

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

Methods

[] cache_path new set_cache_dir source_mtime

Public Class methods

set_cache_dir(path)

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.

    # 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

[](path)

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

new(path)

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

Public Instance methods

cache_path()

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

source_mtime()

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