From: Kurt Williams Date: 2004-09-16T00:00:48+09:00 Subject: Re: Ruby equiv of Perl's HTML::Template module? The second URL here offers up an ruby equivalent of HTML::Template. I've used the standard html-template in Ruby, which is philosophically identical to Perl's HTML::Template, but uses different syntax for the tags (that's the first URL below). Using it is still familiar if you are a fan of HTML::Template. The newer html-template2 claims to be compatible with HTML::Template, though I haven't used it myself. http://raa.ruby-lang.org/project/html-template/ http://raa.ruby-lang.org/project/html-template2/ On Wed, 15 Sep 2004, Chris wrote: > Gavin Sinclair wrote: > >>Hopefully someone here fairly familiar with Perl can point me to a Ruby > >>HTML templating system that works like Perl's HTML::Template. The next > >>closest perferred equivalent would be Perl Template Toolkit. But I > >>really like HTML::Template a lot. > >> > >>I'm relatively new to Ruby (very slight dabbling since v1.6 circa 2001), > >> so my opinions may not hold water, but I don't really consider eRuby a > >>templating system. Maybe someone can help me see how it's not anything > >>more than PHP or ASP except Ruby is used instead of PHP or VBScript...? > >> > >>Anyway, my main interest is in finding something like Perl's > >>HTML::Template. Hopefully it exists somewhere in the Ruby world. > > > > > > I don't think there's a direct port, but there are some Ruby HTML > > templating libraries around (RDoc, cs/template, Amrita, ...). Can you > > describe the benefits of the Perl solution? > > I'm not sure I am able to accurately articulate what I perceive the > benefits to be. The main "advantage" that I feel -- it's kind of a > "gut" thing -- is that the templates are, in a logical way, truly only > markup. There is no "code" per se, loosely speaking. Strictly > speaking, I realize there are the loop and conditional tags, but still > it "feels" like only HTML markup. I really like that because the > separation between logic and presentation is about as good as it gets. > > All my opinion of course but those that use HTML::Template in the Perl > world, I think would agree. I'm definitely going to check out some of > the suggestions. I've held this infatuation with Ruby for a long time, > and even adopted some "Ruby ways" in my Perl coding for a few years now. > I've decided the only real way to bridge the gap is to force myself to > stop using Perl (which I still really like) and just use Ruby full out. > So I'm trying to find things that ease the transition, like > HTML::Template. I can't afford a lot of downtime, which has been the > biggest strike against using Ruby -- I'm pretty fast, tight and accurate > in hitting targets using Perl (if I may be so bold). But there are > several "Wow!" factors in Ruby that keep me hanging around... wishing... :-) > > -ceo > -- Kurt Williams Senior Engineer http://www.nationalgeographic.com kurt@nationalgeographic.com