Recently, I was looking for a Ruby guide that could help my son catch
on to Ruby. I have seen several mentions an Why’s (Poignant) Guide to
Ruby, so I decided to read through it to see if it was something my
son could use. By the time I was about 1/4 through it, I became very
concerned about the writer. Is this guy ok? Bizzar just scratches the
surface. The Van Gogh of Ruby programmers would be a fair assessment.
This book reads like a twisted novel, where you almost by accident,
learn a bit of Ruby. Nevertheless, a very engaging read. The code
examples are very clear and understandable, and the style keeps you
turning pages to see what madness awaits.
fellow. According to his blog, http://whytheluckystiff.net/, he’s a
professor collaborating on a similar book for Flash.
The website says he is a “freelance professor”. Is that like a self
proclaimed thing. The website is just like the book. Nothing you get
is anything you expect. If Dr. Who. knew Ruby, I think his name would
be Professor Why.
I don’t know about all his work, but hpricot is fantastic and popular.
The specific deal with Hpricot is nobody wants to parse and write HTML
that
could be ill-formed. XHTML is simple to parse, and browsers can’t accept
strict XHTML. So HTML lived in a dead-spot. If you had to edit it, you’d
target specific strings with gsub. And if this lead to an encoding
problem,
you’d simply have garbage-in-garbage-out.
With Hpricot, you can freely convert ill-formed HTML into an object
model,
and back into HTML
We used Hpricot to launch a successful project at work, with its Lilu
wrapper. This let our graphic artists upgrade our graphics, decoupled
from
our developer’s source code. Lilu uses Hpricot to locate class tags and
replace their contents with our data. This, in turn, decouples our
graphics
teams and development teams, leading to a very successful website.
And Hpricot allows assertions in tests that read HTML, via
assert_hpricot.