REXML problem

H

haldane

I am trying to read from a zlib GzipReader with REXML (actually with
SOAP, it's using REXML).

But it fails with "Unknown source type!"

Can this be fixed in document.rb?

The code looks like this:

if source.kind_of? Source
# do nothing
elsif source.kind_of? IO
source = IOSource.new(source)
elsif source.kind_of? String
source = Source.new source
else
raise "Unknown source type!"
end

The trouble is that GzipReader is not a subclass of IO. However, it
behaves enough like an IO object to be used as one. A case for duck
typing?

Stephen Sykes
 
S

Sean Russell

I am trying to read from a zlib GzipReader with REXML (actually with
SOAP, it's using REXML). ....
The trouble is that GzipReader is not a subclass of IO. However, it
behaves enough like an IO object to be used as one. A case for duck
typing?

How do you define "behaves enough?"

If you send an email to me about this, or (better yet) post a feature
request to the REXML bug tracker, I'll look into it. I'll try to
remember to take a look at it anyway, but the chances of it getting
lost is much higher if you don't contact me directly.

The REXML bug tracking page is at:

http://www.germane-software.com/cgi-bin/roundup/rexml

--- SER
 
H

haldane

Hi,

Thanks for your prompt reply!
How do you define "behaves enough?"

Well, what do you need? GzipReader responds to read, getc, readchar,
rewind, each_byte, ungetc, gets, readline, each, each_line, readlines
and some more besides.
If you send an email to me about this, or (better yet) post a feature
request to the REXML bug tracker, I'll look into it. I'll try to
remember to take a look at it anyway, but the chances of it getting
lost is much higher if you don't contact me directly.

The REXML bug tracking page is at:
http://www.germane-software.com/cgi-bin/roundup/rexml

Will do. I can't get a response from this page just now, but I will
try again later.

Regards,
Stephen Sykes
- S.D.Sykes - http://www.stephensykes.com -
 
S

Sean Russell

Well, what do you need? GzipReader responds to read, getc, readchar,
rewind, each_byte, ungetc, gets, readline, each, each_line, readlines
and some more besides.

That should do it. I mostly use readline and some diagnostics about
which byte in the stream I'm currently at. I'll look into; I've got
several things to work on at the moment, so this may take a little
while for me to get to.
Will do. I can't get a response from this page just now, but I will
try again later.

Yeah. We lost another hard drive. Actually, the server physically
moved across town, so we're hoping it is just a bad wire. Ironically,
the drives are RAIDed, so we didn't lose any data; however, when we
set up the RAID, for some reason we didn't RAID the swap space ... so
when the drive went down, it took the kernel with it, which is why you
couldn't access the machine. It should only have been down for a
couple of hours, though, and we've fixed the RAID issue, so we should
be golden.

--- SER
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top