Forum: Ruby-core Please implement expect.rb for Windows Ruby

Posted by unknown (Guest)
on 2006-07-12 22:46
(Received via mailing list)
Bugs item #5036, was opened at 2006-07-12 14:44
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=169...

Category: Standard Library
Group: 1.8.4
Status: Open
Resolution: None
Priority: 3
Submitted By: Doug Holland (meldroc)
Assigned to: Nobody (None)
Summary: Please implement expect.rb for Windows Ruby

Initial Comment:
I've written a series of scripts on my Linux box at work that make 
extensive use of expect.rb in the standard Unix/Linux-based Ruby 
distribution.  When I tried moving these scripts over to a Windows 
machine, I found that Windows Ruby doesn't have expect.rb at all.

Adapting my scripts to not use expect.rb would be an exceptional pain. 
Please implement expect.rb for Windows Ruby.

----------------------------------------------------------------------

You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=169...
Posted by Yukihiro Matsumoto (Guest)
on 2006-07-20 05:50
(Received via mailing list)
Hi,

In message "Re: [ ruby-Bugs-5036 ] Please implement expect.rb for 
Windows Ruby"
    on Thu, 13 Jul 2006 05:44:51 +0900, <noreply@rubyforge.org> writes:

|Adapting my scripts to not use expect.rb would be an exceptional pain.  Please implement expect.rb for Windows Ruby.

I feel sympathy for your pain.  But expect.rb highly depends on pty
which is not available on Windows.  It is nearly impossible for us to
implement it without pty.  We need to wait until some Windows expert
would write expect.rb counterpart using Win32 features.  Sorry.

							matz.
Posted by M. Edward (Ed) Borasky (Guest)
on 2006-07-20 06:14
(Received via mailing list)
Yukihiro Matsumoto wrote:
> would write expect.rb counterpart using Win32 features.  Sorry.
>
> 							matz.
>   
How does "regular" expect, which is based on Tcl, work on a Windows
system? I think I've seen it.
Posted by Yukihiro Matsumoto (Guest)
on 2006-07-20 07:08
(Received via mailing list)
Hi,

In message "Re: [ ruby-Bugs-5036 ] Please implement expect.rb for 
Windows Ruby"
    on Thu, 20 Jul 2006 13:12:22 +0900, "M. Edward (Ed) Borasky" 
<znmeb@cesmail.net> writes:

|> I feel sympathy for your pain.  But expect.rb highly depends on pty
|> which is not available on Windows.  It is nearly impossible for us to
|> implement it without pty.  We need to wait until some Windows expert
|> would write expect.rb counterpart using Win32 features.  Sorry.

|How does "regular" expect, which is based on Tcl, work on a Windows 
|system? I think I've seen it.

I don't know.  It could be a great hint to implement expect like new
library that works on Windows.  We hope we see volunteers.

							matz.
Posted by Sam Roberts (Guest)
on 2006-07-20 07:14
(Received via mailing list)
Quoting matz@ruby-lang.org, on Thu, Jul 20, 2006 at 02:05:26PM +0900:
> |> I feel sympathy for your pain.  But expect.rb highly depends on pty
> |> which is not available on Windows.  It is nearly impossible for us to
> |> implement it without pty.  We need to wait until some Windows expert
> |> would write expect.rb counterpart using Win32 features.  Sorry.
> 
> |How does "regular" expect, which is based on Tcl, work on a Windows 
> |system? I think I've seen it.
> 
> I don't know.  It could be a great hint to implement expect like new
> library that works on Windows.  We hope we see volunteers.

Some info here:

  http://bmrc.berkeley.edu/people/chaffee/expectnt.html

Short answer - lots of windows specific tricks, including setting
debugger-like intercepts in system DLLs!

Sam
Posted by U.Nakamura (Guest)
on 2006-07-20 07:36
(Received via mailing list)
Hello,

In message "Re: [ ruby-Bugs-5036 ] Please implement expect.rb for 
Windows Ruby"
    on Jul.20,2006 14:13:45, <sroberts@uniserve.com> wrote:
| Some info here:
| 
|   http://bmrc.berkeley.edu/people/chaffee/expectnt.html
| 
| Short answer - lots of windows specific tricks, including setting
| debugger-like intercepts in system DLLs!

Hmm, this is great work. I respect the developpers of Expect
for Windows NT.

But, this technique is too forcible.
It seems that we should not use such technique, just like we
should not support fork by using cygwin's way.

BTW, ckw -- native Win32 cmd.exe compatible terminal -- passes
user inputs to background cmd.exe, and returns the cmd.exe's
response to ckw's own window.
I think we should check ckw's way.
Fortunately, our Nobu seems to know this software well.

: ckw (Japanese page)
  http://www.geocities.jp/cygwin_ck/


Regards,
Posted by M. Edward (Ed) Borasky (Guest)
on 2006-07-20 16:00
(Received via mailing list)
Yukihiro Matsumoto wrote:
> |How does "regular" expect, which is based on Tcl, work on a Windows 
> |system? I think I've seen it.
>
> I don't know.  It could be a great hint to implement expect like new
> library that works on Windows.  We hope we see volunteers.
>
> 							matz.
>   
Another question ... for the original poster. What specifically in
"expect.rb" do you need that couldn't be done by, say, Net::Telnet? I do
a fair amount of Telnet scripting and I generally use "autoexpect" to
capture the scripts, then translate them to (Perl) Net::Telnet calls
with a Perl script. I haven't had a chance to experiment with the Ruby
equivalent, but I don't see why it wouldn't work, and the translator
would be a lot more elegant in Ruby.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.