Class: Amrita::TemplateFile

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

Methods

load_template need_update? new

Public Class methods

new(path)

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

Public Instance methods

need_update?()

template will be loaded again if modified.

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

load_template()

    # File lib/amrita/template.rb, line 273
        def load_template
          @template = get_parser_class.parse_file(@path, setup_taginfo) do |e|
            if @parser_filter
              @parser_filter.call(e)
            else
              e
            end
          end
          @lastread = Time.now
        end