Skip to content

Instantly share code, notes, and snippets.

@DNNX DNNX/erbug.rb
Created Sep 19, 2011

Embed
What would you like to do?
ERB+Windows bug (extra newlines)
require 'erb'
arr = [1,2,3]
context = instance_eval('binding')
src = ::File.binread('template.rb.tt')
content = ERB.new(src, nil, '-', '@output_buffer').result(context)
print content
<%- arr.each_with_index do |c,i| -%>
<%= ' '*i %>* <%= c %>
<%- end -%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.