here's the first CGI program that I've written in Ruby:
- Code: Select all
#!/usr/bin/env ruby
# -*-mode: ruby; coding: utf-8;-*-
require 'cgi'
class MyCGI < CGI
def initialize
super("html4")
end
def greet
out do
html{
[head{
[title{"A title"}]},
body{
[i{"Hello"},
" ",
b{"world!"}]
}]}
end
end
end
cgi = MyCGI.new
cgi.greet
Thomas


