Nokogiri pure Java status

299 views
Skip to first unread message

Nick Sieger

unread,
Nov 30, 2009, 6:02:48 PM11/30/09
to nokogi...@googlegroups.com
Just wondering what the status is of the pure Java code that Sergio is
working on. I realize I could probably dig up this information but
perhaps it would be better to recap the info in this thread for the
benefit of those coming looking to help. Where is the code, and what
is remaining to be implemented?

Thanks,
/Nick

Aaron Patterson

unread,
Nov 30, 2009, 6:24:16 PM11/30/09
to nokogi...@googlegroups.com
Sergio has a branch on my nokogiri github repo called "java":

http://github.com/tenderlove/nokogiri/tree/java

If you check out that branch, you'll find the java codes.
Unfortunately, that branch is very far behind the master branch.

Getting the specs and other miscellaneous files caught up with master
is on my plate, but I haven't been able to get to it yet.

Information on building the pure java version can be found here:

http://www.serabe.com/2009/08/26/final-status-update/

But I haven't tried it (yet).

--
Aaron Patterson
http://tenderlovemaking.com/

Aaron Patterson

unread,
Nov 30, 2009, 6:27:08 PM11/30/09
to nokogi...@googlegroups.com
Also, I've added you and enebo to the collaborator list.

Sergio Arbeo

unread,
Dec 1, 2009, 12:29:57 AM12/1/09
to nokogi...@googlegroups.com
2009/12/1 Nick Sieger <nicks...@gmail.com>:
As Aaron said, there is a branch called 'java' on his repo.
Furthermore, I wrote a post [1] yesterday about it, and I hope to have
some time today to write another one with some info about nokogiri
internals.

As Aaron said too, nokogiri for java is way behind the master, but the
memory leak should be solved before continue impl.

Cheers,

Sergio

[1] http://www.serabe.com/2009/12/01/do-you-wanna-help-us-with-pure-java-nokogiri/

--
http://sergio.arbeo.net
http://www.serabe.com

Aaron Patterson

unread,
Dec 1, 2009, 1:11:12 PM12/1/09
to nokogi...@googlegroups.com
On Mon, Nov 30, 2009 at 3:02 PM, Nick Sieger <nicks...@gmail.com> wrote:
I've merged master back in to the java branch. If you update, then
run these commands:

$ jruby -I lib -S rake java:spec
$ jruby -I lib -S rake test

That will run the tests. All that remains is getting the E's and F's
to turn in to dots.

Mike Dalessio

unread,
Dec 1, 2009, 1:39:08 PM12/1/09
to nokogiri-talk
Thanks, Aaron. You the man.

--

You received this message because you are subscribed to the Google Groups "nokogiri-talk" group.
To post to this group, send email to nokogi...@googlegroups.com.
To unsubscribe from this group, send email to nokogiri-tal...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nokogiri-talk?hl=en.





--
mike dalessio
mi...@csa.net

Will Sargent

unread,
Dec 2, 2009, 1:21:13 AM12/2/09
to nokogi...@googlegroups.com
Excellent. Up and running.

..............................E........................F.......................E.FE....FFFEFEEEEEEEEEEEEEE............................E..E.EEEEEEE...EEEEEEEEEEEEEEEEEEEEEEEEEE..EE....EE.EEEFEFEE.E.EE.F........FFF.E.EFEEE.EEEEEEEEEEEEEFEEEEEE.FEEEEEFFFEEFEEEEEEEEEEE....EEEEEEEEEEEEEEEEEEEEEEEEEE.......FFFFFFFFFFFF..EE........EEEF...F........E.................E..............E.E....EEEE.E...EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE..E............................E....E...F..E....E......EEEE..E...EEEE.E.....................EEEEEEEEEEEEEEEE.EEEE.E...............E..................................E...FFE.....EE.E........................EFEF..................EF..XmlText.java:18:in
`rbNew': java.lang.ClassCastException: nokogiri.XmlElement cannot be
cast to nokogiri.XmlDocument
from nokogiri/XmlText$s_method_2_0$RUBYINVOKER$rbNew.gen:-1:in `call'

Will.

MarcPeabody

unread,
Dec 4, 2009, 11:55:29 AM12/4/09
to nokogiri-talk
Hi guys.

It appears the ClassCastException listed in Will's post (I get it too)
is a result of the a master merge commit:
* ext/nokogiri/xml_text.c (new) fixing segv when called with non-
document
http://github.com/tenderlove/nokogiri/commit/07351373762a6d9f67734c5cc8c3e89e84988ccd

The corresponding fix on the Java side would go in ext/java/nokogiri/
XmlTest.java like so:
public static IRubyObject rbNew(ThreadContext context, IRubyObject
cls, IRubyObject text, IRubyObject xNode) {
XmlNode xmlNode = (XmlNode)xNode;
XmlDocument xmlDoc = (XmlDocument)xmlNode.document(context);
Document document = xmlDoc.getDocument();
Node node = document.createTextNode(text.convertToString
().asJavaString());
return XmlNode.constructNode(context.getRuntime(), node);
}

