Class: Deplate::Command::REGISTER

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



565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
# File 'lib/deplate/commands.rb', line 565

def self.accumulate(src, array, deplate, text, match, args, cmd)
    Deplate::Core.log("%s: %s" % [cmd, text], :debug, src)
    list = args['id'] || args['list']
    if list
        elt = array.last
        if elt
            name = args['name'] || text
            if name and !name.empty?
                cap = Deplate::CaptionDef.new(name, args, src)
                elt.set_caption(cap)
            end
            elt.register_in_listing(list, args)
            return
        end
    end
    Deplate::Core.log(['Nothing to register', list], :error, src)
end