[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

IO.expect: where can I find documentation??

Dan Caugherty

11/28/2007 3:28:00 AM

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.
7 Answers

Lloyd Linklater

11/28/2007 7:21:00 AM

0

Dan Caugherty wrote:
> 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... should have most
all the documentation there is.
--
Posted via http://www.ruby-....

???

11/28/2007 7:29:00 AM

0


å?»å®?æ?¹ç½?ç«?ç??ç??
--------------------------------------------------
From: "Lloyd Linklater" <lloyd@2live4.com>
Sent: Wednesday, November 28, 2007 3:20 PM
Newsgroups: comp.lang.ruby
To: "ruby-talk ML" <ruby-talk@ruby-lang.org>
Subject: Re: IO.expect: where can I find documentation??

> Dan Caugherty wrote:
>> 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... should have most
> all the documentation there is.
> --
> Posted via http://www.ruby-....
>
>

John Joyce

11/28/2007 12:14:00 PM

0


On Nov 27, 2007, at 9:30 PM, Dan Caugherty wrote:

> 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?


MonkeeSage

11/28/2007 12:38:00 PM

0

On Nov 28, 6:14 am, John Joyce <dangerwillrobinsondan...@gmail.com>
wrote:
> On Nov 27, 2007, at 9:30 PM, Dan Caugherty wrote:
>
> > 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?

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/...
http://svn.ruby-lang.org/repos/ruby/trunk/ext/....expect

Regards,
Jordan

Dan Caugherty

11/29/2007 2:53:00 AM

0

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

Bernard Kenik

11/30/2007 2:46:00 AM

0

On Nov 28, 9:53 pm, Dan Caugherty <dan.caughe...@gmail.com> wrote:
> 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+/ ?

Eric Hodel

12/1/2007 4:39:00 AM

0

On Nov 28, 2007, at 18:55 PM, Dan Caugherty wrote:
> 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.