Class: Deplate::Command::OPT

Inherits:
Deplate::Command show all
Defined in:
lib/deplate/commands.rb

Class Method Summary collapse

Methods inherited from Deplate::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(src, array, deplate, text, match, args, cmd) ⇒ Object



280
281
282
283
284
285
286
287
288
289
290
291
292
293
# File 'lib/deplate/commands.rb', line 280

def self.accumulate(src, array, deplate, text, match, args, cmd)
    Deplate::Core.log("%s: %s" % [cmd, text], :debug, src)
    elt = array.last
    if elt
        cnt = Deplate::PseudoContainer.new(deplate, args)
        cnt.source = src
        opts, text = deplate.input.parse_args(text, cnt, false)
        deplate.register_id(opts, elt)
        update_variables(elt.args, args, opts)
        elt.update_args
    else
        Deplate::Core.log(['No element given', match[0]], :error, src)
    end
end