I've just noticed that a lot of hpricot code is written in java...
alt 开发者_开发问答text http://img697.imageshack.us/img697/7447/picture2yw.png
I heard that JRuby performed a lot better than native ruby when processing regular expression. Is maybe the java classes just activated if JRuby or Java is installed and the ruby used if these are not found?
It's something puzzling indeed.
Thanks
Ruby gems can be written in pure Ruby, or have native extensions. In that case, they may have a C extension and/or a java extension. When installing on Ruby MRI and Rubinius, the C extension (and only the C extension) will be used. When installing on JRuby, the Java extension (and only that one) will be used.
hpricot has both, to be compatible with all of these major Ruby implementations.
精彩评论