devdaily home | apple | java | perl | unix | directory | blog

What this is

This file is included in the DevDaily.com "Ruby Source Code Warehouse" project. The intent of this project is to help you "Learn Ruby by Example" TM.

Other links

The source code

# Copyritght (c) 2002 TANIGUCHI Takaki
# This program is distributed under the GNU GPL 2 or later.

require 'amrita/merge'

module AsWiki
  class MergeTemplateFile < Amrita::MergeTemplate
    def initialize(template, dir=nil, &block)
      @template = template
      super(dir, &block)
    end

    def amrita_expand_element(e, context)
      case e.hid
      when /template#(.*)/
        data_id = $1
        e = merge_templates(@template, data_id, e, context)
      else
        e.init_body do
          e.body.expand1(self, context)
        end
      end

      if @body
        e.expand(@body, context)
      else
        e
      end
    end
  end
end




Copyright 1998-2008 Alvin Alexander
All Rights Reserved.
 
devdaily.com is based in louisville, kentucky, and this web site is hosted by godaddy.com