summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-04-30 07:55:47 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-04-30 07:55:47 +0000
commitb8669fe321c6f5e81d071d5790e51b9611fde860 (patch)
treed19d4f3da2790c53b046a861714f6fc21728d7e1 /lib
parentb87b7e3fc1499a9f56d1a49aff22838c2166950c (diff)
glibc 2.1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/mkmf.rb11
-rw-r--r--lib/telnet.rb21
2 files changed, 21 insertions, 11 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index f3654c3..fd2a3c4 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -71,9 +71,8 @@ def xsystem command
print command, "\n"
return system(command)
end
-p command
-# $stderr.reopen($null)
-# $stdout.reopen($null)
+ $stderr.reopen($null)
+ $stdout.reopen($null)
r = system(command)
$stderr.reopen($orgerr)
$stdout.reopen($orgout)
@@ -84,7 +83,11 @@ def try_link(src, opt="")
cfile = open("conftest.c", "w")
cfile.print src
cfile.close
- xsystem(format(LINK, $CFLAGS, $LDFLAGS, opt))
+ begin
+ xsystem(format(LINK, $CFLAGS, $LDFLAGS, opt))
+ ensure
+ system "rm -f conftest*"
+ end
end
def try_cpp(src, opt=$CFLAGS)
diff --git a/lib/telnet.rb b/lib/telnet.rb
index a841803..855a9f5 100644
--- a/lib/telnet.rb
+++ b/lib/telnet.rb
@@ -2,8 +2,7 @@
= simple telnet cliant library
-telnet.rb ver0.163 1999/04/11
-
+telnet.rb ver0.17 1999/04/30
Wakou Aoyama <wakou@fsinet.or.jp>
@@ -144,6 +143,10 @@ of cource, set sync=TRUE or flush is necessary.
= history
+ver0.17 1999/04/30
+bug fix
+$! + "\n" --> $!.to_s + "\n"
+
ver0.163 1999/04/11
STDOUT.write(message) --> yield(message) if iterator?
@@ -316,8 +319,8 @@ class Telnet < SimpleDelegator
rescue TimeoutError
raise TimeOut, "timed-out; opening of the host"
rescue
- @log.write($! + "\n") if @options.include?("Output_log")
- @dumplog.write($! + "\n") if @options.include?("Dump_log")
+ @log.write($!.to_s + "\n") if @options.include?("Output_log")
+ @dumplog.write($!.to_s + "\n") if @options.include?("Dump_log")
raise
end
@sock.sync = TRUE
@@ -400,11 +403,15 @@ class Telnet < SimpleDelegator
waittime = @options["Waittime"]
if options.kind_of?(Hash)
- prompt = options["Prompt"] if options.include?("Prompt")
+ prompt = if options.include?("Match")
+ options["Match"]
+ elsif options.include?("Prompt")
+ options["Prompt"]
+ elsif options.include?("String")
+ Regexp.new( Regexp.quote(options["String"]) )
+ end
time_out = options["Timeout"] if options.include?("Timeout")
waittime = options["Waittime"] if options.include?("Waittime")
- prompt = Regexp.new( Regexp.quote(options["String"]) ) if
- options.include?("String")
else
prompt = options
end