From: Jacob Fugal Date: 2005-07-01T00:57:46+09:00 Subject: Re: Can you use Erb outside of Apache? On 6/29/05, Kyle Heon wrote: > Nevermind. I figured it out. > > code: > > require 'erb' > @foo = "Hello World!" > erb = ERB.new("
foo: <%= @foo %>
") > erb.run > > result: > >
foo: Hello World!
> > If there is a better way, I'm still open. You can also use eruby on the command line: $ cat hello.template <% def greet( who ) "Hello, #{who}!" end %>
foo: <%= greet( "world" ) %>
$ eruby hello.template
foo: Hello, world!
Jacob Fugal