• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/ruby-106/ruby/lib/net/

Lines Matching refs:options

179     # +options+ is a hash of options.  The following example lists
180 # all options and their default values.
197 # The options have the following meanings:
211 # the newline conversion is also affected by the telnet options
273 def initialize(options) # :yield: mesg
274 @options = options
275 @options["Host"] = "localhost" unless @options.has_key?("Host")
276 @options["Port"] = 23 unless @options.has_key?("Port")
277 @options["Prompt"] = /[$%#>] \z/n unless @options.has_key?("Prompt")
278 @options["Timeout"] = 10 unless @options.has_key?("Timeout")
279 @options["Waittime"] = 0 unless @options.has_key?("Waittime")
280 unless @options.has_key?("Binmode")
281 @options["Binmode"] = false
283 unless (true == @options["Binmode"] or false == @options["Binmode"])
288 unless @options.has_key?("Telnetmode")
289 @options["Telnetmode"] = true
291 unless (true == @options["Telnetmode"] or false == @options["Telnetmode"])
298 if @options.has_key?("Output_log")
299 @log = File.open(@options["Output_log"], 'a+')
304 if @options.has_key?("Dump_log")
305 @dumplog = File.open(@options["Dump_log"], 'a+')
331 if @options.has_key?("Proxy")
332 if @options["Proxy"].kind_of?(Net::Telnet)
333 @sock = @options["Proxy"].sock
334 elsif @options["Proxy"].kind_of?(IO)
335 @sock = @options["Proxy"]
340 message = "Trying " + @options["Host"] + "...\n"
342 @log.write(message) if @options.has_key?("Output_log")
343 @dumplog.log_dump('#', message) if @options.has_key?("Dump_log")
346 if @options["Timeout"] == false
347 @sock = TCPSocket.open(@options["Host"], @options["Port"])
349 Timeout.timeout(@options["Timeout"], Net::OpenTimeout) do
350 @sock = TCPSocket.open(@options["Host"], @options["Port"])
356 @log.write($ERROR_INFO.to_s + "\n") if @options.has_key?("Output_log")
357 @dumplog.log_dump('#', $ERROR_INFO.to_s + "\n") if @options.has_key?("Dump_log")
363 message = "Connected to " + @options["Host"] + ".\n"
365 @log.write(message) if @options.has_key?("Output_log")
366 @dumplog.log_dump('#', message) if @options.has_key?("Dump_log")
384 @options["Telnetmode"]
386 @options["Telnetmode"] = mode
397 @options["Telnetmode"] = mode
408 @options["Binmode"]
410 @options["Binmode"] = mode
419 @options["Binmode"] = mode
433 string = string.gsub(/#{CR}#{NULL}/no, CR) if @options["Telnetmode"]
436 string = string.gsub(/#{EOL}/no, "\n") unless @options["Binmode"]
439 string = string.gsub(/#{NULL}/no, '') unless @options["Binmode"]
500 # +options+ can be either a regular expression or a hash of options.
502 # If a hash, this can specify the following options:
528 def waitfor(options) # :yield: recvdata
529 time_out = @options["Timeout"]
530 waittime = @options["Waittime"]
531 fail_eof = @options["FailEOF"]
533 if options.kind_of?(Hash)
534 prompt = if options.has_key?("Match")
535 options["Match"]
536 elsif options.has_key?("Prompt")
537 options["Prompt"]
538 elsif options.has_key?("String")
539 Regexp.new( Regexp.quote(options["String"]) )
541 time_out = options["Timeout"] if options.has_key?("Timeout")
542 waittime = options["Waittime"] if options.has_key?("Waittime")
543 fail_eof = options["FailEOF"] if options.has_key?("FailEOF")
545 prompt = options
561 @dumplog.log_dump('<', c) if @options.has_key?("Dump_log")
562 if @options["Telnetmode"]
583 unless @options["Binmode"]
591 @log.print(buf) if @options.has_key?("Output_log")
614 @dumplog.log_dump('>', string[-length..-1]) if @options.has_key?("Dump_log")
623 # depending upon the values of telnetmode, binmode, and telnet options
626 string = string.gsub(/#{IAC}/no, IAC + IAC) if @options["Telnetmode"]
628 if @options["Binmode"]
661 # +options+ is either a String, specified the string or command to
662 # send to the host; or it is a hash of options. If a hash, the
663 # following options can be specified:
678 def cmd(options) # :yield: recvdata
679 match = @options["Prompt"]
680 time_out = @options["Timeout"]
681 fail_eof = @options["FailEOF"]
683 if options.kind_of?(Hash)
684 string = options["String"]
685 match = options["Match"] if options.has_key?("Match")
686 time_out = options["Timeout"] if options.has_key?("Timeout")
687 fail_eof = options["FailEOF"] if options.has_key?("FailEOF")
689 string = options
722 def login(options, password = nil) # :yield: recvdata
725 if options.kind_of?(Hash)
726 username = options["Name"]
727 password = options["Password"]
728 login_prompt = options["LoginPrompt"] if options["LoginPrompt"]
729 password_prompt = options["PasswordPrompt"] if options["PasswordPrompt"]
731 username = options