What's the preferred way for me to submit this fix? Should I fork and
submit a pull request or could I be added as a collaborator?
-marc

On Dec 2, 1:21 am, Will Sargent <will.sarg...@gmail.com> wrote:
> On Tue, Dec 1, 2009 at 10:11 AM, Aaron Patterson
>
>
>
>
>
> <aaron.patter...@gmail.com> wrote:
> > On Mon, Nov 30, 2009 at 3:02 PM, Nick Sieger <nicksie...@gmail.com> wrote:
> >> Just wondering what the status is of the pureJavacode that Sergio is
> >> working on. I realize I could probably dig up this information but
> >> perhaps it would be better to recap the info in this thread for the
> >> benefit of those coming looking to help. Where is the code, and what
> >> is remaining to be implemented?
>
> > I've merged master back in to thejavabranch.  If you update, then
> > run these commands:
>
> >  $ jruby -I lib -S rakejava:spec
> >  $ jruby -I lib -S rake test
>
> > That will run the tests.  All that remains is getting the E's and F's
> > to turn in to dots.
>
> Excellent.  Up and running.
>
> ..............................E........................F................... ....E.FE....FFFEFEEEEEEEEEEEEEE............................E..E.EEEEEEE...E EEEEEEEEEEEEEEEEEEEEEEEEE..EE....EE.EEEFEFEE.E.EE.F........FFF.E.EFEEE.EEEE EEEEEEEEEFEEEEEE.FEEEEEFFFEEFEEEEEEEEEEE....EEEEEEEEEEEEEEEEEEEEEEEEEE..... ..FFFFFFFFFFFF..EE........EEEF...F........E.................E.............. E.E....EEEE.E...EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE..E................ ............E....E...F..E....E......EEEE..E...EEEE.E.....................EE EEEEEEEEEEEEEE.EEEE.E...............E..................................E... FFE.....EE.E........................EFEF..................EF..XmlText.java: 18:in

Aaron Patterson

unread,
Dec 4, 2009, 1:20:27 PM12/4/09
to nokogi...@googlegroups.com
On Fri, Dec 4, 2009 at 8:55 AM, MarcPeabody <marcp...@yahoo.com> wrote:
> Hi guys.
>
> It appears the ClassCastException listed in Will's post (I get it too)
> is a result of the a master merge commit:
> * ext/nokogiri/xml_text.c (new) fixing segv when called with non-
> document
> http://github.com/tenderlove/nokogiri/commit/07351373762a6d9f67734c5cc8c3e89e84988ccd
>
> The corresponding fix on the Java side would go in ext/java/nokogiri/
> XmlTest.java like so:
>    public static IRubyObject rbNew(ThreadContext context, IRubyObject
> cls, IRubyObject text, IRubyObject xNode) {
>        XmlNode xmlNode = (XmlNode)xNode;
>        XmlDocument xmlDoc = (XmlDocument)xmlNode.document(context);
>        Document document = xmlDoc.getDocument();
>        Node node = document.createTextNode(text.convertToString
> ().asJavaString());
>        return XmlNode.constructNode(context.getRuntime(), node);
>    }

Excellent.

> What's the preferred way for me to submit this fix? Should I fork and
> submit a pull request or could I be added as a collaborator?

Please fork and send a pull request. Will is taking care of the java
branch, so he'll deal with your changes.

Again, thank you very much! :-D

MarcPeabody

unread,
Dec 4, 2009, 3:07:26 PM12/4/09
to nokogiri-talk
Pull request sent. This is the first time I've done this through a non-
master branch, Will, so feel free to smack me with a newspaper and
tell me what I did wrong if you have any difficulties pulling in my
commit.

Now to find some low-hanging E/F fruit...
-marc

On Dec 4, 1:20 pm, Aaron Patterson <aaron.patter...@gmail.com> wrote:
> On Fri, Dec 4, 2009 at 8:55 AM, MarcPeabody <marcpeab...@yahoo.com> wrote:
> > Hi guys.
>
> > It appears the ClassCastException listed in Will's post (I get it too)
> > is a result of the a master merge commit:
> > * ext/nokogiri/xml_text.c (new) fixing segv when called with non-
> > document
> >http://github.com/tenderlove/nokogiri/commit/07351373762a6d9f67734c5c...

Will Sargent

unread,
Dec 5, 2009, 2:58:52 PM12/5/09
to nokogi...@googlegroups.com
On Fri, Dec 4, 2009 at 12:07 PM, MarcPeabody <marcp...@yahoo.com> wrote:
Pull request sent. This is the first time I've done this through a non-
master branch, Will, so feel free to smack me with a newspaper and
tell me what I did wrong if you have any difficulties pulling in my
commit.

Now to find some low-hanging E/F fruit...
-marc


All done.   Thanks for the commit.

Will.
Reply all
Reply to author
Forward
0 new messages