summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/matrix.rb12
-rw-r--r--lib/telnet.rb48
-rw-r--r--lib/tk.rb22
3 files changed, 58 insertions, 24 deletions
diff --git a/lib/matrix.rb b/lib/matrix.rb
index 14b4d47..99f4485 100644
--- a/lib/matrix.rb
+++ b/lib/matrix.rb
@@ -1,8 +1,8 @@
#
# matrix.rb -
# $Release Version: 1.0$
-# $Revision: 1.5 $
-# $Date: 1998/07/14 14:35:18 $
+# $Revision: 1.6 $
+# $Date: 1998/07/31 03:39:49 $
# Original Version from Smalltalk-80 version
# on July 23, 1985 at 8:37:17 am
# by Keiju ISHITSUKA
@@ -179,7 +179,7 @@ module ExceptionForMatrix
end
class Matrix
- @RCS_ID='-$Id: matrix.rb,v 1.5 1998/07/14 14:35:18 keiju Exp keiju $-'
+ @RCS_ID='-$Id: matrix.rb,v 1.6 1998/07/31 03:39:49 keiju Exp keiju $-'
include ExceptionForMatrix
@@ -361,7 +361,7 @@ class Matrix
other.compare_by_row_vectors(@rows)
end
- alias eqn? ==
+ alias eql? ==
def compare_by_row_vectors(rows)
return FALSE unless @rows.size == rows.size
@@ -515,7 +515,7 @@ class Matrix
end
for i in 0 .. size
- continue if i == k
+ next if i == k
q = a[i][k] / akk
a[i][k] = 0
@@ -620,7 +620,7 @@ class Matrix
break
end
end while a[i][k] == 0
- continue if nothing
+ next if nothing
a[i], a[k] = a[k], a[i]
akk = a[k][k]
end
diff --git a/lib/telnet.rb b/lib/telnet.rb
index d9c72f6..4e690b9 100644
--- a/lib/telnet.rb
+++ b/lib/telnet.rb
@@ -1,8 +1,24 @@
#
# telnet.rb
-# ver0.12 1998/06/01
+# ver0.122 1998/08/05
# Wakou Aoyama <wakou@fsinet.or.jp>
#
+# ver0.122 1998/08/05
+# support for HP-UX 10.20 thanks to WATANABE Tetsuya <tetsu@jpn.hp.com>
+# socket.<< --> socket.write
+#
+# ver0.121 1998/07/15
+# string.+= --> string.concat
+#
+# ver0.12 1998/06/01
+# add timeout, waittime.
+#
+# ver0.11 1998/04/21
+# add realtime output.
+#
+# ver0.10 1998/04/13
+# first release.
+#
# == make new Telnet object
# host = Telnet.new({"Binmode" => TRUE, default: TRUE
# "Host" => "localhost", default: "localhost"
@@ -139,14 +155,14 @@ class Telnet < SimpleDelegator
end
message = "Trying " + @options["Host"] + "...\n"
- STDOUT << message
- @log << message if @options.include?("Output_log")
+ STDOUT.write(message)
+ @log.write(message) if @options.include?("Output_log")
is_timeout = timeout(@options["Timeout"]){
begin
@sock = TCPsocket.open(@options["Host"], @options["Port"])
rescue
- @log << $! << "\n" if @options.include?("Output_log")
+ @log.write($! + "\n") if @options.include?("Output_log")
raise
end
}
@@ -155,8 +171,8 @@ class Telnet < SimpleDelegator
@sock.binmode if @options["Binmode"]
message = "Connected to " + @options["Host"] + ".\n"
- STDOUT << message
- @log << message if @options.include?("Output_log")
+ STDOUT.write(message)
+ @log.write(message) if @options.include?("Output_log")
super(@sock)
end
@@ -166,7 +182,7 @@ class Telnet < SimpleDelegator
# respond to "IAC DO x" or "IAC DON'T x" with "IAC WON'T x"
str.gsub!(/([^#{IAC}])?#{IAC}[#{DO}#{DONT}](.|\n)/no){
- @sock << IAC << WONT << $2
+ @sock.write(IAC + WONT + $2)
$1
}
@@ -175,7 +191,7 @@ class Telnet < SimpleDelegator
# respond to "IAC AYT" (are you there)
str.gsub!(/([^#{IAC}])?#{IAC}#{AYT}/no){
- @sock << "nobody here but us pigeons" << CR
+ @sock.write("nobody here but us pigeons" + CR)
$1
}
@@ -212,7 +228,7 @@ class Telnet < SimpleDelegator
ensure
@log.print(buf) if @options.include?("Output_log")
yield buf if iterator?
- line += buf
+ line.concat(buf)
end
end
line
@@ -231,7 +247,7 @@ class Telnet < SimpleDelegator
end
select(nil, [@sock])
- @sock << string.gsub(/\n/, CR) << CR
+ @sock.write(string.gsub(/\n/, CR) + CR)
if iterator?
waitfor({"Prompt" => match, "Timeout" => timeout}){|c| yield c }
else
@@ -249,14 +265,14 @@ class Telnet < SimpleDelegator
if iterator?
line = waitfor(/login[: ]*$/){|c| yield c }
- line += cmd({"String" => username,
- "Match" => /Password[: ]*$/}){|c| yield c }
- line += cmd(password){|c| yield c }
+ line.concat( cmd({"String" => username,
+ "Match" => /Password[: ]*$/}){|c| yield c } )
+ line.concat( cmd(password){|c| yield c } )
else
line = waitfor(/login[: ]*$/)
- line += cmd({"String" => username,
- "Match" => /Password[: ]*$/})
- line += cmd(password)
+ line.concat( cmd({"String" => username,
+ "Match" => /Password[: ]*$/}) )
+ line.concat( cmd(password) )
end
line
end
diff --git a/lib/tk.rb b/lib/tk.rb
index 13cb49b..f44a1fe 100644
--- a/lib/tk.rb
+++ b/lib/tk.rb
@@ -903,7 +903,7 @@ class TkVariable
@trace_var.each_with_index{|i,e|
if idx < 0 && e[0] == opts && e[1] == cmd
idx = i
- continue
+ next
end
e[0].each_byte{|c| newopts += c.chr unless newopts.index(c)}
}
@@ -937,7 +937,7 @@ class TkVariable
@trace_elem[elem].each_with_index{|i,e|
if idx < 0 && e[0] == opts && e[1] == cmd
idx = i
- continue
+ next
end
}
if idx >= 0
@@ -1322,6 +1322,24 @@ module TkWinfo
def winfo_viewable
TkWinfo.viewable self
end
+ def TkWinfo.pointerx(window)
+ number(tk_call('winfo', 'pointerx', window.path))
+ end
+ def winfo_pointerx
+ TkWinfo.pointerx self
+ end
+ def TkWinfo.pointery(window)
+ number(tk_call('winfo', 'pointery', window.path))
+ end
+ def winfo_pointery
+ TkWinfo.pointery self
+ end
+ def TkWinfo.pointerxy(window)
+ list(tk_call('winfo', 'pointerxy', window.path))
+ end
+ def winfo_pointerxy
+ TkWinfo.pointerxy self
+ end
end
module TkPack