Ola's Clever Hpricot Hack #
If you’re running JRuby from trunk, try this:
$ gem install hpricot --source http://code.whytheluckystiff.net Select which gem to install for your platform (java) 1. hpricot 0.5.110 (jruby) 2. hpricot 0.5.110 (mswin32) 3. hpricot 0.5.110 (ruby) > 1 Successfully installed hpricot-0.5.110-jruby Installing ri documentation for hpricot-0.5.110-jruby... Installing RDoc documentation for hpricot-0.5.110-jruby...
But how is this possible given that Hpricot’s parser is written in C?? Because Ragel can generate Java code! Ola goes into it.
spicycode
That is crazy awesome.
FlashHater
Agreed. Now, if we could only get a crossplatform RubyCLR and Ragel to generate in C#...
MenTaLguY
I’m just getting in on the ground floor of this JRuby-extension thing myself—I got jruby gems building for ‘concurrent’ (the library from “Five Ways”) this afternoon.
MenTaLguY
(with help from Ola, naturally)
MenTaLguY
One question is—long-term, do we want ‘java’ or ‘jruby’ for the JRuby platform name?
!!!!
java i’d say, you never know when another impl might pop up.
why
Okay, so, the reason I’m using “jruby” is because the extension relies on libraries under org.jruby.*. See hpricot_scan.java.rl for the truth.