Forum: Ruby libxml-ruby is too crazy

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Sebastian W. (Guest)
on 2008-12-08 21:37
Okay, if any libxml-ruby developers read this list, I sincerely hope you
will read this and hear my plea. Stop the madness! I just installed the
latest version of libxml-ruby (0.9.6) and suddenly my old scripts are
breaking when I call the "save" method.

Worst of all, this is a Type Error that seems to be occuring in the C
layer -- Ruby blows up because apparently save is expecting a Hash?!?
Whaaaaaaaa? The API docs say it's expecting a boolean, last time I
checked "true" is a boolean value.

Stop the hate, child!
Sebastian W. (Guest)
on 2008-12-08 22:11
Mind you, I fixed the problem by rolling back to version 0.9.4. : )

Sebastian W. wrote:
> Okay, if any libxml-ruby developers read this list, I sincerely hope you
> will read this and hear my plea. Stop the madness! I just installed the
> latest version of libxml-ruby (0.9.6) and suddenly my old scripts are
> breaking when I call the "save" method.
>
> Worst of all, this is a Type Error that seems to be occuring in the C
> layer -- Ruby blows up because apparently save is expecting a Hash?!?
> Whaaaaaaaa? The API docs say it's expecting a boolean, last time I
> checked "true" is a boolean value.
>
> Stop the hate, child!
Luis L. (Guest)
on 2008-12-08 22:12
(Received via mailing list)
On Dec 8, 2:31 pm, "Sebastian W." <removed_email_address@domain.invalid> wrote:
> Stop the hate, child!
Sorry to interrupt your ranting, but can you please provide a sample
of the problem?

Like, a short script that exposes the problem before and after the
update?

You can easily use a old version of the gem simply by indicating it to
"gem" command:

require 'rubygems'
gem 'libxml', 'version goes here'
require '...'

Don't rant without providing information for others to agree or
disagree with you.

At least do that, and we will make this a better world.
Mark T. (Guest)
on 2008-12-08 22:15
(Received via mailing list)
On Dec 8, 2:31 pm, "Sebastian W." <removed_email_address@domain.invalid> wrote:
> Okay, if any libxml-ruby developers read this list, I sincerely hope you
> will read this and hear my plea. Stop the madness!

0.9.6 was released today, and the announcement on the libxml-ruby
mailing list requested testing because it was heavily refactored,
preparing for a 1.0 release. So I suggest filing a bug on rubyforge.

-- Mark.
Jens W. (Guest)
on 2008-12-08 22:25
(Received via mailing list)
Mark T. [2008-12-08 21:08]:
> On Dec 8, 2:31 pm, "Sebastian W." <removed_email_address@domain.invalid> wrote:
>> Okay, if any libxml-ruby developers read this list, I sincerely
>> hope you will read this and hear my plea. Stop the madness!
>
> 0.9.6 was released today, and the announcement on the libxml-ruby
> mailing list requested testing because it was heavily
> refactored, preparing for a 1.0 release. So I suggest filing a
> bug on rubyforge.
not sure if that's the issue, but there's been a major change wrt
XML::Document#save in 0.9.6. from the changelog:

"This is an API change and may break existing calls to
XML::Document#save."

<http://libxml.rubyforge.org/svn/trunk/CHANGES>

also, there is a mailing list dedicated to this project:

<http://rubyforge.org/mail/?group_id=494>

cheers
jens
Phlip (Guest)
on 2008-12-09 17:30
(Received via mailing list)
Mark T. wrote:

> 0.9.6 was released today

Does it work with ruby-1.9.1?

I get a cascade of errors, starting with

   #warning use "ruby/io.h" instead of "rubyio.h"

so it doesn't look like a reportable bug so much as a known feature...
Sebastian W. (Guest)
on 2008-12-13 09:41
Okay, I will admit that I was trolling a bit when I wrote that original
post. I apologize -- it was the end of a frustrating day. Sorry for
injecting negativity on the forums.

That having been said, my source of frustration was that yes, okay -
there is a new version of the gem out. I ran my scripts, things broke
and I started looking through my code to find the problem. The error
message I got when calling "save" was that I was passing a boolean where
a hash was expected.

So, sure enough, I dig through my trusty RDocs to find the documentation
for the newest version of the gem. Here is where things went wrong for
me and I posted in the forums -- the API doc for save, at least when I
looked, had not been updated to reflect the new signature for the "save"
method. So...at least in my view of programming, if you do something as
significant as changing the signature of a method as VITAL as "save",
you had better update that in the API doc.

It's good that there's a libxml-ruby forum - and I did check it for
threads but nothing jumped out - but I don't find it reasonable to
expect folks to have to go to the forum for updates on such a
significant refactoring. If you change something as important as "save",
that MUST be updated in the RDoc. No ifs, ands, or buts about it.

Should I go dig through the source code if I think the RDoc is wrong?
Well...on the one hand, I'm sort of forced to do that, but I don't think
that should be required. Just because we're using open source software
doesn't mean that people should get sloppy. If you bothered to write the
doc once, you've created an expectation that it's going to stay updated.

Did this turn into another rant? I suppose, but I just wanted to get it
out there.

Again -- I just want to emphasize that libxml-ruby has been a great tool
in my toolbelt for the past few months. It's blazingly fast, gets stuff
done fast, and I've generally found it to be pretty easy to work with
(as easy as XML lends itself to be, but we'll let that go by). So...I
guess the frustration also came from me being used to the library being
so great. When something that has been tried and true suddenly blows up,
I get a little miffed. Whether or not that's justified is something we
can debate, I guess. : )
This topic is locked and can not be replied to.