abhishekkr/rubygem_xml_motor — comment on commit 087aa06fc56ba3d269d6bb7ae06c55764abf107e
File:  line 0
By jacaetevha:

You should also try to standardize your code on some traditional Ruby-isms.

1. don't prepend method names with "get_" unless absolutely necessary
2. don't prepend or append underscores to generally available public
methods (reserve the underscore at the beginning and end of a method
name to indicate to the user that they may not really want to use the
method)
3. In the blog post you mentioned below, use
File.read("myXMLfile.xml") instead of File.open and then calling the
instance-based "read" method. The way you've done it leaves the file
handle open (because you haven't called the instance-based "close"
method).

Another note: generally, while using XML parsers the client needs to
be able to get at the nodes and attributes also, not just the text
within a node.

And finally a question... Why build another parser? We have so many in
the Ruby community. What problem/scenario are you trying to solve that
is not solved by the other parsers?

--
Jason Rogers

On Tue, Jan 3, 2012 at 11:51, Abhishek Kumar

wrote:
> first of all thanks for taking out your time for trying it and comments
> I posted it in such locations for some 3party review, so this type of comment is exactly what it was meant for.
> Other ways didn't got such feedbacks... so it was worth.
>
> The gem is half baked (not the algo), and I'm building upon it.
> The 1st point is new to me, thanks for that. I was aware of 2nd and am in process of fixing it.
>
> The performance bit wouldn't be much problem if you implement it
> http://justfewtuts.blogspot.com/2011/11/xml-motor-v003-mine-xml-once-multiple.html
>
>> str = %Q{i=1,j=2\ni=1,j=3}
>> xNodes = XMLMotorEngine._splitter_ str
>> xTags = XMLMotorEngine._indexify_ xNodes
>> result1 = XMLMotorEngine.pre_processed_content(xNodes, xTags, "h1")
>> result2 = XMLMotorEngine.pre_processed_content(xNodes, xTags, "div", "class='wanted'")
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/abhishekkr/rubygem_xml_motor/commit/087aa06fc56ba3d269d6bb7ae06c55764abf107e#commitcomment-834057