From: kai13@... Date: 2001-02-20T09:05:36+09:00 Subject: [ruby-list:28076] Re: HTML::Template みたいなもの HTML::Templateは使ったことがありませんが、(見当違いかもしれませんね) 私の場合、CGIはすべてテンプレートを用いています。 perlと違ってRubyは汎用的なクラスを作る必要性がないような気がします。 def print_template(template,title) open(template) do |file| while line = file.gets #line.gsub!(/==cgi==/,ENV['SCRIPT_NAME']) line.gsub!(//i, title) if // =~ line yield end print line end end end print_template("sample.html","sample"){ print "hello" } -- Akita http://tat6.ice.ous.ac.jp/akita/