summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
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 f3654c3ca2..fd2a3c4dc5 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 a84180365b..855a9f5334 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