Sha256: 208e4667e52864458317349fd9d5c46781b841ba6b2f51a2209a151b6bbfce17
Contents?: true
Size: 457 Bytes
Versions: 88
Compression:
Stored size: 457 Bytes
Contents
def bake_format(data, output, indent) indent_level = 0 data.each_line do |l| l.strip! opening = l.count('{') closing = l.count('}') old_indent_level = indent_level indent_level = indent_level + opening - closing prefix = if indent_level > old_indent_level indent * old_indent_level else indent * indent_level end output.puts((prefix + l).rstrip) end output.close end
Version data entries
88 entries across 88 versions & 1 rubygems