I would like to create a file containing HTML code. This is not part of
a web application, and in particular I am not writing a CGI script.
I could just create the HTML code (using puts(…) statements).
I could also use some HTML template (ERB,…)
I prefer however to use a library which just makes the HTML generation a
bit easier, for example by automatically closing open tags and so.
Things which the cgi module is doing.
However, since I am not in a “real” CGI environment, creating the output
object already has a specific meaning, i.e. running in “offline mode”.
If we try this in irb:
(offline mode: enter name=value pairs on standard input)
- Is there a way I could use the cgi module for my task?
- Are there other ways to solve this?