Aaron Patterson wrote: >> Can it lex JavaScript? > > I'm glad you asked! Of course it can! For parsing JavaScript, I > present to you two solutions. One is pure ruby and kind of slow, and > the other one is C and super fast! Yay! Google assert_javascript. It's a great library - we use it all the time at work, but it's hard to get started with, because of the bugs in its root library. It can't parse 'Ajax.Request', but it can parse 'var ajax = Ajax.Request', so it's incompatible with generated code. It's a re-imagining of assert_rjs, but without the noise from regular expressions. I will shortly be rewriting assert_javascript using one of these parsers instead... -- Phlip