Skip to content

Instantly share code, notes, and snippets.

@rickhull
Created July 24, 2015 20:12
Show Gist options
  • Save rickhull/7c656d995b4994fdb7a4 to your computer and use it in GitHub Desktop.
Save rickhull/7c656d995b4994fdb7a4 to your computer and use it in GitHub Desktop.
$ cat test.erb
<%= @test %>
$ irb -rerubis
irb(main):001:0> template = Erubis::Eruby.new(File.read('test.erb'))
=> #<Erubis::Eruby:0x007fd975ca8f40 @escapefunc="Erubis::XmlHelper.escape_xml", @bufvar="_buf", @preamble=nil, @postamble=nil, @escape=nil, @pattern=nil, @trim=true, @filename=nil, @_proc=nil, @src="_buf = ''; _buf << ( @test ).to_s; _buf << '\n';\n_buf.to_s\n">
irb(main):002:0> template.result(:test => 'foo')
=> "\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment