lib/roda/plugins/capture_erb.rb
def capture_erb
          outvar = render_opts[:template_opts][:outvar]
          buf_was = instance_variable_get(outvar)
          instance_variable_set(outvar, String.new)
          yield.to_s
        ensure
          instance_variable_set(outvar, buf_was) if outvar && buf_was
        end
# Temporarily replace the ERB output buffer
# with an empty string, and then yield to the block.
# Return the value of the block, converted to a string.
# Restore the previous ERB output buffer before returning.
Temporarily replace the ERB output buffer
with an empty string, and then yield to the block.
Return the value of the block, converted to a string.
Restore the previous ERB output buffer before returning.
Temporarily replace the ERB output buffer with an empty string and then yield to the block . Return the value of the block converted to a string . Restore the previous ERB output buffer before returning .
def capture_erb
          outvar = render_opts[:template_opts][:outvar]
          buf_was = instance_variable_get(outvar)
          instance_variable_set(outvar, String.new)
          yield.to_s
        ensure
          instance_variable_set(outvar, buf_was) if outvar && buf_was
        end
def capture_erb outvar = render_opts [ :template_opts ] [ :outvar ] buf_was = instance_variable_get ( outvar ) instance_variable_set ( outvar , String . new ) yield . to_s ensure instance_variable_set ( outvar , buf_was ) if outvar && buf_was end
Temporarily replace the ERB output buffer
with an empty string, and then yield to the block.
Temporarily replace the ERB output buffer with an empty string and then yield to the block .