wakou
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e2adc86984
commit
9d823983dc
@ -510,12 +510,7 @@ module Net
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def print(string)
|
def _print(string)
|
||||||
if $VERBOSE
|
|
||||||
$stderr.puts 'WARNING: Telnet#print("string") NOT adds "\n" to the last of "string", in the future.'
|
|
||||||
$stderr.puts ' cf. Telnet#puts().'
|
|
||||||
end
|
|
||||||
string = string + "\n"
|
|
||||||
string = string.gsub(/#{IAC}/no, IAC + IAC) if @options["Telnetmode"]
|
string = string.gsub(/#{IAC}/no, IAC + IAC) if @options["Telnetmode"]
|
||||||
|
|
||||||
if @options["Binmode"]
|
if @options["Binmode"]
|
||||||
@ -535,7 +530,15 @@ module Net
|
|||||||
end
|
end
|
||||||
|
|
||||||
def puts(string)
|
def puts(string)
|
||||||
self.print(string)
|
self._print(string + "\n")
|
||||||
|
end
|
||||||
|
|
||||||
|
def print(string)
|
||||||
|
if $VERBOSE
|
||||||
|
$stderr.puts 'WARNING: Telnet#print("string") NOT adds "\n" to the last of "string", in the future.'
|
||||||
|
$stderr.puts ' cf. Telnet#puts().'
|
||||||
|
end
|
||||||
|
self.puts(string)
|
||||||
end
|
end
|
||||||
|
|
||||||
def cmd(options)
|
def cmd(options)
|
||||||
@ -550,7 +553,7 @@ module Net
|
|||||||
string = options
|
string = options
|
||||||
end
|
end
|
||||||
|
|
||||||
self.print(string)
|
self.puts(string)
|
||||||
if iterator?
|
if iterator?
|
||||||
waitfor({"Prompt" => match, "Timeout" => time_out}){|c| yield c }
|
waitfor({"Prompt" => match, "Timeout" => time_out}){|c| yield c }
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user