At Tue, 9 May 2000 09:14:51 -0400,
Andrew Hunt <Andy / Toolshed.Com> wrote:

> Also, the same question for eRuby - it seems pretty straightforward, but
> I can't find any English documentation, so more examples would be
> great.

If you know apache web server, you can invoke eruby via accessing
certain kind of web resouces:

- 1st: Copy eruby binary to cgin-bin directory.
- 2nd: Add following two lines to httpd.conf:

AddType application/x-httpd-eruby .rhtml
Action application/x-httpd-eruby /cgi-bin/eruby

I also recommend to add or replace the DirectoryIndex directive to that
it includes index.rhtml, so one can access directory/ and get
index.rhtml, like this:

DirectoryIndex index.html index.shtml index.rhtml

Now, when you request *.rhtml files, that file is parsed by eruby and
the result would be obtained.

Try this.rhtml

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>eruby example</title>
</head>
<body>
<h1>Enumeration</h1>
<ul>
<%(1..10).each do|i|%>
  <li>number <%=i%></li>
<%end%>
</ul>
<h1>Environment variables</h1>
<table>
<%ENV.keys.sort.each do |key|%>
  <tr>
    <th><%=key%></th><td><%=ENV[key]%></td>
  </tr>
<%end%>
</table>
</body>
</html>

-- 
OZAWA -Crouton- Sakuro
E-Mail: mailto:crouton / duelists.org
        mailto:crouton / isoternet.org
   Web: http://www.duelists.org/~crouton/
   PGP: C98F 74E0 AEEB 4578 1DFC  F650 3BE0 9627 11FC C9F5