Class: Deplate::Regions::Ruby

Inherits:
Deplate::Region show all
Defined in:
lib/deplate/regions.rb

Instance Method Summary collapse

Methods inherited from Deplate::Region

check_file, clean_strings, #deprecated_regnote, deprecated_regnote, #finish_accum, #format_compound, regions, register_as, set_line_cont, #setup

Methods inherited from Element

#join_lines, #join_lines_re_zh_cn

Instance Method Details

#finishObject



1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
# File 'lib/deplate/regions.rb', line 1108

def finish
    finish_accum
    @accum = [@deplate.eval_ruby(self, @args, @accum.join("\n")).to_s]
    if @args['verb']
        return Deplate::Regions::Verbatim.new(@deplate, @source, @accum, @match, self).finish
    elsif @args['img'] or @args['image']
        file = @args['img'] || @args['image']
        return Deplate::Command::IMG.new(@deplate, @source, file, nil, {}, 'IMG').finish
    elsif @args['native']
        return Deplate::Regions::Native.new(@deplate, @source, @accum, @match, self).finish
    else
        acc = []
        @accum.collect! {|l| l.split(/\n/)}
        @accum.flatten!
        @deplate.include_stringarray(@accum, acc, @source.begin, @source.file)
        return acc
    end
end