hoodwink.d enhanced


Ola's Clever Hpricot Hack #

by why in inspect

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.

said on 06 Feb 2007 at 17:59

That is crazy awesome.

said on 07 Feb 2007 at 16:17

Agreed. Now, if we could only get a crossplatform RubyCLR and Ragel to generate in C#...

said on 07 Feb 2007 at 18:44

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.

said on 07 Feb 2007 at 19:02

(with help from Ola, naturally)

said on 07 Feb 2007 at 19:03

One question is—long-term, do we want ‘java’ or ‘jruby’ for the JRuby platform name?

said on 09 Feb 2007 at 07:01

java i’d say, you never know when another impl might pop up.

said on 14 Feb 2007 at 17:36

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.

11 Jul 2010 at 20:42

* do fancy stuff in your comment.