diff options
Diffstat (limited to 'ext/pty')
-rw-r--r-- | ext/pty/expect_sample.rb | 8 | ||||
-rw-r--r-- | ext/pty/script.rb | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/ext/pty/expect_sample.rb b/ext/pty/expect_sample.rb index 2a2e29f866..d3b072b83c 100644 --- a/ext/pty/expect_sample.rb +++ b/ext/pty/expect_sample.rb @@ -12,9 +12,9 @@ require 'expect' fnames = [] PTY.spawn("ftp ftp.ruby-lang.org") do |r_f,w_f,pid| w_f.sync = true - + $expect_verbose = false - + if !ENV['USER'].nil? username = ENV['USER'] elsif !ENV['LOGNAME'].nil? @@ -22,14 +22,14 @@ PTY.spawn("ftp ftp.ruby-lang.org") do |r_f,w_f,pid| else username = 'guest' end - + r_f.expect(/^(Name).*: |(word):|> /) do w_f.puts($1 ? "ftp" : $2 ? "#{username}@" : "cd pub/ruby") end r_f.expect("> ") do w_f.print "dir\n" end - + r_f.expect(/[^\-]> /) do |output| for x in output[0].split("\n") if x =~ /(ruby.*?\.tar\.gz)/ then diff --git a/ext/pty/script.rb b/ext/pty/script.rb index dbb933171f..903a6f75bd 100644 --- a/ext/pty/script.rb +++ b/ext/pty/script.rb @@ -18,7 +18,7 @@ PTY.spawn("/bin/csh") do |r_pty,w_pty,pid| w_pty.flush end end - + begin while true c = r_pty.sysread(512) |