lib/kumogata/client.rb in kumogata-0.1.9 vs lib/kumogata/client.rb in kumogata-0.2.0

- old
+ new

@@ -145,38 +145,9 @@ Dslh.deval(template, :key_conv => key_conv, :value_conv => value_conv, :exclude_key => exclude_key) end def define_template_func(scope) scope.instance_eval(<<-'EOS') - def _join(data, options = {}) - options = { - :undent => true, - :trim_mode => nil, - }.merge(options) - - data = data.undent if options[:undent] - - @__refs__ = [] - def Ref(value); @__refs__ << {"Ref" => value}; "\0"; end - data = ERB.new(data, nil, options[:trim_mode]).result(binding) - undef Ref - - data = data.split("\0").zip(@__refs__) - @__refs__ = nil - - data = data.flatten.select {|i| not i.nil? }.map {|i| - if i.kind_of?(String) - StringIO.new(i).to_a - else - i - end - }.flatten - - return { - 'Fn::Join' => ['', data] - } - end - def _path(path, value = nil, &block) if block value = Dslh::ScopeBlock.nest(binding, 'block') end