From 818d6a1e4f145f3ff9a60933f71336a034c59536 Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 6 Nov 2003 07:22:39 +0000 Subject: * eval.c (rb_load): allow interrupt during loaded program evaluation. [ruby-dev:21834] * hash.c (rb_hash_fetch): always warn if default argument and a block are supplied at the same time. [ruby-dev:21842] * hash.c (env_fetch): ditto. * array.c (rb_ary_fetch): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/pty/expect_sample.rb | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'ext/pty') diff --git a/ext/pty/expect_sample.rb b/ext/pty/expect_sample.rb index 1311476c5d..bf8a2352fe 100644 --- a/ext/pty/expect_sample.rb +++ b/ext/pty/expect_sample.rb @@ -4,17 +4,16 @@ # by A. Ito # # This program reports the latest version of ruby interpreter -# by connecting to ftp server at netlab.co.jp. +# by connecting to ftp server at ruby-lang.org. # require 'pty' require 'expect' fnames = [] -PTY.spawn("ftp ftp.netlab.co.jp") do - |r_f,w_f,pid| +PTY.spawn("ftp ftp.ruby-lang.org") do |r_f,w_f,pid| w_f.sync = true - $expect_verbose = true + $expect_verbose = false r_f.expect(/^Name.*: /) do w_f.print "ftp\n" @@ -31,14 +30,14 @@ PTY.spawn("ftp ftp.netlab.co.jp") do r_f.expect('word:') do w_f.print username+"@\n" end - r_f.expect("ftp> ") do - w_f.print "cd pub/lang/ruby\n" + r_f.expect("> ") do + w_f.print "cd pub/ruby\n" end - r_f.expect("ftp> ") do + r_f.expect("> ") do w_f.print "dir\n" end - r_f.expect("ftp> ") do |output| + r_f.expect("> ") do |output| for x in output[0].split("\n") if x =~ /(ruby.*\.tar\.gz)/ then fnames.push $1 -- cgit v1.2.3