IO.expect: where can I find documentation??

D

Dan Caugherty

Hey all --

Can anyone point me to the documentation (or the source!) that defines
the IO.expect method (parameters, return values, etc.)?
I can't seem to find it anywhere.

Also, I'm interested in extending this routine to use Floats (not just
Fixnums) as timeout values (for a granularity of, say, 50
milliseconds).

Thanks,
-- Dan C.
 
L

Lloyd Linklater

Dan said:
Hey all --

Can anyone point me to the documentation (or the source!) that defines
the IO.expect method (parameters, return values, etc.)?
I can't seem to find it anywhere.

I do not know about that. Could you mean REXML.expected? That is the
closest thing I can think. http://ruby-doc.org/core/ should have most
all the documentation there is.
 
J

John Joyce

Hey all --

Can anyone point me to the documentation (or the source!) that defines
the IO.expect method (parameters, return values, etc.)?
I can't seem to find it anywhere.

Also, I'm interested in extending this routine to use Floats (not just
Fixnums) as timeout values (for a granularity of, say, 50
milliseconds).

Thanks,
-- Dan C.

Dan,
Where are you finding IO.expect ??
My Ruby (1.8) doesn't seem to have it. ri tells me nothing.
Creating an IO object:
i = IO.new 2
( the handle for stderr )
Then doing:
i.methods.sort
Returns no method expect. Are you using some library that extends the
IO class?
 
M

MonkeeSage

Dan,
Where are you finding IO.expect ??
My Ruby (1.8) doesn't seem to have it. ri tells me nothing.
Creating an IO object:
i = IO.new 2
( the handle for stderr )
Then doing:
i.methods.sort
Returns no method expect. Are you using some library that extends the
IO class?

It's expect.rb from the standard library pty extension. The docs are
in the source:

http://svn.ruby-lang.org/repos/ruby/trunk/ext/pty/README
http://svn.ruby-lang.org/repos/ruby/trunk/ext/pty/README.expect

Regards,
Jordan
 
D

Dan Caugherty

Thanks, Jordan!

So it looks like the timeout value is really only passed to
IO#select. Would this imply then that Floats as well as Fixnums could
be used?

I personally don't see why not, but the docs clearly say only a Fixnum
can be used as a timeout value. [ shrug ]

What do y'all think?

Rgds,
-- Dan
 
B

bbiker

Thanks, Jordan!

So it looks like the timeout value is really only passed to
IO#select. Would this imply then that Floats as well as Fixnums could
be used?

I personally don't see why not, but the docs clearly say only a Fixnum
can be used as a timeout value. [ shrug ]

What do y'all think?

Rgds,
-- Dan

Have a floatnum regex for 'pattern' /\d+.\d+/ ?
 
E

Eric Hodel

So it looks like the timeout value is really only passed to
IO#select. Would this imply then that Floats as well as Fixnums could
be used?

I personally don't see why not, but the docs clearly say only a Fixnum
can be used as a timeout value. [ shrug ]

What do y'all think?

You can pass a Float to #select.
 

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

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top