Re: eruby

Shugo Maeda <[email protected]>
Newsgroups gmane.comp.apache.mod-ruby
Message-ID <[email protected]>
Hi,

At Tue, 27 Jan 2004 11:44:35 -0800 (PST),
paul vudmaska <[email protected]> wrote:
> Is there a way to eval a string with ERuby rather than
> a file?...something like(ERuby.eval(srhtml)).

You can use ERuby::Compiler.

- test.rb -
require "eruby"
                                                                                
compiler = ERuby::Compiler.new
code = compiler.compile_string('hello <% print "world\n" %>')
eval(code)
----

Shugo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.