Wild and Crazy Metaprogramming with Camping
by Geoffrey Grosenbach
I try to expand my knowledge of Ruby by reading code from other developers I admire. In the past few weeks, that has meant reading the meager source of Camping, Why the Lucky Stiff’s tiny website framework.
It also helped to learn by writing a test framework for Camping. It works pretty well so far and has taught me a lot about Ruby, testing, and Camping. I hope to package it as a gem in the next few weeks.
|In Perl, you've got the DATA filehandle, that you can (ab)use to read in the contents of the source file that's currently executing. You can probably do the same thing with it...|
Continuing the Camping discussion, I'm wondering why method_missing is used again and again in related modules (like Markaby) to implement the HTML etc. entities repeatedly.
the DATA filehandle is available in ruby too, just stick __END__ in your file, but I don't think Geoffrey was thinking of that..