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

Methods

Public Class methods

[Source]

# File lib/amrita/template.rb, line 272
    def initialize(path)
      super()
      @path = path
      @lastread = nil
    end

Public Instance methods

[Source]

# File lib/amrita/template.rb, line 284
    def load_template
      parser = nil
      File.open(@path) {|f|
        parser = get_parser_class.new(f.read(), @path, 0, setup_taginfo)
      }
      @template = parse_template(parser)
      @lastread = Time.now
    end

template will be loaded again if modified.

[Source]

# File lib/amrita/template.rb, line 279
    def need_update?
      return true unless @lastread
      @lastread < File::stat(@path).mtime
    end

[Validate]