You can clone with HTTPS or SSH.
require 'erb' class WriterBinding attr_reader :_eoutvar def initialize(writer, context) @_eoutvar = OutputWriter.new(writer) for k,v in context self.instance_variable_set("@#{k}",v) end end def _eoutvar=(initial_value) puts "ignoring the assignment to #{initial_value.inspect}, because I don't want to be a string!!" end class OutputWriter def initialize(writer) @writer = writer end def concat(string) @writer.write(string) end end end t = ERB.new("Hello <%= @name %>", nil, nil, 'self._eoutvar') writer = Object.new def writer.write(bytes) print "<chunk>#{bytes}</chunk>" end cxt = WriterBinding.new(writer, :name => 'Charles') t.result(cxt.instance_eval {binding})