summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-04-16 06:03:36 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-04-16 06:03:36 +0000
commitbcab5ca9d1b50cc940d3c2cf190c6ef18a20f3d0 (patch)
treefbb231b10c7092bef845762c8ea4434e851088a6 /lib
parentf96faa860bfaf119ed379db160c24bd815376fd1 (diff)
prepare to alpha
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/telnet.rb20
-rw-r--r--lib/thread.rb3
2 files changed, 20 insertions, 3 deletions
diff --git a/lib/telnet.rb b/lib/telnet.rb
index 098cbc9..a841803 100644
--- a/lib/telnet.rb
+++ b/lib/telnet.rb
@@ -2,7 +2,7 @@
= simple telnet cliant library
-telnet.rb ver0.162 1999/03/18
+telnet.rb ver0.163 1999/04/11
Wakou Aoyama <wakou@fsinet.or.jp>
@@ -30,6 +30,17 @@ if set "Telnetmode" option FALSE. not TELNET command interpretation.
the same character as "Prompt" is included in the data, and, when
the network or the host is very heavy, the value is enlarged.
+=== status output
+
+ host = Telnet.new({"Hosh" => "localhost"){|c| print c }
+
+connection status output.
+
+example
+
+Trying localhost...
+Connected to localhost.
+
== waitfor (wait for match)
@@ -133,6 +144,9 @@ of cource, set sync=TRUE or flush is necessary.
= history
+ver0.163 1999/04/11
+STDOUT.write(message) --> yield(message) if iterator?
+
ver0.162 1999/03/17
add "Proxy" option
required timeout.rb
@@ -291,7 +305,7 @@ class Telnet < SimpleDelegator
end
else
message = "Trying " + @options["Host"] + "...\n"
- STDOUT.write(message)
+ yield(message) if iterator?
@log.write(message) if @options.include?("Output_log")
@dumplog.write(message) if @options.include?("Dump_log")
@@ -310,7 +324,7 @@ class Telnet < SimpleDelegator
@sock.binmode
message = "Connected to " + @options["Host"] + ".\n"
- STDOUT.write(message)
+ yield(message) if iterator?
@log.write(message) if @options.include?("Output_log")
@dumplog.write(message) if @options.include?("Dump_log")
end
diff --git a/lib/thread.rb b/lib/thread.rb
index 4e6d765..936768f 100644
--- a/lib/thread.rb
+++ b/lib/thread.rb
@@ -120,6 +120,7 @@ class Queue
Thread.critical = false
t.run if t
end
+ alias enq push
def pop non_block=false
Thread.critical = true
@@ -139,6 +140,8 @@ class Queue
Thread.critical = false
end
end
+ alias shift pop
+ alias deq pop
def empty?
@que.length == 0