From: Kyle Heon Date: 2005-07-01T08:53:45+09:00 Subject: Re: Can you use Erb outside of Apache? Thanks everyone. One more question. What, if any, is the difference between Erb and eRuby? Kyle Heon kheon@comcast.net -----Original Message----- From: Jacob Fugal [mailto:lukfugl@gmail.com] Sent: Thursday, June 30, 2005 11:58 AM To: ruby-talk ML 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