Class: Deplate::Define::Command

Inherits:
Command show all
Extended by:
TemplateExpander
Defined in:
lib/deplate/define.rb

Class Method Summary collapse

Methods included from TemplateExpander

use_template

Methods inherited from Command

commands, #finish, #format_special, #process, register_as, #setup, #setup_command, update_variables

Methods included from Names

name_match_c, name_match_fs, name_match_sf

Methods inherited from Element

#join_lines, #join_lines_re_zh_cn

Class Method Details

.accumulate(source, array, deplate, text, match, args, cmd) ⇒ Object



277
278
279
280
281
282
283
284
285
286
287
288
289
290
# File 'lib/deplate/define.rb', line 277

def accumulate(source, array, deplate, text, match, args, cmd)
    Deplate::Core.log("%s: %s" % [cmd, text], :debug)
    template, mandatory = setup_template(text, deplate)
    args['@body'] = text
    Deplate::Define.check_arguments(mandatory, args, source)
    tpl = use_template(template, 
                       :deplate => deplate,
                       :args => args,
                       :source => source
                      )
    Deplate::Define.let_variables(deplate, args) do
        deplate.include_stringarray(tpl, array, source.begin, source.file)
    end
end